summaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
Diffstat (limited to 'shared')
-rw-r--r--shared/list.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/shared/list.h b/shared/list.h
index df4092a..be59dc9 100644
--- a/shared/list.h
+++ b/shared/list.h
@@ -1,6 +1,11 @@
#ifndef foolisthfoo
#define foolisthfoo
+/*
+ * Doubly linked list implementation from the Linux kernel
+ * Copyright Linus Torvalds et al, GPLv2
+*/
+
struct list_head {
struct list_head *next;
struct list_head *prev;
@@ -46,7 +51,7 @@ static inline bool list_empty(struct list_head *list)
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#define container_of(ptr, type, member) ({ \
+#define container_of(ptr, type, member) __extension__ ({ \
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
(type *)( (char *)__mptr - offsetof(type,member) );})