From 9b463361b3e40c89c481681960091639cee17f70 Mon Sep 17 00:00:00 2001 From: Christian Ruppert Date: Tue, 21 Jun 2011 00:05:08 +0200 Subject: [PATCH] Don't redefine offsetof when already defined by e.g. stddef.h --- include/netlink-local.h | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/include/netlink-local.h b/include/netlink-local.h index 32e8302..12e9ce0 100644 --- a/include/netlink-local.h +++ b/include/netlink-local.h @@ -119,7 +119,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)) -- 1.7.3.4