commit 5b7fb16d1da2779497e8ff41ca4a7c5753fc4320
parent dbc347a91ad68bb40250a5f383bcd63d359268a0
Author: sin <sin@2f30.org>
Date: Mon, 4 Jun 2012 23:05:57 +0100
sscall: Don't open code offsetof()
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/list.h b/list.h
@@ -1,7 +1,8 @@
#ifndef _LIST_H
#define _LIST_H
-#define offsetof(TYPE, MEMBER) ((size_t)__builtin_offsetof(TYPE, MEMBER))
+#include <stddef.h>
+
#define container_of(ptr, type, member) ({ const typeof( ((type *)0)->member ) *__mptr = (ptr); (type *)( (char *)__mptr - offsetof(type,member) ); })
/**