110-offsetof.patch 361 B

123456789101112
  1. --- a/include/netlink-local.h
  2. +++ b/include/netlink-local.h
  3. @@ -337,7 +337,9 @@ static inline int nl_cb_call(struct nl_c
  4. }
  5. #define ARRAY_SIZE(X) (sizeof(X) / sizeof((X)[0]))
  6. +#ifndef offsetof
  7. #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
  8. +#endif
  9. #define __init __attribute__ ((constructor))
  10. #define __exit __attribute__ ((destructor))