rules.h: Use more consistent naming
[coreboot.git] / src / include / stddef.h
blob100368eddb49a8df970fdc32e65ee0df168ed9d2
1 #ifndef STDDEF_H
2 #define STDDEF_H
4 #include <commonlib/helpers.h>
6 typedef __PTRDIFF_TYPE__ ptrdiff_t;
7 typedef __SIZE_TYPE__ size_t;
8 /* There is a GCC macro for a size_t type, but not
9 * for a ssize_t type. Below construct tricks GCC
10 * into making __SIZE_TYPE__ signed.
12 #define unsigned signed
13 typedef __SIZE_TYPE__ ssize_t;
14 #undef unsigned
16 typedef __WCHAR_TYPE__ wchar_t;
17 typedef __WINT_TYPE__ wint_t;
19 #define NULL ((void *)0)
21 /* The devicetree data structures are only mutable in ramstage. All other
22 stages have a constant devicetree. */
23 #if !ENV_PAYLOAD_LOADER
24 #define DEVTREE_EARLY 1
25 #else
26 #define DEVTREE_EARLY 0
27 #endif
29 #if DEVTREE_EARLY
30 #define DEVTREE_CONST const
31 #else
32 #define DEVTREE_CONST
33 #endif
35 #if ENV_HAS_DATA_SECTION
36 #define MAYBE_STATIC_NONZERO static
37 #else
38 #define MAYBE_STATIC_NONZERO
39 #endif
41 /* Provide a pointer to address 0 that thwarts any "accessing this is
42 * undefined behaviour and do whatever" trickery in compilers.
43 * Use when you _really_ need to read32(zeroptr) (ie. read address 0).
45 extern char zeroptr[];
47 #endif /* STDDEF_H */