1 /*============================================================================
2 Kitware Information Macro Library
3 Copyright 2010-2011 Kitware, Inc.
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in the
15 documentation and/or other materials provided with the distribution.
17 * Neither the name of Kitware, Inc. nor the names of its contributors
18 may be used to endorse or promote products derived from this
19 software without specific prior written permission.
21 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 ============================================================================*/
36 This header defines macros with information about the C ABI.
37 Only information that can be determined using the preprocessor at
38 compilation time is available. No try-compile results may be added
39 here. Instead we memorize results on platforms of interest.
41 An includer may optionally define the following macros to suppress errors:
43 @KWIML@_ABI_NO_VERIFY = skip verification declarations
44 @KWIML@_ABI_NO_ERROR_CHAR_SIGN = signedness of 'char' may be unknown
45 @KWIML@_ABI_NO_ERROR_LONG_LONG = existence of 'long long' may be unknown
46 @KWIML@_ABI_NO_ERROR_ENDIAN = byte order of CPU may be unknown
48 An includer may test the following macros after inclusion:
50 @KWIML@_ABI_SIZEOF_DATA_PTR = sizeof(void*)
51 @KWIML@_ABI_SIZEOF_CODE_PTR = sizeof(void(*)(void))
52 @KWIML@_ABI_SIZEOF_FLOAT = sizeof(float)
53 @KWIML@_ABI_SIZEOF_DOUBLE = sizeof(double)
54 @KWIML@_ABI_SIZEOF_CHAR = sizeof(char)
55 @KWIML@_ABI_SIZEOF_SHORT = sizeof(short)
56 @KWIML@_ABI_SIZEOF_INT = sizeof(int)
57 @KWIML@_ABI_SIZEOF_LONG = sizeof(long)
59 @KWIML@_ABI_SIZEOF_LONG_LONG = sizeof(long long) or 0 if not a type
60 Undefined if existence is unknown and error suppression macro
61 @KWIML@_ABI_NO_ERROR_LONG_LONG was defined.
63 @KWIML@_ABI_SIZEOF___INT64 = 8 if '__int64' exists or 0 if not
64 Undefined if existence is unknown.
66 @KWIML@_ABI___INT64_IS_LONG = 1 if '__int64' is 'long' (same type)
68 @KWIML@_ABI___INT64_IS_LONG_LONG = 1 if '__int64' is 'long long' (same type)
70 @KWIML@_ABI___INT64_IS_UNIQUE = 1 if '__int64' is a distinct type
73 @KWIML@_ABI_CHAR_IS_UNSIGNED = 1 if 'char' is unsigned, else undefined
74 @KWIML@_ABI_CHAR_IS_SIGNED = 1 if 'char' is signed, else undefined
75 One of these is defined unless signedness of 'char' is unknown and
76 error suppression macro @KWIML@_ABI_NO_ERROR_CHAR_SIGN was defined.
78 @KWIML@_ABI_ENDIAN_ID_BIG = id for big-endian (always defined)
79 @KWIML@_ABI_ENDIAN_ID_LITTLE = id for little-endian (always defined)
80 @KWIML@_ABI_ENDIAN_ID = id of byte order of target CPU
81 Defined to @KWIML@_ABI_ENDIAN_ID_BIG or @KWIML@_ABI_ENDIAN_ID_LITTLE
82 unless byte order is unknown and error suppression macro
83 @KWIML@_ABI_NO_ERROR_ENDIAN was defined.
85 We verify most results using dummy "extern" declarations that are
86 invalid if the macros are wrong. Verification is disabled if
87 suppression macro @KWIML@_ABI_NO_VERIFY was defined.
90 /*--------------------------------------------------------------------------*/
91 #if !defined(@KWIML@_ABI_SIZEOF_DATA_PTR)
92 # if defined(__SIZEOF_POINTER__)
93 # define @KWIML@_ABI_SIZEOF_DATA_PTR __SIZEOF_POINTER__
94 # elif defined(_SIZE_PTR)
95 # define @KWIML@_ABI_SIZEOF_DATA_PTR (_SIZE_PTR >> 3)
96 # elif defined(_LP64) || defined(__LP64__)
97 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
98 # elif defined(_ILP32)
99 # define @KWIML@_ABI_SIZEOF_DATA_PTR 4
100 # elif defined(__64BIT__) /* IBM XL */
101 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
102 # elif defined(_M_X64)
103 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
104 # elif defined(__ia64)
105 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
106 # elif defined(__sparcv9)
107 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
108 # elif defined(__x86_64) || defined(__x86_64__)
109 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
110 # elif defined(__amd64) || defined(__amd64__)
111 # define @KWIML@_ABI_SIZEOF_DATA_PTR 8
112 # elif defined(__i386) || defined(__i386__)
113 # define @KWIML@_ABI_SIZEOF_DATA_PTR 4
116 #if !defined(@KWIML@_ABI_SIZEOF_DATA_PTR)
117 # define @KWIML@_ABI_SIZEOF_DATA_PTR 4
119 #if !defined(@KWIML@_ABI_SIZEOF_CODE_PTR)
120 # define @KWIML@_ABI_SIZEOF_CODE_PTR @KWIML@_ABI_SIZEOF_DATA_PTR
123 /*--------------------------------------------------------------------------*/
124 #if !defined(@KWIML@_ABI_SIZEOF_CHAR)
125 # define @KWIML@_ABI_SIZEOF_CHAR 1
128 #if !defined(@KWIML@_ABI_CHAR_IS_UNSIGNED) && !defined(@KWIML@_ABI_CHAR_IS_SIGNED)
129 # if defined(__CHAR_UNSIGNED__) /* GNU, some IBM XL, others? */
130 # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
131 # elif defined(_CHAR_UNSIGNED) /* Intel, IBM XL, MSVC, Borland, others? */
132 # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
133 # elif defined(_CHAR_SIGNED) /* IBM XL, others? */
134 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
135 # elif defined(__CHAR_SIGNED__) /* IBM XL, Watcom, others? */
136 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
137 # elif defined(__SIGNED_CHARS__) /* EDG, Intel, SGI MIPSpro */
138 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
139 # elif defined(_CHAR_IS_SIGNED) /* Some SunPro, others? */
140 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
141 # elif defined(_CHAR_IS_UNSIGNED) /* SunPro, others? */
142 # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
143 # elif defined(__GNUC__) /* GNU default */
144 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
145 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* SunPro default */
146 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
147 # elif defined(__HP_cc) || defined(__HP_aCC) /* HP default (unless +uc) */
148 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
149 # elif defined(_SGI_COMPILER_VERSION) /* SGI MIPSpro default */
150 # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
151 # elif defined(__PGIC__) /* PGI default */
152 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
153 # elif defined(_MSC_VER) /* MSVC default */
154 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
155 # elif defined(__WATCOMC__) /* Watcom default */
156 # define @KWIML@_ABI_CHAR_IS_UNSIGNED 1
157 # elif defined(__BORLANDC__) /* Borland default */
158 # define @KWIML@_ABI_CHAR_IS_SIGNED 1
159 # elif defined(__hpux) /* Old HP: no __HP_cc/__HP_aCC/__GNUC__ above */
160 # define @KWIML@_ABI_CHAR_IS_SIGNED 1 /* (unless +uc) */
163 #if !defined(@KWIML@_ABI_CHAR_IS_UNSIGNED) && !defined(@KWIML@_ABI_CHAR_IS_SIGNED) \
164 && !defined(@KWIML@_ABI_NO_ERROR_CHAR_SIGN)
165 # error "Signedness of 'char' unknown."
168 /*--------------------------------------------------------------------------*/
169 #if !defined(@KWIML@_ABI_SIZEOF_SHORT)
170 # if defined(__SIZEOF_SHORT__)
171 # define @KWIML@_ABI_SIZEOF_SHORT __SIZEOF_SHORT__
174 #if !defined(@KWIML@_ABI_SIZEOF_SHORT)
175 # define @KWIML@_ABI_SIZEOF_SHORT 2
178 /*--------------------------------------------------------------------------*/
179 #if !defined(@KWIML@_ABI_SIZEOF_INT)
180 # if defined(__SIZEOF_INT__)
181 # define @KWIML@_ABI_SIZEOF_INT __SIZEOF_INT__
182 # elif defined(_SIZE_INT)
183 # define @KWIML@_ABI_SIZEOF_INT (_SIZE_INT >> 3)
186 #if !defined(@KWIML@_ABI_SIZEOF_INT)
187 # define @KWIML@_ABI_SIZEOF_INT 4
190 /*--------------------------------------------------------------------------*/
191 #if !defined(@KWIML@_ABI_SIZEOF_LONG)
192 # if defined(__SIZEOF_LONG__)
193 # define @KWIML@_ABI_SIZEOF_LONG __SIZEOF_LONG__
194 # elif defined(_SIZE_LONG)
195 # define @KWIML@_ABI_SIZEOF_LONG (_SIZE_LONG >> 3)
196 # elif defined(__LONG_MAX__)
197 # if __LONG_MAX__ == 0x7fffffff
198 # define @KWIML@_ABI_SIZEOF_LONG 4
199 # elif __LONG_MAX__>>32 == 0x7fffffff
200 # define @KWIML@_ABI_SIZEOF_LONG 8
202 # elif defined(_MSC_VER) /* MSVC and Intel on Windows */
203 # define @KWIML@_ABI_SIZEOF_LONG 4
206 #if !defined(@KWIML@_ABI_SIZEOF_LONG)
207 # define @KWIML@_ABI_SIZEOF_LONG @KWIML@_ABI_SIZEOF_DATA_PTR
210 /*--------------------------------------------------------------------------*/
211 #if !defined(@KWIML@_ABI_SIZEOF_LONG_LONG)
212 # if defined(__SIZEOF_LONG_LONG__)
213 # define @KWIML@_ABI_SIZEOF_LONG_LONG __SIZEOF_LONG_LONG__
214 # elif defined(__LONG_LONG_MAX__)
215 # if __LONG_LONG_MAX__ == 0x7fffffff
216 # define @KWIML@_ABI_SIZEOF_LONG_LONG 4
217 # elif __LONG_LONG_MAX__>>32 == 0x7fffffff
218 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
222 #if !defined(@KWIML@_ABI_SIZEOF_LONG_LONG)
223 # if defined(_LONGLONG) /* SGI, some GNU, perhaps others. */ \
224 && !defined(_MSC_VER)
225 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
226 # elif defined(_LONG_LONG) /* IBM XL, perhaps others. */
227 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
228 # elif defined(__NO_LONG_LONG) /* EDG */
229 # define @KWIML@_ABI_SIZEOF_LONG_LONG 0
230 # elif defined(__cplusplus) && __cplusplus > 199711L /* C++0x */
231 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
232 # elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
233 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
234 # elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* SunPro */
235 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
236 # elif defined(__HP_cc) || defined(__HP_aCC) /* HP */
237 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
238 # elif defined(__PGIC__) /* PGI */
239 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
240 # elif defined(__WATCOMC__) /* Watcom */
241 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
242 # elif defined(__INTEL_COMPILER) /* Intel */
243 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
244 # elif defined(__BORLANDC__) /* Borland */
245 # if __BORLANDC__ >= 0x0560
246 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
248 # define @KWIML@_ABI_SIZEOF_LONG_LONG 0
250 # elif defined(_MSC_VER) /* Microsoft */
251 # if _MSC_VER >= 1310
252 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
254 # define @KWIML@_ABI_SIZEOF_LONG_LONG 0
256 # elif defined(__hpux) && !defined(__GNUC__) /* Old HP: no __HP_cc/__HP_aCC above */
257 # define @KWIML@_ABI_SIZEOF_LONG_LONG 8
260 #if !defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && !defined(@KWIML@_ABI_NO_ERROR_LONG_LONG)
261 # error "Existence of 'long long' unknown."
264 /*--------------------------------------------------------------------------*/
265 #if !defined(@KWIML@_ABI_SIZEOF___INT64)
266 # if defined(__INTEL_COMPILER)
267 # define @KWIML@_ABI_SIZEOF___INT64 8
268 # elif defined(_MSC_VER)
269 # define @KWIML@_ABI_SIZEOF___INT64 8
270 # elif defined(__BORLANDC__)
271 # define @KWIML@_ABI_SIZEOF___INT64 8
273 # define @KWIML@_ABI_SIZEOF___INT64 0
277 #if defined(@KWIML@_ABI_SIZEOF___INT64) && @KWIML@_ABI_SIZEOF___INT64 > 0
278 # if @KWIML@_ABI_SIZEOF_LONG == 8
279 # define @KWIML@_ABI___INT64_IS_LONG 1
280 # elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
281 # define @KWIML@_ABI___INT64_IS_LONG_LONG 1
283 # define @KWIML@_ABI___INT64_IS_UNIQUE 1
287 /*--------------------------------------------------------------------------*/
288 #if !defined(@KWIML@_ABI_SIZEOF_FLOAT)
289 # if defined(__SIZEOF_FLOAT__)
290 # define @KWIML@_ABI_SIZEOF_FLOAT __SIZEOF_FLOAT__
293 #if !defined(@KWIML@_ABI_SIZEOF_FLOAT)
294 # define @KWIML@_ABI_SIZEOF_FLOAT 4
297 /*--------------------------------------------------------------------------*/
298 #if !defined(@KWIML@_ABI_SIZEOF_DOUBLE)
299 # if defined(__SIZEOF_DOUBLE__)
300 # define @KWIML@_ABI_SIZEOF_DOUBLE __SIZEOF_DOUBLE__
303 #if !defined(@KWIML@_ABI_SIZEOF_DOUBLE)
304 # define @KWIML@_ABI_SIZEOF_DOUBLE 8
307 /*--------------------------------------------------------------------------*/
308 /* Identify possible endian cases. The macro @KWIML@_ABI_ENDIAN_ID will be
309 defined to one of these, or undefined if unknown. */
310 #if !defined(@KWIML@_ABI_ENDIAN_ID_BIG)
311 # define @KWIML@_ABI_ENDIAN_ID_BIG 4321
313 #if !defined(@KWIML@_ABI_ENDIAN_ID_LITTLE)
314 # define @KWIML@_ABI_ENDIAN_ID_LITTLE 1234
316 #if @KWIML@_ABI_ENDIAN_ID_BIG == @KWIML@_ABI_ENDIAN_ID_LITTLE
317 # error "@KWIML@_ABI_ENDIAN_ID_BIG == @KWIML@_ABI_ENDIAN_ID_LITTLE"
320 #if defined(@KWIML@_ABI_ENDIAN_ID) /* Skip #elif cases if already defined. */
322 /* Use dedicated symbols if the compiler defines them. Do this first
323 because some architectures allow runtime byte order selection by
324 the operating system (values for such architectures below are
325 guesses for compilers that do not define a dedicated symbol).
326 Ensure that only one is defined in case the platform or a header
327 defines both as possible values for some third symbol. */
328 #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
329 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
330 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
331 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
332 #elif defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
333 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
334 #elif defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
335 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
338 #elif defined(__alpha) || defined(__alpha__) || defined(_M_ALPHA)
339 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
342 #elif defined(__arm__)
343 # if !defined(__ARMEB__)
344 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
346 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
350 #elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
351 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
352 #elif defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__)
353 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
354 #elif defined(__MWERKS__) && defined(__INTEL__)
355 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
358 #elif defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
359 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
360 #elif defined(__amd64) || defined(__amd64__)
361 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
363 /* Intel Architecture-64 (Itanium) */
364 #elif defined(__ia64) || defined(__ia64__)
365 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
366 #elif defined(_IA64) || defined(__IA64__) || defined(_M_IA64)
367 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
370 #elif defined(__powerpc) || defined(__powerpc__)
371 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
372 #elif defined(__ppc) || defined(__ppc__) || defined(__POWERPC__)
373 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
376 #elif defined(__sparc) || defined(__sparc__)
377 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
380 #elif defined(__hppa) || defined(__hppa__)
381 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
384 #elif defined(__m68k__) || defined(M68000)
385 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
387 /* MIPSel (MIPS little endian) */
388 #elif defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL)
389 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_LITTLE
391 /* MIPSeb (MIPS big endian) */
392 #elif defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB)
393 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
395 /* MIPS (fallback, big endian) */
396 #elif defined(__mips) || defined(__mips__) || defined(__MIPS__)
397 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
400 #elif defined(__THW_RS600) || defined(_IBMR2) || defined(_POWER)
401 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
402 #elif defined(_ARCH_PWR) || defined(_ARCH_PWR2)
403 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
406 #elif defined(__370__) || defined(__THW_370__)
407 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
410 #elif defined(__s390__) || defined(__s390x__)
411 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
414 #elif defined(__SYSC_ZARCH__)
415 # define @KWIML@_ABI_ENDIAN_ID @KWIML@_ABI_ENDIAN_ID_BIG
418 #elif !defined(@KWIML@_ABI_NO_ERROR_ENDIAN)
419 # error "Byte order of target CPU unknown."
422 /*--------------------------------------------------------------------------*/
423 #if !defined(@KWIML@_ABI_NO_VERIFY)
424 #define @KWIML@_ABI__VERIFY(n, x, y) extern int (*n)[x]; extern int (*n)[y]
425 #define @KWIML@_ABI__VERIFY2(n, x, y) extern int (*n)(x*); extern int (*n)(y*)
426 #if defined(__cplusplus)
427 # define @KWIML@_ABI__VERIFY3(n, x, y) extern int* n(x*); extern char* n(y*)
429 # define @KWIML@_ABI__VERIFY3(n, x, y) extern int* n(x*) /* TODO: possible? */
431 #define @KWIML@_ABI__VERIFY_BOOL(m, b) @KWIML@_ABI__VERIFY(m##__VERIFY__, 2, (b)?2:3)
432 #define @KWIML@_ABI__VERIFY_SIZE(m, t) @KWIML@_ABI__VERIFY(m##__VERIFY__, m, sizeof(t))
433 #define @KWIML@_ABI__VERIFY_SAME(m, x, y) @KWIML@_ABI__VERIFY2(m##__VERIFY__, x, y)
434 #define @KWIML@_ABI__VERIFY_DIFF(m, x, y) @KWIML@_ABI__VERIFY3(m##__VERIFY__, x, y)
436 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_DATA_PTR, int*);
437 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_CODE_PTR, int(*)(int));
438 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_CHAR, char);
439 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_SHORT, short);
440 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_INT, int);
441 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_LONG, long);
442 #if defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG > 0
443 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_LONG_LONG, long long);
445 #if defined(@KWIML@_ABI_SIZEOF___INT64) && @KWIML@_ABI_SIZEOF___INT64 > 0
446 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF___INT64, __int64);
448 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_FLOAT, float);
449 @KWIML@_ABI__VERIFY_SIZE(@KWIML@_ABI_SIZEOF_DOUBLE, double);
451 #if defined(@KWIML@_ABI___INT64_IS_LONG)
452 @KWIML@_ABI__VERIFY_SAME(@KWIML@_ABI___INT64_IS_LONG, __int64, long);
453 #elif defined(@KWIML@_ABI___INT64_IS_LONG_LONG)
454 @KWIML@_ABI__VERIFY_SAME(@KWIML@_ABI___INT64_IS_LONG_LONG, __int64, long long);
455 #elif defined(@KWIML@_ABI_SIZEOF___INT64) && @KWIML@_ABI_SIZEOF___INT64 > 0
456 @KWIML@_ABI__VERIFY_DIFF(@KWIML@_ABI___INT64_NOT_LONG, __int64, long);
457 # if defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG > 0
458 @KWIML@_ABI__VERIFY_DIFF(@KWIML@_ABI___INT64_NOT_LONG_LONG, __int64, long long);
462 #if defined(@KWIML@_ABI_CHAR_IS_UNSIGNED)
463 @KWIML@_ABI__VERIFY_BOOL(@KWIML@_ABI_CHAR_IS_UNSIGNED, (char)0x80 > 0);
464 #elif defined(@KWIML@_ABI_CHAR_IS_SIGNED)
465 @KWIML@_ABI__VERIFY_BOOL(@KWIML@_ABI_CHAR_IS_SIGNED, (char)0x80 < 0);
468 #undef @KWIML@_ABI__VERIFY_DIFF
469 #undef @KWIML@_ABI__VERIFY_SAME
470 #undef @KWIML@_ABI__VERIFY_SIZE
471 #undef @KWIML@_ABI__VERIFY_BOOL
472 #undef @KWIML@_ABI__VERIFY3
473 #undef @KWIML@_ABI__VERIFY2
474 #undef @KWIML@_ABI__VERIFY