nckernel  0.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
stddef.h
Go to the documentation of this file.
1 
11 #define NULL (void*)0
12 #define restrict /* restrict */
13 
17 #ifdef __compiler_offsetof
18 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
19 #else
20 #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
21 #endif
22 
23 #define __PACKED __attribute__((packed))
24 
28 #define __UNUSED __attribute__((unused))
29 
33 #define __NORET __attribute__((noreturn))
34 
42 #define container_of(ptr, type, member) \
43  ({ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
44  (type *)( (char *)__mptr - offsetof(type,member) );})
45 
49 #define prefetch(a) (void)(a)
50