Implement __builtin_types_compatible_p().
[cparser] / tokens.inc
1 #ifndef TS
2 #define TS(x,str,val)
3 #endif
4
5 TS(IDENTIFIER,              "identifier", = 256)
6 TS(INTEGER,                 "integer number",)
7 TS(CHARACTER_CONSTANT,      "character constant",)
8 TS(WIDE_CHARACTER_CONSTANT, "wide character constant",)
9 TS(FLOATINGPOINT,           "floatingpoint number",)
10 TS(STRING_LITERAL,          "string literal",)
11 TS(WIDE_STRING_LITERAL,     "wide string literal",)
12
13 #define ALTERNATE(name, val)          T(_CXX, name, #name,  val)
14 #define PUNCTUATOR(name, string, val) T(_ALL, name, string, val)
15 #include "tokens_punctuator.inc"
16 #undef PUNCTUATOR
17 #undef ALTERNATE
18
19 #define S(mode,x)   T(mode,x,#x,)
20 S(_ALL, auto)
21 S(_ALL, break)
22 S(_ALL, case)
23 S(_ALL, char)
24 S(_ALL, continue)
25 S(_ALL, default)
26 S(_ALL, do)
27 S(_ALL, double)
28 S(_ALL, else)
29 S(_ALL, enum)
30 S(_ALL, extern)
31 S(_ALL, float)
32 S(_ALL, for)
33 S(_ALL, goto)
34 S(_ALL, if)
35 S(_ALL, int)
36 S(_ALL, long)
37 S(_ALL, register)
38 S(_ALL, return)
39 S(_ALL, short)
40 S(_ALL, sizeof)
41 S(_ALL, static)
42 S(_ALL, struct)
43 S(_ALL, switch)
44 S(_ALL, typedef)
45 S(_ALL, union)
46 S(_ALL, unsigned)
47 S(_ALL, void)
48 S(_ALL, while)
49
50 /* C++ keywords */
51 #undef bool
52 S(_CXX, bool)
53 #define bool _Bool
54 S(_CXX, catch)
55 S(_CXX, class)
56 S(_CXX, const_cast)
57 S(_CXX, delete)
58 S(_CXX, dynamic_cast)
59 S(_CXX, explicit)
60 S(_CXX, export)
61 #undef false
62 S(_CXX, false)
63 #define false 0
64 S(_CXX, friend)
65 S(_CXX, mutable)
66 S(_CXX, namespace)
67 S(_CXX, new)
68 S(_CXX, operator)
69 S(_CXX, private)
70 S(_CXX, protected)
71 S(_CXX, public)
72 S(_CXX, reinterpret_cast)
73 S(_CXX, static_cast)
74 S(_CXX, template)
75 S(_CXX, this)
76 S(_CXX, throw)
77 #undef true
78 S(_CXX, true)
79 #define true 1
80 S(_CXX, try)
81 S(_CXX, typeid)
82 S(_CXX, typename)
83 S(_CXX, using)
84 S(_CXX, virtual)
85 S(_CXX, wchar_t)
86
87 S(_C99|_GNUC, _Bool)
88 S(_ALL, __thread)
89 S(_ALL, __extension__)
90 S(_ALL, __builtin_classify_type)
91 S(_ALL, __builtin_va_list)
92 S(_ALL, __builtin_expect)
93 S(_ALL, __builtin_offsetof)
94 S(_ALL, __builtin_va_arg)
95 S(_ALL, __builtin_va_end)
96 S(_ALL, __builtin_alloca)
97 S(_ALL, __builtin_inf)
98 S(_ALL, __builtin_inff)
99 S(_ALL, __builtin_infl)
100 S(_ALL, __builtin_nan)
101 S(_ALL, __builtin_nanf)
102 S(_ALL, __builtin_nanl)
103 S(_ALL, __builtin_isgreater)
104 S(_ALL, __builtin_isgreaterequal)
105 S(_ALL, __builtin_isless)
106 S(_ALL, __builtin_islessequal)
107 S(_ALL, __builtin_islessgreater)
108 S(_ALL, __builtin_isunordered)
109 S(_ALL, __builtin_constant_p)
110 S(_ALL, __builtin_prefetch)
111 S(_ALL, __builtin_huge_val)
112 S(_ALL, __builtin_return_address)
113 S(_ALL, __builtin_frame_address)
114 S(_ALL, __builtin_types_compatible_p)
115 S(_ALL, __PRETTY_FUNCTION__)
116 S(_ALL, __FUNCTION__)
117 S(_ALL, __label__)
118 S(_C99, __func__)
119 S(_MS, __FUNCSIG__)
120 S(_MS, __FUNCDNAME__)
121 #undef S
122
123 /* needed on Windows */
124 #ifdef __w64
125 #undef __w64
126 #endif
127 #ifdef __ptr64
128 #undef __ptr64
129 #endif
130
131 /* needed on MinGW */
132 #ifdef __MINGW32__
133 #ifdef __int8
134 #undef __int8
135 #endif
136 #ifdef __int16
137 #undef __int16
138 #endif
139 #ifdef __int32
140 #undef __int32
141 #endif
142 #ifdef __int64
143 #undef __int64
144 #endif
145 #endif
146
147 #if defined(__MINGW32__) || defined(__CYGWIN__)
148 #ifdef __cdecl
149 #undef __cdecl
150 #endif
151 #ifdef __stdcall
152 #undef __stdcall
153 #endif
154 #ifdef __fastcall
155 #undef __fastcall
156 #endif
157 #endif
158
159 /* needed on darwin... */
160 #ifdef __signed
161 #undef __signed
162 #endif
163 #ifdef __volatile
164 #undef __volatile
165 #endif
166 #ifdef __const
167 #undef __const
168 #endif
169 #ifdef __restrict
170 #undef __restrict
171 #endif
172
173 #define S(mode, x, val) T(mode, x, #x, val)
174 S(_ANSI|_C99|_CXX,   signed,               )
175 S(_ALL,            __signed,               = T_signed)
176 S(_ALL,            __signed__,             = T_signed)
177 S(_C99|_GNUC,       _Complex,              )
178 S(_ALL,            __complex__,            = T__Complex)
179 S(_ALL,            __complex,              = T__Complex)
180 S(_C99|_GNUC,       _Imaginary,            )
181 S(_ALL,            __real__,               )
182 S(_ALL,            __real,                 = T___real__)
183 S(_ALL,            __imag__,               )
184 S(_ALL,            __imag,                 = T___imag__)
185 S(_ALL,            __alignof__,            )
186 S(_ALL,            __alignof,              = T___alignof__)
187 S(_MS,              _alignof,              = T___alignof__)
188 S(_ANSI|_C99|_CXX,   const,                )
189 S(_ALL,            __const,                = T_const)
190 S(_ALL,            __const__,              = T_const)
191 S(_C99,              restrict,             )
192 S(_ALL,            __restrict__,           = T_restrict)
193 S(_ALL,            __restrict,             = T_restrict)
194 S(_MS,              _restrict,             = T_restrict)
195 S(_ALL,              asm,                  )
196 S(_ALL,            __asm__,                = T_asm)
197 S(_MS,              _asm,                  = T_asm)
198 S(_ALL,            __asm,                  = T_asm)
199 S(_ANSI|_C99|_CXX,   volatile,             )
200 S(_ALL,            __volatile,             = T_volatile)
201 S(_ALL,            __volatile__,           = T_volatile)
202 S(_C99|_CXX,         inline,               )
203 S(_ALL,            __inline,               = T_inline)
204 S(_ALL,            __inline__,             = T_inline)
205 S(_GNUC,             typeof,               )
206 S(_ALL,            __typeof,               = T_typeof)
207 S(_ALL,            __typeof__,             = T_typeof)
208 S(_ALL,            __attribute__,          )
209
210 S(_ALL,            __builtin_va_start,     )
211 S(_ALL,            __builtin_stdarg_start, = T___builtin_va_start)
212
213 S(_MS,              _near,                 )
214 S(_MS,             __near,                 = T__near)
215 S(_MS,              _far,                  )
216 S(_MS,             __far,                  = T__far)
217 S(_MS,               cdecl,                )
218 S(_MS,              _cdecl,                = T_cdecl)
219 S(_MS,             __cdecl,                = T_cdecl)
220 S(_MS,              _stdcall,              )
221 S(_MS,             __stdcall,              = T__stdcall)
222 S(_MS,              _fastcall,             )
223 S(_MS,             __fastcall,             = T__fastcall)
224 S(_MS,             __thiscall,             )
225 S(_MS,              _forceinline,          )
226 S(_MS,             __forceinline,          = T__forceinline)
227 S(_MS,             __unaligned,            )
228 S(_MS,              _assume,               )
229 S(_MS,             __assume,               = T__assume)
230 S(_MS,              _try,                  )
231 S(_MS,             __try,                  = T__try)
232 S(_MS,              _finally,              )
233 S(_MS,             __finally,              = T__finally)
234 S(_MS,              _leave,                )
235 S(_MS,             __leave,                = T__leave)
236 S(_MS,              _except,               )
237 S(_MS,             __except,               = T__except)
238 S(_MS,              _declspec,             )
239 S(_MS,             __declspec,             = T__declspec)
240 S(_MS,              _based,                )
241 S(_MS,             __based,                = T__based)
242 S(_MS,             __noop,                 )
243
244 S(_MS,             __ptr32,                )
245 S(_MS,             __ptr64,                )
246 S(_MS,             __sptr,                 )
247 S(_MS,             __uptr,                 )
248 S(_MS,              _w64,                  )
249 S(_MS,             __w64,                  = T__w64)
250
251 S(_MS,              _int8,                 )
252 S(_MS,             __int8,                 = T__int8)
253 S(_MS,              _int16,                )
254 S(_MS,             __int16,                = T__int16)
255 S(_MS,              _int32,                )
256 S(_MS,             __int32,                = T__int32)
257 S(_MS,              _int64,                )
258 S(_MS,             __int64,                = T__int64)
259 S(_MS,              _int128,               )
260 S(_MS,             __int128,               = T__int128)
261 #undef S
262
263 /* Redefine required macros for MinGW headers */
264 #if defined(__MINGW32__) || defined(__CYGWIN__)
265 #define __stdcall __attribute__((__stdcall__))
266 #define __fastcall __attribute__((__fastcall__))
267 #define __cdecl __attribute__((__cdecl__))
268 #endif