include: [c.h] protect container_of
PATCH 1/1 include: [c.h] protect container_of
fixes lots of warning noise:../../../include/c.h:112:0: warning: "container_of" redefined [enabled by default]/usr/lib/klibc/include/stddef.h:52:0: note: this is the location of the previous definition
Signed-off-by maximilian attems <[email protected]>
--- include/c.h | 2 ++ 1 file changed, 2 insertions(+)
include/c.h +2 -0
@@ -109,9 +109,11 @@#define offsetof (TYPE ,MEMBER ) ((size_t) &((TYPE *)0)->MEMBER)#endif +#ifndef container_of#define container_of (ptr, type, member) ({ \ const __typeof__( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#endif #ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME # ifdef HAVE___PROGNAME
Signature · 1 line
1.7.10
Quoted 2 lines · maximilian attems
include/c.h | 2 ++ 1 file changed, 2 insertions(+)
Applied, thanks.
Signature · 2 lines
Karel Zak <[email protected]> http://karelzak.blogspot.com