WAIT/POST_SEM(): generalize interface (and more)
[tinycc.git] / include / stddef.h
blobea024f3088e743c743f97a04ed0ff7432bbf24c8
1 #ifndef _STDDEF_H
2 #define _STDDEF_H
4 typedef __SIZE_TYPE__ size_t;
5 typedef __PTRDIFF_TYPE__ ssize_t;
6 typedef __WCHAR_TYPE__ wchar_t;
7 typedef __PTRDIFF_TYPE__ ptrdiff_t;
8 typedef __PTRDIFF_TYPE__ intptr_t;
9 typedef __SIZE_TYPE__ uintptr_t;
11 #if __STDC_VERSION__ >= 201112L
12 typedef union { long long __ll; long double __ld; } max_align_t;
13 #endif
15 #ifndef NULL
16 #define NULL ((void*)0)
17 #endif
19 #undef offsetof
20 #define offsetof(type, field) ((size_t)&((type *)0)->field)
22 void *alloca(size_t size);
24 #endif
26 /* Older glibc require a wint_t from <stddef.h> (when requested
27 by __need_wint_t, as otherwise stddef.h isn't allowed to
28 define this type). Note that this must be outside the normal
29 _STDDEF_H guard, so that it works even when we've included the file
30 already (without requiring wint_t). Some other libs define _WINT_T
31 if they've already provided that type, so we can use that as guard.
32 TCC defines __WINT_TYPE__ for us. */
33 #if defined (__need_wint_t)
34 #ifndef _WINT_T
35 #define _WINT_T
36 typedef __WINT_TYPE__ wint_t;
37 #endif
38 #undef __need_wint_t
39 #endif