Revert "partial revert of the commit 4ad186c5ef61"
[tinycc.git] / include / stddef.h
blob791ba318cc6b5b065a989c139e5d6bc0a3c2c95c
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 #ifndef __int8_t_defined
12 #define __int8_t_defined
13 typedef signed char int8_t;
14 typedef signed short int int16_t;
15 typedef signed int int32_t;
16 typedef signed long long int int64_t;
17 typedef unsigned char uint8_t;
18 typedef unsigned short int uint16_t;
19 typedef unsigned int uint32_t;
20 typedef unsigned long long int uint64_t;
21 #endif
23 #ifndef NULL
24 #define NULL ((void*)0)
25 #endif
27 #define offsetof(type, field) ((size_t)&((type *)0)->field)
29 void *alloca(size_t size);
31 #endif
33 /* Older glibc require a wint_t from <stddef.h> (when requested
34 by __need_wint_t, as otherwise stddef.h isn't allowed to
35 define this type). Note that this must be outside the normal
36 _STDDEF_H guard, so that it works even when we've included the file
37 already (without requiring wint_t). Some other libs define _WINT_T
38 if they've already provided that type, so we can use that as guard.
39 TCC defines __WINT_TYPE__ for us. */
40 #if defined (__need_wint_t)
41 #ifndef _WINT_T
42 #define _WINT_T
43 typedef __WINT_TYPE__ wint_t;
44 #endif
45 #undef __need_wint_t
46 #endif