]> granicus.if.org Git - libnl/commitdiff
Don't redefine offsetof when already defined by e.g. stddef.h
authorChristian Ruppert <idl0r@gentoo.org>
Mon, 20 Jun 2011 22:05:08 +0000 (00:05 +0200)
committerThomas Graf <tgraf@suug.ch>
Tue, 21 Jun 2011 09:33:44 +0000 (11:33 +0200)
include/netlink-local.h

index 63dd661938dd2d5570e2eb48fa6baf7ec35d4d2d..01c611a2d6435b2d0f88babd88da71c684c99cb3 100644 (file)
@@ -43,6 +43,7 @@
 #include <linux/if.h>
 #include <linux/if_arp.h>
 #include <linux/if_ether.h>
+#include <linux/ethtool.h>
 #include <linux/pkt_sched.h>
 #include <linux/pkt_cls.h>
 #include <linux/gen_stats.h>
@@ -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))