eo301@0
|
1 /*===---- stddef.h - Basic type definitions --------------------------------===
|
eo301@0
|
2 *
|
eo301@0
|
3 * Copyright (c) 2008 Eli Friedman
|
eo301@0
|
4 *
|
eo301@0
|
5 * Permission is hereby granted, free of charge, to any person obtaining a copy
|
eo301@0
|
6 * of this software and associated documentation files (the "Software"), to deal
|
eo301@0
|
7 * in the Software without restriction, including without limitation the rights
|
eo301@0
|
8 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
eo301@0
|
9 * copies of the Software, and to permit persons to whom the Software is
|
eo301@0
|
10 * furnished to do so, subject to the following conditions:
|
eo301@0
|
11 *
|
eo301@0
|
12 * The above copyright notice and this permission notice shall be included in
|
eo301@0
|
13 * all copies or substantial portions of the Software.
|
eo301@0
|
14 *
|
eo301@0
|
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
eo301@0
|
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
eo301@0
|
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
eo301@0
|
18 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
eo301@0
|
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
eo301@0
|
20 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
eo301@0
|
21 * THE SOFTWARE.
|
eo301@0
|
22 *
|
eo301@0
|
23 *===-----------------------------------------------------------------------===
|
eo301@0
|
24 */
|
eo301@0
|
25
|
eo301@0
|
26 #ifndef __STDDEF_H
|
eo301@0
|
27 #define __STDDEF_H
|
eo301@0
|
28
|
eo301@0
|
29 #ifndef _PTRDIFF_T
|
eo301@0
|
30 #define _PTRDIFF_T
|
eo301@0
|
31 typedef __typeof__(((int*)0)-((int*)0)) ptrdiff_t;
|
eo301@0
|
32 #endif
|
eo301@0
|
33 #ifndef _SIZE_T
|
eo301@0
|
34 #define _SIZE_T
|
eo301@0
|
35 typedef __typeof__(sizeof(int)) size_t;
|
eo301@0
|
36 #endif
|
eo301@0
|
37 #ifndef __cplusplus
|
eo301@0
|
38 #ifndef _WCHAR_T
|
eo301@0
|
39 #define _WCHAR_T
|
eo301@0
|
40 typedef __WCHAR_TYPE__ wchar_t;
|
eo301@0
|
41 #endif
|
eo301@0
|
42 #endif
|
eo301@0
|
43
|
eo301@0
|
44 #undef NULL
|
eo301@0
|
45 #ifdef __cplusplus
|
eo301@0
|
46 #undef __null // VC++ hack.
|
eo301@0
|
47 #define NULL __null
|
eo301@0
|
48 #else
|
eo301@0
|
49 #define NULL ((void*)0)
|
eo301@0
|
50 #endif
|
eo301@0
|
51
|
eo301@0
|
52 #define offsetof(t, d) __builtin_offsetof(t, d)
|
eo301@0
|
53
|
eo301@0
|
54 #endif /* __STDDEF_H */
|
eo301@0
|
55
|
eo301@0
|
56 /* Some C libraries expect to see a wint_t here. Others (notably MinGW) will use
|
eo301@0
|
57 __WINT_TYPE__ directly; accommodate both by requiring __need_wint_t */
|
eo301@0
|
58 #if defined(__need_wint_t)
|
eo301@0
|
59 #if !defined(_WINT_T)
|
eo301@0
|
60 #define _WINT_T
|
eo301@0
|
61 typedef __WINT_TYPE__ wint_t;
|
eo301@0
|
62 #endif /* _WINT_T */
|
eo301@0
|
63 #undef __need_wint_t
|
eo301@0
|
64 #endif /* __need_wint_t */
|