[Pcsclite-cvs-commit] r5513 - /trunk/Drivers/ccid/src/commands.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jan 18 15:13:10 UTC 2011


Author: rousseau
Date: Tue Jan 18 15:12:51 2011
New Revision: 5513

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5513
Log:
Do not redefine macro offsetof() if already defined

Thanks to clang(1) compiler
commands.c:51:9: warning: 'offsetof' macro redefined [-pedantic]
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
        ^
In file included from commands.c:25:
In file included from /usr/include/string.h:33:
/usr/lib/clang/1.1/include/stddef.h:41:9: note: previous definition is here
#define offsetof(t, d) __builtin_offsetof(t, d)
        ^

Modified:
    trunk/Drivers/ccid/src/commands.c

Modified: trunk/Drivers/ccid/src/commands.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/commands.c?rev=5513&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/commands.c (original)
+++ trunk/Drivers/ccid/src/commands.c Tue Jan 18 15:12:51 2011
@@ -48,7 +48,9 @@
 #define BOGUS_SCM_FIRMWARE_FOR_dwMaxCCIDMessageLength
 
 #define max( a, b )   ( ( ( a ) > ( b ) ) ? ( a ) : ( b ) )
+#ifndef offsetof
 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
 
 #ifndef BSWAP_16
 #define BSWAP_8(x)  ((x) & 0xff)




More information about the Pcsclite-cvs-commit mailing list