|
@@ -25,7 +25,9 @@
|
|
#include "bpf_util.h"
|
|
#include "bpf_util.h"
|
|
|
|
|
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
#define min(a, b) ((a) < (b) ? (a) : (b))
|
|
-#define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
|
|
|
|
|
|
+#ifndef offsetof
|
|
|
|
+# define offsetof(TYPE, MEMBER) ((size_t)&((TYPE *)0)->MEMBER)
|
|
|
|
+#endif
|
|
#define container_of(ptr, type, member) ({ \
|
|
#define container_of(ptr, type, member) ({ \
|
|
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
const typeof( ((type *)0)->member ) *__mptr = (ptr); \
|
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|
|
(type *)( (char *)__mptr - offsetof(type,member) );})
|