fix a build warning in libnl
[openwrt-10.03/.git] / package / libnl / patches / 110-offsetof.patch
1 Index: libnl-1.0-pre8/include/netlink-local.h
2 ===================================================================
3 --- libnl-1.0-pre8.orig/include/netlink-local.h 2007-12-29 13:40:25.242226458 +0100
4 +++ libnl-1.0-pre8/include/netlink-local.h      2007-12-29 13:40:36.882889824 +0100
5 @@ -336,7 +336,9 @@
6  }
7  
8  #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
9 +#ifndef offsetof
10  #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
11 +#endif
12  
13  #define __init __attribute__ ((constructor))
14  #define __exit __attribute__ ((destructor))