Embedded Artistry libc
C Standard Library Support for Bare-metal Systems
stddef.h
Go to the documentation of this file.
1 #ifndef STDDEF_H_
2 #define STDDEF_H_
3 
4 #include <_types/_ptrdiff_t.h>
5 #include <_types/_size_t.h>
6 
7 #pragma mark - NULL -
8 
9 #ifdef __cplusplus
10 
11 #define NULL 0L
12 #else
13 
15 #define NULL ((void*)0)
16 #endif
17 
18 #pragma mark - offsetof -
19 
20 #if __GNUC__ > 3
21 
23 #define offsetof(type, member) __builtin_offsetof(type, member)
24 #else
25 
27 #define offsetof(type, member) ((size_t)((char*)&(((type*)0)->member) - (char*)0))
28 #endif
29 
30 #pragma mark - max_align_t -
31 
32 #if(defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) || \
33  (defined(__cplusplus) && __cplusplus >= 201103L)
34 
36 typedef long double max_align_t;
37 #endif
38 
39 #endif // STDDEF_H_