|
|
1.1 root 1: #ifndef STDDEF_H
2: #define STDDEF_H
3:
4: FILE_LICENCE ( GPL2_ONLY );
5:
6: /* for size_t */
7: #include <stdint.h>
8:
9: #undef NULL
10: #define NULL ((void *)0)
11:
12: #undef offsetof
13: #if ( defined ( __GNUC__ ) && ( __GNUC__ > 3 ) )
14: #define offsetof(TYPE, MEMBER) __builtin_offsetof(TYPE, MEMBER)
15: #else
16: #define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
17: #endif
18:
19: #undef container_of
20: #define container_of(ptr, type, member) ({ \
21: const typeof( ((type *)0)->member ) *__mptr = (ptr); \
22: (type *)( (char *)__mptr - offsetof(type,member) );})
23:
24: /* __WCHAR_TYPE__ is defined by gcc and will change if -fshort-wchar is used */
25: #ifndef __WCHAR_TYPE__
26: #define __WCHAR_TYPE__ long int
27: #endif
28: typedef __WCHAR_TYPE__ wchar_t;
29:
30: #endif /* STDDEF_H */
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.