Fix compile warning with cross compilers
[tinycc.git] / include / stddef.h
blobf856119678f2b9f7e1026ed76bb6d09f69ab44f2
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 __int8_t_defined
16 #define __int8_t_defined
17 typedef signed char int8_t;
18 typedef signed short int int16_t;
19 typedef signed int int32_t;
20 #ifdef __LP64__
21 typedef signed long int int64_t;
22 #else
23 typedef signed long long int int64_t;
24 #endif
25 typedef unsigned char uint8_t;
26 typedef unsigned short int uint16_t;
27 typedef unsigned int uint32_t;
28 #ifdef __LP64__
29 typedef unsigned long int uint64_t;
30 #else
31 typedef unsigned long long int uint64_t;
32 #endif
33 #endif
35 #ifndef NULL
36 #define NULL ((void*)0)
37 #endif
39 #define offsetof(type, field) ((size_t)&((type *)0)->field)
41 void *alloca(size_t size);
43 #endif
45 /* Older glibc require a wint_t from <stddef.h> (when requested
46 by __need_wint_t, as otherwise stddef.h isn't allowed to
47 define this type). Note that this must be outside the normal
48 _STDDEF_H guard, so that it works even when we've included the file
49 already (without requiring wint_t). Some other libs define _WINT_T
50 if they've already provided that type, so we can use that as guard.
51 TCC defines __WINT_TYPE__ for us. */
52 #if defined (__need_wint_t)
53 #ifndef _WINT_T
54 #define _WINT_T
55 typedef __WINT_TYPE__ wint_t;
56 #endif
57 #undef __need_wint_t
58 #endif