1 /*
2  * Copyright (C) 2017 The Android Open Source Project
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *  * Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  *  * Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in
12  *    the documentation and/or other materials provided with the
13  *    distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26  * SUCH DAMAGE.
27  */
28 
29 #include <stdint.h>
30 
31 #include "header_checks.h"
32 
stdint_h()33 static void stdint_h() {
34   TYPE(int8_t);
35   TYPE(int16_t);
36   TYPE(int32_t);
37   TYPE(uint8_t);
38   TYPE(uint16_t);
39   TYPE(uint32_t);
40 
41   TYPE(int64_t);
42   TYPE(uint64_t);
43 
44   TYPE(int_least8_t);
45   TYPE(int_least16_t);
46   TYPE(int_least32_t);
47   TYPE(int_least64_t);
48   TYPE(uint_least8_t);
49   TYPE(uint_least16_t);
50   TYPE(uint_least32_t);
51   TYPE(uint_least64_t);
52 
53   TYPE(int_fast8_t);
54   TYPE(int_fast16_t);
55   TYPE(int_fast32_t);
56   TYPE(int_fast64_t);
57   TYPE(uint_fast8_t);
58   TYPE(uint_fast16_t);
59   TYPE(uint_fast32_t);
60   TYPE(uint_fast64_t);
61 
62   TYPE(intptr_t);
63   TYPE(uintptr_t);
64 
65   TYPE(intmax_t);
66   TYPE(uintmax_t);
67 
68   MACRO(INT8_MIN);
69   MACRO(INT16_MIN);
70   MACRO(INT32_MIN);
71   MACRO(INT64_MIN);
72   MACRO(INT8_MAX);
73   MACRO(INT16_MAX);
74   MACRO(INT32_MAX);
75   MACRO(INT64_MAX);
76   MACRO(UINT8_MAX);
77   MACRO(UINT16_MAX);
78   MACRO(UINT32_MAX);
79   MACRO(UINT64_MAX);
80 
81   MACRO(INT_LEAST8_MIN);
82   MACRO(INT_LEAST16_MIN);
83   MACRO(INT_LEAST32_MIN);
84   MACRO(INT_LEAST64_MIN);
85   MACRO(INT_LEAST8_MAX);
86   MACRO(INT_LEAST16_MAX);
87   MACRO(INT_LEAST32_MAX);
88   MACRO(INT_LEAST64_MAX);
89   MACRO(UINT_LEAST8_MAX);
90   MACRO(UINT_LEAST16_MAX);
91   MACRO(UINT_LEAST32_MAX);
92   MACRO(UINT_LEAST64_MAX);
93 
94   MACRO(INT_FAST8_MIN);
95   MACRO(INT_FAST16_MIN);
96   MACRO(INT_FAST32_MIN);
97   MACRO(INT_FAST64_MIN);
98   MACRO(INT_FAST8_MAX);
99   MACRO(INT_FAST16_MAX);
100   MACRO(INT_FAST32_MAX);
101   MACRO(INT_FAST64_MAX);
102   MACRO(UINT_FAST8_MAX);
103   MACRO(UINT_FAST16_MAX);
104   MACRO(UINT_FAST32_MAX);
105   MACRO(UINT_FAST64_MAX);
106 
107   MACRO(INTPTR_MIN);
108   MACRO(INTPTR_MAX);
109   MACRO(UINTPTR_MAX);
110 
111   MACRO(INTMAX_MIN);
112   MACRO(INTMAX_MAX);
113   MACRO(UINTMAX_MAX);
114 
115   MACRO(PTRDIFF_MIN);
116   MACRO(PTRDIFF_MAX);
117 
118   MACRO(SIG_ATOMIC_MIN);
119   MACRO(SIG_ATOMIC_MAX);
120 
121   MACRO(SIZE_MAX);
122 
123   MACRO(WCHAR_MIN);
124   MACRO(WCHAR_MAX);
125 
126   MACRO(WINT_MIN);
127   MACRO(WINT_MAX);
128 
129 #if !defined(INT8_C)
130 #error INT8_C
131 #endif
132 #if !defined(INT16_C)
133 #error INT16_C
134 #endif
135 #if !defined(INT32_C)
136 #error INT32_C
137 #endif
138 #if !defined(INT32_C)
139 #error INT32_C
140 #endif
141 
142 #if !defined(UINT8_C)
143 #error UINT8_C
144 #endif
145 #if !defined(UINT16_C)
146 #error UINT16_C
147 #endif
148 #if !defined(UINT32_C)
149 #error UINT32_C
150 #endif
151 #if !defined(UINT32_C)
152 #error UINT32_C
153 #endif
154 
155 #if !defined(INTMAX_C)
156 #error INTMAX_C
157 #endif
158 #if !defined(UINTMAX_C)
159 #error UINTMAX_C
160 #endif
161 }
162