* [PATCH] include: [c.h] protect container_of
@ 2012-05-22 14:20 maximilian attems
2012-05-23 8:32 ` Karel Zak
0 siblings, 1 reply; 2+ messages in thread
From: maximilian attems @ 2012-05-22 14:20 UTC (permalink / raw)
To: util-linux; +Cc: maximilian attems
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 <max@stro.at>
---
include/c.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/include/c.h b/include/c.h
index b6d8ced..8c8db73 100644
--- a/include/c.h
+++ b/include/c.h
@@ -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
--
1.7.10
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-05-23 8:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-22 14:20 [PATCH] include: [c.h] protect container_of maximilian attems
2012-05-23 8:32 ` Karel Zak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).