Current code doesn't use pre-defiend compiler macro for offsetof
because __compiler_offsetof is not defined anywhere.  This patch
includes stddef.h, which defines offsetof with __builtin_offsetof,
rather than redefining it.

Signed-off-by: MORITA Kazutaka <[email protected]>
---
 include/list.h |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/include/list.h b/include/list.h
index e1d645d..0c9d156 100644
--- a/include/list.h
+++ b/include/list.h
@@ -3,12 +3,7 @@
 
 /* taken from linux kernel */
 
-#undef offsetof
-#ifdef __compiler_offsetof
-#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
-#else
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
+#include <stddef.h>
 
 #define container_of(ptr, type, member) ({                     \
         const typeof( ((type *)0)->member ) *__mptr = (ptr);   \
-- 
1.7.2.5

-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to