Adding upstream version 6.02~pre8+dfsg.
[syslinux-debian/hramrach.git] / com32 / include / stddef.h
blobf52d62f34206a6faef3ce7fa28f592a2305fa9a6
1 /*
2 * stddef.h
3 */
5 #ifndef _STDDEF_H
6 #define _STDDEF_H
8 #ifndef __KLIBC__
9 # define __KLIBC__ 1
10 #endif
12 #include <bitsize/stddef.h>
14 #undef NULL
15 #ifdef __cplusplus
16 # define NULL 0
17 #else
18 # define NULL ((void *)0)
19 #endif
21 #undef offsetof
22 #define offsetof(t,m) ((size_t)&((t *)0)->m)
24 #undef container_of
26 * The container_of construct: if p is a pointer to member m of
27 * container class c, then return a pointer to the container of which
28 * *p is a member.
30 #define container_of(p, c, m) ((c *)((char *)(p) - offsetof(c,m)))
32 #endif /* _STDDEF_H */