From 4806c5c058ba95b0c88af7731d26dad427d2fcb8 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Tue, 21 Jun 2011 00:05:08 +0200 Subject: Don't redefine offsetof when already defined by e.g. stddef.h --- include/netlink-local.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/netlink-local.h b/include/netlink-local.h index 63dd661..01c611a 100644 --- a/include/netlink-local.h +++ b/include/netlink-local.h @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #include @@ -126,7 +127,11 @@ static inline int nl_cb_call(struct nl_cb *cb, int type, struct nl_msg *msg) } #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0])) + +/* This is also defined in stddef.h */ +#ifndef offsetof #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif #define __init __attribute__ ((constructor)) #define __exit __attribute__ ((destructor)) -- cgit v1.2.1