summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/netlink/list.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/include/netlink/list.h b/include/netlink/list.h
index c6876a7..6eae216 100644
--- a/include/netlink/list.h
+++ b/include/netlink/list.h
@@ -12,6 +12,8 @@
#ifndef NETLINK_LIST_H_
#define NETLINK_LIST_H_
+#include <stddef.h>
+
struct nl_list_head
{
struct nl_list_head * next;
@@ -54,7 +56,7 @@ static inline int nl_list_empty(struct nl_list_head *head)
#define nl_container_of(ptr, type, member) ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - ((size_t) &((type *)0)->member));})
+ (type *) ((char *) __mptr - (offsetof(type, member)));})
#define nl_list_entry(ptr, type, member) \
nl_container_of(ptr, type, member)