manpages: do not include v4-only modules in ip6tables manpage
[jleu-iptables.git] / libiptc / linux_stddef.h
blob56416f104ecfc26081ed00f4a304ece529459ccb
1 #ifndef _LINUX_STDDEF_H
2 #define _LINUX_STDDEF_H
4 #undef NULL
5 #if defined(__cplusplus)
6 #define NULL 0
7 #else
8 #define NULL ((void *)0)
9 #endif
11 #undef offsetof
12 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
15 /**
16 * container_of - cast a member of a structure out to the containing structure
18 * @ptr: the pointer to the member.
19 * @type: the type of the container struct this is embedded in.
20 * @member: the name of the member within the struct.
23 #define container_of(ptr, type, member) ({ \
24 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
25 (type *)( (char *)__mptr - offsetof(type,member) );})
28 * Check at compile time that something is of a particular type.
29 * Always evaluates to 1 so you may use it easily in comparisons.
31 #define typecheck(type,x) \
32 ({ type __dummy; \
33 typeof(x) __dummy2; \
34 (void)(&__dummy == &__dummy2); \
35 1; \
39 #endif