INT.h.in 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861
  1. /*============================================================================
  2. Kitware Information Macro Library
  3. Copyright 2010-2011 Kitware, Inc.
  4. All rights reserved.
  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 the
  12. documentation and/or other materials provided with the distribution.
  13. * Neither the name of Kitware, Inc. nor the names of its contributors
  14. may be used to endorse or promote products derived from this
  15. software without specific prior written permission.
  16. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  17. "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  18. LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  19. A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  20. HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  21. SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  22. LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  23. DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  24. THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  26. OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. ============================================================================*/
  28. #ifndef @KWIML@_INT_H
  29. #define @KWIML@_INT_H
  30. /*
  31. This header defines macros with information about sized integer types.
  32. Only information that can be determined using the preprocessor at
  33. compilation time is available. No try-compile results may be added
  34. here. Instead we memorize results on platforms of interest.
  35. An includer may optionally define the following macros to suppress errors:
  36. Input:
  37. @KWIML@_INT_NO_VERIFY = skip verification declarations
  38. @KWIML@_INT_NO_ERROR_INT64_T = type '@KWIML@_INT_int64_t' is optional (*)
  39. @KWIML@_INT_NO_ERROR_UINT64_T = type '@KWIML@_INT_uint64_t' is optional (*)
  40. @KWIML@_INT_NO_ERROR_INTPTR_T = type '@KWIML@_INT_intptr_t' is optional (*)
  41. @KWIML@_INT_NO_ERROR_UINTPTR_T = type '@KWIML@_INT_uintptr_t' is optional (*)
  42. An includer may optionally define the following macros to override defaults.
  43. Either way, an includer may test these macros after inclusion:
  44. @KWIML@_INT_HAVE_STDINT_H = include <stdint.h>
  45. @KWIML@_INT_NO_STDINT_H = do not include <stdint.h>
  46. @KWIML@_INT_HAVE_INTTYPES_H = include <inttypes.h>
  47. @KWIML@_INT_NO_INTTYPES_H = do not include <inttypes.h>
  48. An includer may test the following macros after inclusion:
  49. @KWIML@_INT_HAVE_INT#_T = type 'int#_t' is available
  50. @KWIML@_INT_HAVE_UINT#_T = type 'uint#_t' is available
  51. # = 8, 16, 32, 64, PTR
  52. @KWIML@_INT_int#_t = signed integer type exactly # bits wide
  53. @KWIML@_INT_uint#_t = unsigned integer type exactly # bits wide
  54. # = 8, 16, 32, 64 (*), ptr (*)
  55. @KWIML@_INT_NO_INT64_T = type '@KWIML@_INT_int64_t' not available
  56. @KWIML@_INT_NO_UINT64_T = type '@KWIML@_INT_uint64_t' not available
  57. @KWIML@_INT_NO_INTPTR_T = type '@KWIML@_INT_intptr_t' not available
  58. @KWIML@_INT_NO_UINTPTR_T = type '@KWIML@_INT_uintptr_t' not available
  59. @KWIML@_INT_INT#_C(c) = signed integer constant at least # bits wide
  60. @KWIML@_INT_UINT#_C(c) = unsigned integer constant at least # bits wide
  61. # = 8, 16, 32, 64 (*)
  62. @KWIML@_INT_<fmt># = print or scan format, <fmt> in table below
  63. # = 8, 16, 32, 64, PTR (*)
  64. signed unsigned
  65. ----------- ------------------------------
  66. | decimal | decimal octal hexadecimal |
  67. print | PRId PRIi | PRIu PRIo PRIx PRIX |
  68. scan | SCNd SCNi | SCNu SCNo SCNx |
  69. ----------- ------------------------------
  70. The SCN*8 and SCN*64 format macros will not be defined on systems
  71. with scanf implementations known not to support them.
  72. @KWIML@_INT_BROKEN_<fmt># = macro <fmt># is incorrect if defined
  73. Some compilers define integer format macros incorrectly for their
  74. own formatted print/scan implementations.
  75. @KWIML@_INT_BROKEN_INT#_C = macro INT#_C is incorrect if defined
  76. @KWIML@_INT_BROKEN_UINT#_C = macro UINT#_C is incorrect if defined
  77. Some compilers define integer constant macros incorrectly and
  78. cannot handle literals as large as the integer type or even
  79. produce bad preprocessor syntax.
  80. @KWIML@_INT_BROKEN_INT8_T = type 'int8_t' is available but incorrect
  81. Some compilers have a flag to make 'char' (un)signed but do not account
  82. for it while defining int8_t in the non-default case.
  83. The broken cases do not affect correctness of the macros documented above.
  84. */
  85. #include "ABI.h"
  86. /*--------------------------------------------------------------------------*/
  87. #if defined(@KWIML@_INT_HAVE_STDINT_H) /* Already defined. */
  88. #elif defined(@KWIML@_INT_NO_STDINT_H) /* Already defined. */
  89. #elif defined(HAVE_STDINT_H) /* Optionally provided by includer. */
  90. # define @KWIML@_INT_HAVE_STDINT_H 1
  91. #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
  92. # define @KWIML@_INT_HAVE_STDINT_H 1
  93. #elif defined(_MSC_VER) /* MSVC */
  94. # if _MSC_VER >= 1600
  95. # define @KWIML@_INT_HAVE_STDINT_H 1
  96. # else
  97. # define @KWIML@_INT_NO_STDINT_H 1
  98. # endif
  99. #elif defined(__BORLANDC__) /* Borland */
  100. # if __BORLANDC__ >= 0x560
  101. # define @KWIML@_INT_HAVE_STDINT_H 1
  102. # else
  103. # define @KWIML@_INT_NO_STDINT_H 1
  104. # endif
  105. #elif defined(__WATCOMC__) /* Watcom */
  106. # define @KWIML@_INT_NO_STDINT_H 1
  107. #endif
  108. /*--------------------------------------------------------------------------*/
  109. #if defined(@KWIML@_INT_HAVE_INTTYPES_H) /* Already defined. */
  110. #elif defined(@KWIML@_INT_NO_INTTYPES_H) /* Already defined. */
  111. #elif defined(HAVE_INTTYPES_H) /* Optionally provided by includer. */
  112. # define @KWIML@_INT_HAVE_INTTYPES_H 1
  113. #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 */
  114. # define @KWIML@_INT_HAVE_INTTYPES_H 1
  115. #elif defined(_MSC_VER) /* MSVC */
  116. # define @KWIML@_INT_NO_INTTYPES_H 1
  117. #elif defined(__BORLANDC__) /* Borland */
  118. # define @KWIML@_INT_NO_INTTYPES_H 1
  119. #elif defined(__WATCOMC__) /* Watcom */
  120. # define @KWIML@_INT_NO_INTTYPES_H 1
  121. #else /* Assume it exists. */
  122. # define @KWIML@_INT_HAVE_INTTYPES_H 1
  123. #endif
  124. /*--------------------------------------------------------------------------*/
  125. #if defined(@KWIML@_INT_HAVE_STDINT_H) && defined(@KWIML@_INT_NO_STDINT_H)
  126. # error "Both @KWIML@_INT_HAVE_STDINT_H and @KWIML@_INT_NO_STDINT_H defined!"
  127. #endif
  128. #if defined(@KWIML@_INT_HAVE_INTTYPES_H) && defined(@KWIML@_INT_NO_INTTYPES_H)
  129. # error "Both @KWIML@_INT_HAVE_INTTYPES_H and @KWIML@_INT_NO_INTTYPES_H defined!"
  130. #endif
  131. #if defined(@KWIML@_INT_HAVE_STDINT_H)
  132. # include <stdint.h>
  133. #endif
  134. #if defined(@KWIML@_INT_HAVE_INTTYPES_H)
  135. # if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS)
  136. # define __STDC_FORMAT_MACROS
  137. # endif
  138. # include <inttypes.h>
  139. #endif
  140. #if defined(@KWIML@_INT_HAVE_STDINT_H) || defined(@KWIML@_INT_HAVE_INTTYPES_H)
  141. #define @KWIML@_INT_HAVE_INT8_T 1
  142. #define @KWIML@_INT_HAVE_UINT8_T 1
  143. #define @KWIML@_INT_HAVE_INT16_T 1
  144. #define @KWIML@_INT_HAVE_UINT16_T 1
  145. #define @KWIML@_INT_HAVE_INT32_T 1
  146. #define @KWIML@_INT_HAVE_UINT32_T 1
  147. #define @KWIML@_INT_HAVE_INT64_T 1
  148. #define @KWIML@_INT_HAVE_UINT64_T 1
  149. #define @KWIML@_INT_HAVE_INTPTR_T 1
  150. #define @KWIML@_INT_HAVE_UINTPTR_T 1
  151. #endif
  152. #if defined(_AIX43) && !defined(_AIX50) && !defined(_AIX51)
  153. /* AIX 4.3 defines these incorrectly with % and no quotes. */
  154. # define @KWIML@_INT_BROKEN_PRId8
  155. # define @KWIML@_INT_BROKEN_SCNd8
  156. # define @KWIML@_INT_BROKEN_PRIi8
  157. # define @KWIML@_INT_BROKEN_SCNi8
  158. # define @KWIML@_INT_BROKEN_PRIo8
  159. # define @KWIML@_INT_BROKEN_SCNo8
  160. # define @KWIML@_INT_BROKEN_PRIu8
  161. # define @KWIML@_INT_BROKEN_SCNu8
  162. # define @KWIML@_INT_BROKEN_PRIx8
  163. # define @KWIML@_INT_BROKEN_SCNx8
  164. # define @KWIML@_INT_BROKEN_PRIX8
  165. # define @KWIML@_INT_BROKEN_PRId16
  166. # define @KWIML@_INT_BROKEN_SCNd16
  167. # define @KWIML@_INT_BROKEN_PRIi16
  168. # define @KWIML@_INT_BROKEN_SCNi16
  169. # define @KWIML@_INT_BROKEN_PRIo16
  170. # define @KWIML@_INT_BROKEN_SCNo16
  171. # define @KWIML@_INT_BROKEN_PRIu16
  172. # define @KWIML@_INT_BROKEN_SCNu16
  173. # define @KWIML@_INT_BROKEN_PRIx16
  174. # define @KWIML@_INT_BROKEN_SCNx16
  175. # define @KWIML@_INT_BROKEN_PRIX16
  176. # define @KWIML@_INT_BROKEN_PRId32
  177. # define @KWIML@_INT_BROKEN_SCNd32
  178. # define @KWIML@_INT_BROKEN_PRIi32
  179. # define @KWIML@_INT_BROKEN_SCNi32
  180. # define @KWIML@_INT_BROKEN_PRIo32
  181. # define @KWIML@_INT_BROKEN_SCNo32
  182. # define @KWIML@_INT_BROKEN_PRIu32
  183. # define @KWIML@_INT_BROKEN_SCNu32
  184. # define @KWIML@_INT_BROKEN_PRIx32
  185. # define @KWIML@_INT_BROKEN_SCNx32
  186. # define @KWIML@_INT_BROKEN_PRIX32
  187. # define @KWIML@_INT_BROKEN_PRId64
  188. # define @KWIML@_INT_BROKEN_SCNd64
  189. # define @KWIML@_INT_BROKEN_PRIi64
  190. # define @KWIML@_INT_BROKEN_SCNi64
  191. # define @KWIML@_INT_BROKEN_PRIo64
  192. # define @KWIML@_INT_BROKEN_SCNo64
  193. # define @KWIML@_INT_BROKEN_PRIu64
  194. # define @KWIML@_INT_BROKEN_SCNu64
  195. # define @KWIML@_INT_BROKEN_PRIx64
  196. # define @KWIML@_INT_BROKEN_SCNx64
  197. # define @KWIML@_INT_BROKEN_PRIX64
  198. # define @KWIML@_INT_BROKEN_PRIdPTR
  199. # define @KWIML@_INT_BROKEN_SCNdPTR
  200. # define @KWIML@_INT_BROKEN_PRIiPTR
  201. # define @KWIML@_INT_BROKEN_SCNiPTR
  202. # define @KWIML@_INT_BROKEN_PRIoPTR
  203. # define @KWIML@_INT_BROKEN_SCNoPTR
  204. # define @KWIML@_INT_BROKEN_PRIuPTR
  205. # define @KWIML@_INT_BROKEN_SCNuPTR
  206. # define @KWIML@_INT_BROKEN_PRIxPTR
  207. # define @KWIML@_INT_BROKEN_SCNxPTR
  208. # define @KWIML@_INT_BROKEN_PRIXPTR
  209. #endif
  210. #if (defined(__SUNPRO_C)||defined(__SUNPRO_CC)) && defined(_CHAR_IS_UNSIGNED)
  211. # define @KWIML@_INT_BROKEN_INT8_T /* system type defined incorrectly */
  212. #elif defined(__BORLANDC__) && defined(_CHAR_UNSIGNED)
  213. # define @KWIML@_INT_BROKEN_INT8_T /* system type defined incorrectly */
  214. #endif
  215. /*--------------------------------------------------------------------------*/
  216. #if defined(@KWIML@_INT_HAVE_INT8_T) && !defined(@KWIML@_INT_BROKEN_INT8_T)
  217. # define @KWIML@_INT_int8_t int8_t
  218. #else
  219. # define @KWIML@_INT_int8_t signed char
  220. #endif
  221. #if defined(@KWIML@_INT_HAVE_UINT8_T)
  222. # define @KWIML@_INT_uint8_t uint8_t
  223. #else
  224. # define @KWIML@_INT_uint8_t unsigned char
  225. #endif
  226. #if defined(__INTEL_COMPILER)
  227. # if defined(_WIN32)
  228. # define @KWIML@_INT__NO_SCN8
  229. # endif
  230. #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
  231. # define @KWIML@_INT__NO_SCN8
  232. #elif defined(__BORLANDC__)
  233. # define @KWIML@_INT__NO_SCN8
  234. # define @KWIML@_INT__NO_SCN64
  235. #elif defined(_MSC_VER)
  236. # define @KWIML@_INT__NO_SCN8
  237. #elif defined(__WATCOMC__)
  238. # define @KWIML@_INT__NO_SCN8
  239. # elif defined(__hpux) /* HP runtime lacks support (any compiler) */
  240. # define @KWIML@_INT__NO_SCN8
  241. #endif
  242. /* 8-bit d, i */
  243. #if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRId8) \
  244. && !defined(@KWIML@_INT_BROKEN_PRId8)
  245. # define @KWIML@_INT_PRId8 PRId8
  246. #else
  247. # define @KWIML@_INT_PRId8 "d"
  248. #endif
  249. #if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNd8) \
  250. && !defined(@KWIML@_INT_BROKEN_SCNd8)
  251. # define @KWIML@_INT_SCNd8 SCNd8
  252. #elif !defined(@KWIML@_INT__NO_SCN8)
  253. # define @KWIML@_INT_SCNd8 "hhd"
  254. #endif
  255. #if defined(@KWIML@_INT_HAVE_INT8_T) && defined(PRIi8) \
  256. && !defined(@KWIML@_INT_BROKEN_PRIi8)
  257. # define @KWIML@_INT_PRIi8 PRIi8
  258. #else
  259. # define @KWIML@_INT_PRIi8 "i"
  260. #endif
  261. #if defined(@KWIML@_INT_HAVE_INT8_T) && defined(SCNi8) \
  262. && !defined(@KWIML@_INT_BROKEN_SCNi8)
  263. # define @KWIML@_INT_SCNi8 SCNi8
  264. #elif !defined(@KWIML@_INT__NO_SCN8)
  265. # define @KWIML@_INT_SCNi8 "hhi"
  266. #endif
  267. /* 8-bit o, u, x, X */
  268. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIo8) \
  269. && !defined(@KWIML@_INT_BROKEN_PRIo8)
  270. # define @KWIML@_INT_PRIo8 PRIo8
  271. #else
  272. # define @KWIML@_INT_PRIo8 "o"
  273. #endif
  274. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNo8) \
  275. && !defined(@KWIML@_INT_BROKEN_SCNo8)
  276. # define @KWIML@_INT_SCNo8 SCNo8
  277. #elif !defined(@KWIML@_INT__NO_SCN8)
  278. # define @KWIML@_INT_SCNo8 "hho"
  279. #endif
  280. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIu8) \
  281. && !defined(@KWIML@_INT_BROKEN_PRIu8)
  282. # define @KWIML@_INT_PRIu8 PRIu8
  283. #else
  284. # define @KWIML@_INT_PRIu8 "u"
  285. #endif
  286. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNu8) \
  287. && !defined(@KWIML@_INT_BROKEN_SCNu8)
  288. # define @KWIML@_INT_SCNu8 SCNu8
  289. #elif !defined(@KWIML@_INT__NO_SCN8)
  290. # define @KWIML@_INT_SCNu8 "hhu"
  291. #endif
  292. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIx8) \
  293. && !defined(@KWIML@_INT_BROKEN_PRIx8)
  294. # define @KWIML@_INT_PRIx8 PRIx8
  295. #else
  296. # define @KWIML@_INT_PRIx8 "x"
  297. #endif
  298. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(SCNx8) \
  299. && !defined(@KWIML@_INT_BROKEN_SCNx8)
  300. # define @KWIML@_INT_SCNx8 SCNx8
  301. #elif !defined(@KWIML@_INT__NO_SCN8)
  302. # define @KWIML@_INT_SCNx8 "hhx"
  303. #endif
  304. #if defined(@KWIML@_INT_HAVE_UINT8_T) && defined(PRIX8) \
  305. && !defined(@KWIML@_INT_BROKEN_PRIX8)
  306. # define @KWIML@_INT_PRIX8 PRIX8
  307. #else
  308. # define @KWIML@_INT_PRIX8 "X"
  309. #endif
  310. /* 8-bit constants */
  311. #if defined(INT8_C) && !defined(@KWIML@_INT_BROKEN_INT8_C)
  312. # define @KWIML@_INT_INT8_C(c) INT8_C(c)
  313. #else
  314. # define @KWIML@_INT_INT8_C(c) c
  315. #endif
  316. #if defined(UINT8_C) && !defined(@KWIML@_INT_BROKEN_UINT8_C)
  317. # define @KWIML@_INT_UINT8_C(c) UINT8_C(c)
  318. #else
  319. # define @KWIML@_INT_UINT8_C(c) c ## u
  320. #endif
  321. /*--------------------------------------------------------------------------*/
  322. #if defined(@KWIML@_INT_HAVE_INT16_T)
  323. # define @KWIML@_INT_int16_t int16_t
  324. #else
  325. # define @KWIML@_INT_int16_t signed short
  326. #endif
  327. #if defined(@KWIML@_INT_HAVE_UINT16_T)
  328. # define @KWIML@_INT_uint16_t uint16_t
  329. #else
  330. # define @KWIML@_INT_uint16_t unsigned short
  331. #endif
  332. /* 16-bit d, i */
  333. #if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRId16) \
  334. && !defined(@KWIML@_INT_BROKEN_PRId16)
  335. # define @KWIML@_INT_PRId16 PRId16
  336. #else
  337. # define @KWIML@_INT_PRId16 "d"
  338. #endif
  339. #if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNd16) \
  340. && !defined(@KWIML@_INT_BROKEN_SCNd16)
  341. # define @KWIML@_INT_SCNd16 SCNd16
  342. #else
  343. # define @KWIML@_INT_SCNd16 "hd"
  344. #endif
  345. #if defined(@KWIML@_INT_HAVE_INT16_T) && defined(PRIi16) \
  346. && !defined(@KWIML@_INT_BROKEN_PRIi16)
  347. # define @KWIML@_INT_PRIi16 PRIi16
  348. #else
  349. # define @KWIML@_INT_PRIi16 "i"
  350. #endif
  351. #if defined(@KWIML@_INT_HAVE_INT16_T) && defined(SCNi16) \
  352. && !defined(@KWIML@_INT_BROKEN_SCNi16)
  353. # define @KWIML@_INT_SCNi16 SCNi16
  354. #else
  355. # define @KWIML@_INT_SCNi16 "hi"
  356. #endif
  357. /* 16-bit o, u, x, X */
  358. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIo16) \
  359. && !defined(@KWIML@_INT_BROKEN_PRIo16)
  360. # define @KWIML@_INT_PRIo16 PRIo16
  361. #else
  362. # define @KWIML@_INT_PRIo16 "o"
  363. #endif
  364. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNo16) \
  365. && !defined(@KWIML@_INT_BROKEN_SCNo16)
  366. # define @KWIML@_INT_SCNo16 SCNo16
  367. #else
  368. # define @KWIML@_INT_SCNo16 "ho"
  369. #endif
  370. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIu16) \
  371. && !defined(@KWIML@_INT_BROKEN_PRIu16)
  372. # define @KWIML@_INT_PRIu16 PRIu16
  373. #else
  374. # define @KWIML@_INT_PRIu16 "u"
  375. #endif
  376. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNu16) \
  377. && !defined(@KWIML@_INT_BROKEN_SCNu16)
  378. # define @KWIML@_INT_SCNu16 SCNu16
  379. #else
  380. # define @KWIML@_INT_SCNu16 "hu"
  381. #endif
  382. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIx16) \
  383. && !defined(@KWIML@_INT_BROKEN_PRIx16)
  384. # define @KWIML@_INT_PRIx16 PRIx16
  385. #else
  386. # define @KWIML@_INT_PRIx16 "x"
  387. #endif
  388. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(SCNx16) \
  389. && !defined(@KWIML@_INT_BROKEN_SCNx16)
  390. # define @KWIML@_INT_SCNx16 SCNx16
  391. #else
  392. # define @KWIML@_INT_SCNx16 "hx"
  393. #endif
  394. #if defined(@KWIML@_INT_HAVE_UINT16_T) && defined(PRIX16) \
  395. && !defined(@KWIML@_INT_BROKEN_PRIX16)
  396. # define @KWIML@_INT_PRIX16 PRIX16
  397. #else
  398. # define @KWIML@_INT_PRIX16 "X"
  399. #endif
  400. /* 16-bit constants */
  401. #if defined(INT16_C) && !defined(@KWIML@_INT_BROKEN_INT16_C)
  402. # define @KWIML@_INT_INT16_C(c) INT16_C(c)
  403. #else
  404. # define @KWIML@_INT_INT16_C(c) c
  405. #endif
  406. #if defined(UINT16_C) && !defined(@KWIML@_INT_BROKEN_UINT16_C)
  407. # define @KWIML@_INT_UINT16_C(c) UINT16_C(c)
  408. #else
  409. # define @KWIML@_INT_UINT16_C(c) c ## u
  410. #endif
  411. /*--------------------------------------------------------------------------*/
  412. #if defined(@KWIML@_INT_HAVE_INT32_T)
  413. # define @KWIML@_INT_int32_t int32_t
  414. #else
  415. # define @KWIML@_INT_int32_t signed int
  416. #endif
  417. #if defined(@KWIML@_INT_HAVE_UINT32_T)
  418. # define @KWIML@_INT_uint32_t uint32_t
  419. #else
  420. # define @KWIML@_INT_uint32_t unsigned int
  421. #endif
  422. /* 32-bit d, i */
  423. #if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRId32) \
  424. && !defined(@KWIML@_INT_BROKEN_PRId32)
  425. # define @KWIML@_INT_PRId32 PRId32
  426. #else
  427. # define @KWIML@_INT_PRId32 "d"
  428. #endif
  429. #if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNd32) \
  430. && !defined(@KWIML@_INT_BROKEN_SCNd32)
  431. # define @KWIML@_INT_SCNd32 SCNd32
  432. #else
  433. # define @KWIML@_INT_SCNd32 "d"
  434. #endif
  435. #if defined(@KWIML@_INT_HAVE_INT32_T) && defined(PRIi32) \
  436. && !defined(@KWIML@_INT_BROKEN_PRIi32)
  437. # define @KWIML@_INT_PRIi32 PRIi32
  438. #else
  439. # define @KWIML@_INT_PRIi32 "i"
  440. #endif
  441. #if defined(@KWIML@_INT_HAVE_INT32_T) && defined(SCNi32) \
  442. && !defined(@KWIML@_INT_BROKEN_SCNi32)
  443. # define @KWIML@_INT_SCNi32 SCNi32
  444. #else
  445. # define @KWIML@_INT_SCNi32 "i"
  446. #endif
  447. /* 32-bit o, u, x, X */
  448. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIo32) \
  449. && !defined(@KWIML@_INT_BROKEN_PRIo32)
  450. # define @KWIML@_INT_PRIo32 PRIo32
  451. #else
  452. # define @KWIML@_INT_PRIo32 "o"
  453. #endif
  454. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNo32) \
  455. && !defined(@KWIML@_INT_BROKEN_SCNo32)
  456. # define @KWIML@_INT_SCNo32 SCNo32
  457. #else
  458. # define @KWIML@_INT_SCNo32 "o"
  459. #endif
  460. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIu32) \
  461. && !defined(@KWIML@_INT_BROKEN_PRIu32)
  462. # define @KWIML@_INT_PRIu32 PRIu32
  463. #else
  464. # define @KWIML@_INT_PRIu32 "u"
  465. #endif
  466. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNu32) \
  467. && !defined(@KWIML@_INT_BROKEN_SCNu32)
  468. # define @KWIML@_INT_SCNu32 SCNu32
  469. #else
  470. # define @KWIML@_INT_SCNu32 "u"
  471. #endif
  472. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIx32) \
  473. && !defined(@KWIML@_INT_BROKEN_PRIx32)
  474. # define @KWIML@_INT_PRIx32 PRIx32
  475. #else
  476. # define @KWIML@_INT_PRIx32 "x"
  477. #endif
  478. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(SCNx32) \
  479. && !defined(@KWIML@_INT_BROKEN_SCNx32)
  480. # define @KWIML@_INT_SCNx32 SCNx32
  481. #else
  482. # define @KWIML@_INT_SCNx32 "x"
  483. #endif
  484. #if defined(@KWIML@_INT_HAVE_UINT32_T) && defined(PRIX32) \
  485. && !defined(@KWIML@_INT_BROKEN_PRIX32)
  486. # define @KWIML@_INT_PRIX32 PRIX32
  487. #else
  488. # define @KWIML@_INT_PRIX32 "X"
  489. #endif
  490. #if defined(__hpux) && defined(__GNUC__) && !defined(__LP64__) \
  491. && defined(__CONCAT__) && defined(__CONCAT_U__)
  492. /* Some HPs define UINT32_C incorrectly and break GNU. */
  493. # define @KWIML@_INT_BROKEN_UINT32_C
  494. #endif
  495. /* 32-bit constants */
  496. #if defined(INT32_C) && !defined(@KWIML@_INT_BROKEN_INT32_C)
  497. # define @KWIML@_INT_INT32_C(c) INT32_C(c)
  498. #else
  499. # define @KWIML@_INT_INT32_C(c) c
  500. #endif
  501. #if defined(UINT32_C) && !defined(@KWIML@_INT_BROKEN_UINT32_C)
  502. # define @KWIML@_INT_UINT32_C(c) UINT32_C(c)
  503. #else
  504. # define @KWIML@_INT_UINT32_C(c) c ## u
  505. #endif
  506. /*--------------------------------------------------------------------------*/
  507. #if defined(@KWIML@_INT_HAVE_INT64_T)
  508. # define @KWIML@_INT_int64_t int64_t
  509. #elif @KWIML@_ABI_SIZEOF_LONG == 8
  510. # define @KWIML@_INT_int64_t signed long
  511. #elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
  512. # define @KWIML@_INT_int64_t signed long long
  513. #elif defined(@KWIML@_ABI_SIZEOF___INT64)
  514. # define @KWIML@_INT_int64_t signed __int64
  515. #elif defined(@KWIML@_INT_NO_ERROR_INT64_T)
  516. # define @KWIML@_INT_NO_INT64_T
  517. #else
  518. # error "No type known for 'int64_t'."
  519. #endif
  520. #if defined(@KWIML@_INT_HAVE_UINT64_T)
  521. # define @KWIML@_INT_uint64_t uint64_t
  522. #elif @KWIML@_ABI_SIZEOF_LONG == 8
  523. # define @KWIML@_INT_uint64_t unsigned long
  524. #elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
  525. # define @KWIML@_INT_uint64_t unsigned long long
  526. #elif defined(@KWIML@_ABI_SIZEOF___INT64)
  527. # define @KWIML@_INT_uint64_t unsigned __int64
  528. #elif defined(@KWIML@_INT_NO_ERROR_UINT64_T)
  529. # define @KWIML@_INT_NO_UINT64_T
  530. #else
  531. # error "No type known for 'uint64_t'."
  532. #endif
  533. #if defined(__INTEL_COMPILER)
  534. #elif defined(__BORLANDC__)
  535. # define @KWIML@_INT__NO_FMTLL /* type 'long long' but not 'll' format */
  536. # define @KWIML@_INT_BROKEN_INT64_C /* system macro defined incorrectly */
  537. # define @KWIML@_INT_BROKEN_UINT64_C /* system macro defined incorrectly */
  538. #elif defined(_MSC_VER) && _MSC_VER < 1400
  539. # define @KWIML@_INT__NO_FMTLL /* type 'long long' but not 'll' format */
  540. #endif
  541. #if @KWIML@_ABI_SIZEOF_LONG == 8
  542. # define @KWIML@_INT__FMT64 "l"
  543. #elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
  544. # if !defined(@KWIML@_INT__NO_FMTLL)
  545. # define @KWIML@_INT__FMT64 "ll"
  546. # else
  547. # define @KWIML@_INT__FMT64 "I64"
  548. # endif
  549. #elif defined(@KWIML@_ABI_SIZEOF___INT64)
  550. # if defined(__BORLANDC__)
  551. # define @KWIML@_INT__FMT64 "L"
  552. # else
  553. # define @KWIML@_INT__FMT64 "I64"
  554. # endif
  555. #endif
  556. /* 64-bit d, i */
  557. #if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRId64) \
  558. && !defined(@KWIML@_INT_BROKEN_PRId64)
  559. # define @KWIML@_INT_PRId64 PRId64
  560. #elif defined(@KWIML@_INT__FMT64)
  561. # define @KWIML@_INT_PRId64 @KWIML@_INT__FMT64 "d"
  562. #endif
  563. #if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNd64) \
  564. && !defined(@KWIML@_INT_BROKEN_SCNd64)
  565. # define @KWIML@_INT_SCNd64 SCNd64
  566. #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64)
  567. # define @KWIML@_INT_SCNd64 @KWIML@_INT__FMT64 "d"
  568. #endif
  569. #if defined(@KWIML@_INT_HAVE_INT64_T) && defined(PRIi64) \
  570. && !defined(@KWIML@_INT_BROKEN_PRIi64)
  571. # define @KWIML@_INT_PRIi64 PRIi64
  572. #elif defined(@KWIML@_INT__FMT64)
  573. # define @KWIML@_INT_PRIi64 @KWIML@_INT__FMT64 "d"
  574. #endif
  575. #if defined(@KWIML@_INT_HAVE_INT64_T) && defined(SCNi64) \
  576. && !defined(@KWIML@_INT_BROKEN_SCNi64)
  577. # define @KWIML@_INT_SCNi64 SCNi64
  578. #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64)
  579. # define @KWIML@_INT_SCNi64 @KWIML@_INT__FMT64 "d"
  580. #endif
  581. /* 64-bit o, u, x, X */
  582. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIo64) \
  583. && !defined(@KWIML@_INT_BROKEN_PRIo64)
  584. # define @KWIML@_INT_PRIo64 PRIo64
  585. #elif defined(@KWIML@_INT__FMT64)
  586. # define @KWIML@_INT_PRIo64 @KWIML@_INT__FMT64 "o"
  587. #endif
  588. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNo64) \
  589. && !defined(@KWIML@_INT_BROKEN_SCNo64)
  590. # define @KWIML@_INT_SCNo64 SCNo64
  591. #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64)
  592. # define @KWIML@_INT_SCNo64 @KWIML@_INT__FMT64 "o"
  593. #endif
  594. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIu64) \
  595. && !defined(@KWIML@_INT_BROKEN_PRIu64)
  596. # define @KWIML@_INT_PRIu64 PRIu64
  597. #elif defined(@KWIML@_INT__FMT64)
  598. # define @KWIML@_INT_PRIu64 @KWIML@_INT__FMT64 "u"
  599. #endif
  600. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNu64) \
  601. && !defined(@KWIML@_INT_BROKEN_SCNu64)
  602. # define @KWIML@_INT_SCNu64 SCNu64
  603. #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64)
  604. # define @KWIML@_INT_SCNu64 @KWIML@_INT__FMT64 "u"
  605. #endif
  606. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIx64) \
  607. && !defined(@KWIML@_INT_BROKEN_PRIx64)
  608. # define @KWIML@_INT_PRIx64 PRIx64
  609. #elif defined(@KWIML@_INT__FMT64)
  610. # define @KWIML@_INT_PRIx64 @KWIML@_INT__FMT64 "x"
  611. #endif
  612. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(SCNx64) \
  613. && !defined(@KWIML@_INT_BROKEN_SCNx64)
  614. # define @KWIML@_INT_SCNx64 SCNx64
  615. #elif defined(@KWIML@_INT__FMT64) && !defined(@KWIML@_INT__NO_SCN64)
  616. # define @KWIML@_INT_SCNx64 @KWIML@_INT__FMT64 "x"
  617. #endif
  618. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(PRIX64) \
  619. && !defined(@KWIML@_INT_BROKEN_PRIX64)
  620. # define @KWIML@_INT_PRIX64 PRIX64
  621. #elif defined(@KWIML@_INT__FMT64)
  622. # define @KWIML@_INT_PRIX64 @KWIML@_INT__FMT64 "X"
  623. #endif
  624. /* 64-bit constants */
  625. #if defined(@KWIML@_INT_HAVE_INT64_T) && defined(INT64_C) \
  626. && !defined(@KWIML@_INT_BROKEN_INT64_C)
  627. # define @KWIML@_INT_INT64_C(c) INT64_C(c)
  628. #elif @KWIML@_ABI_SIZEOF_LONG == 8
  629. # define @KWIML@_INT_INT64_C(c) c ## l
  630. #elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
  631. # define @KWIML@_INT_INT64_C(c) c ## ll
  632. #elif defined(@KWIML@_ABI_SIZEOF___INT64)
  633. # define @KWIML@_INT_INT64_C(c) c ## i64
  634. #endif
  635. #if defined(@KWIML@_INT_HAVE_UINT64_T) && defined(UINT64_C) \
  636. && !defined(@KWIML@_INT_BROKEN_UINT64_C)
  637. # define @KWIML@_INT_UINT64_C(c) UINT64_C(c)
  638. #elif @KWIML@_ABI_SIZEOF_LONG == 8
  639. # define @KWIML@_INT_UINT64_C(c) c ## ul
  640. #elif defined(@KWIML@_ABI_SIZEOF_LONG_LONG) && @KWIML@_ABI_SIZEOF_LONG_LONG == 8
  641. # define @KWIML@_INT_UINT64_C(c) c ## ull
  642. #elif defined(@KWIML@_ABI_SIZEOF___INT64)
  643. # define @KWIML@_INT_UINT64_C(c) c ## ui64
  644. #endif
  645. /*--------------------------------------------------------------------------*/
  646. #if defined(@KWIML@_INT_HAVE_INTPTR_T)
  647. # define @KWIML@_INT_intptr_t intptr_t
  648. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  649. # define @KWIML@_INT_intptr_t @KWIML@_INT_int32_t
  650. #elif !defined(@KWIML@_INT_NO_INT64_T)
  651. # define @KWIML@_INT_intptr_t @KWIML@_INT_int64_t
  652. #elif defined(@KWIML@_INT_NO_ERROR_INTPTR_T)
  653. # define @KWIML@_INT_NO_INTPTR_T
  654. #else
  655. # error "No type known for 'intptr_t'."
  656. #endif
  657. #if defined(@KWIML@_INT_HAVE_UINTPTR_T)
  658. # define @KWIML@_INT_uintptr_t uintptr_t
  659. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  660. # define @KWIML@_INT_uintptr_t @KWIML@_INT_uint32_t
  661. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  662. # define @KWIML@_INT_uintptr_t @KWIML@_INT_uint64_t
  663. #elif defined(@KWIML@_INT_NO_ERROR_UINTPTR_T)
  664. # define @KWIML@_INT_NO_UINTPTR_T
  665. #else
  666. # error "No type known for 'uintptr_t'."
  667. #endif
  668. #if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIdPTR) \
  669. && !defined(@KWIML@_INT_BROKEN_PRIdPTR)
  670. # define @KWIML@_INT_PRIdPTR PRIdPTR
  671. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  672. # define @KWIML@_INT_PRIdPTR @KWIML@_INT_PRId32
  673. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  674. # define @KWIML@_INT_PRIdPTR @KWIML@_INT_PRId64
  675. #endif
  676. #if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNdPTR) \
  677. && !defined(@KWIML@_INT_BROKEN_SCNdPTR)
  678. # define @KWIML@_INT_SCNdPTR SCNdPTR
  679. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  680. # define @KWIML@_INT_SCNdPTR @KWIML@_INT_SCNd32
  681. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  682. # define @KWIML@_INT_SCNdPTR @KWIML@_INT_SCNd64
  683. #endif
  684. #if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(PRIiPTR) \
  685. && !defined(@KWIML@_INT_BROKEN_PRIiPTR)
  686. # define @KWIML@_INT_PRIiPTR PRIiPTR
  687. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  688. # define @KWIML@_INT_PRIiPTR @KWIML@_INT_PRIi32
  689. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  690. # define @KWIML@_INT_PRIiPTR @KWIML@_INT_PRIi64
  691. #endif
  692. #if defined(@KWIML@_INT_HAVE_INTPTR_T) && defined(SCNiPTR) \
  693. && !defined(@KWIML@_INT_BROKEN_SCNiPTR)
  694. # define @KWIML@_INT_SCNiPTR SCNiPTR
  695. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  696. # define @KWIML@_INT_SCNiPTR @KWIML@_INT_SCNi32
  697. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  698. # define @KWIML@_INT_SCNiPTR @KWIML@_INT_SCNi64
  699. #endif
  700. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIoPTR) \
  701. && !defined(@KWIML@_INT_BROKEN_PRIoPTR)
  702. # define @KWIML@_INT_PRIoPTR PRIoPTR
  703. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  704. # define @KWIML@_INT_PRIoPTR @KWIML@_INT_PRIo32
  705. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  706. # define @KWIML@_INT_PRIoPTR @KWIML@_INT_PRIo64
  707. #endif
  708. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNoPTR) \
  709. && !defined(@KWIML@_INT_BROKEN_SCNoPTR)
  710. # define @KWIML@_INT_SCNoPTR SCNoPTR
  711. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  712. # define @KWIML@_INT_SCNoPTR @KWIML@_INT_SCNo32
  713. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  714. # define @KWIML@_INT_SCNoPTR @KWIML@_INT_SCNo64
  715. #endif
  716. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIuPTR) \
  717. && !defined(@KWIML@_INT_BROKEN_PRIuPTR)
  718. # define @KWIML@_INT_PRIuPTR PRIuPTR
  719. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  720. # define @KWIML@_INT_PRIuPTR @KWIML@_INT_PRIu32
  721. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  722. # define @KWIML@_INT_PRIuPTR @KWIML@_INT_PRIu64
  723. #endif
  724. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNuPTR) \
  725. && !defined(@KWIML@_INT_BROKEN_SCNuPTR)
  726. # define @KWIML@_INT_SCNuPTR SCNuPTR
  727. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  728. # define @KWIML@_INT_SCNuPTR @KWIML@_INT_SCNu32
  729. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  730. # define @KWIML@_INT_SCNuPTR @KWIML@_INT_SCNu64
  731. #endif
  732. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIxPTR) \
  733. && !defined(@KWIML@_INT_BROKEN_PRIxPTR)
  734. # define @KWIML@_INT_PRIxPTR PRIxPTR
  735. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  736. # define @KWIML@_INT_PRIxPTR @KWIML@_INT_PRIx32
  737. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  738. # define @KWIML@_INT_PRIxPTR @KWIML@_INT_PRIx64
  739. #endif
  740. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(SCNxPTR) \
  741. && !defined(@KWIML@_INT_BROKEN_SCNxPTR)
  742. # define @KWIML@_INT_SCNxPTR SCNxPTR
  743. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  744. # define @KWIML@_INT_SCNxPTR @KWIML@_INT_SCNx32
  745. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  746. # define @KWIML@_INT_SCNxPTR @KWIML@_INT_SCNx64
  747. #endif
  748. #if defined(@KWIML@_INT_HAVE_UINTPTR_T) && defined(PRIXPTR) \
  749. && !defined(@KWIML@_INT_BROKEN_PRIXPTR)
  750. # define @KWIML@_INT_PRIXPTR PRIXPTR
  751. #elif @KWIML@_ABI_SIZEOF_DATA_PTR == 4
  752. # define @KWIML@_INT_PRIXPTR @KWIML@_INT_PRIX32
  753. #elif !defined(@KWIML@_INT_NO_UINT64_T)
  754. # define @KWIML@_INT_PRIXPTR @KWIML@_INT_PRIX64
  755. #endif
  756. /*--------------------------------------------------------------------------*/
  757. #if !defined(@KWIML@_INT_NO_VERIFY)
  758. #define @KWIML@_INT__VERIFY(n, x, y) extern int (*n)[x]; extern int (*n)[y]
  759. #define @KWIML@_INT__VERIFY_BOOL(m, b) @KWIML@_INT__VERIFY(m##__VERIFY__, 2, (b)?2:3)
  760. #define @KWIML@_INT__VERIFY_TYPE(t, s) @KWIML@_INT__VERIFY(t##__VERIFY__, s, sizeof(t))
  761. #define @KWIML@_INT__VERIFY_SIGN(t, u, o) @KWIML@_INT__VERIFY_BOOL(t##__SIGN, (t)((u)1 << ((sizeof(t)<<3)-1)) o 0)
  762. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_int8_t, 1);
  763. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_uint8_t, 1);
  764. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_int16_t, 2);
  765. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_uint16_t, 2);
  766. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_int32_t, 4);
  767. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_uint32_t, 4);
  768. #if !defined(@KWIML@_INT_NO_INT64_T)
  769. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_int64_t, 8);
  770. #endif
  771. #if !defined(@KWIML@_INT_NO_UINT64_T)
  772. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_uint64_t, 8);
  773. #endif
  774. #if !defined(@KWIML@_INT_NO_INTPTR_T)
  775. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_intptr_t, sizeof(void*));
  776. #endif
  777. #if !defined(@KWIML@_INT_NO_UINTPTR_T)
  778. @KWIML@_INT__VERIFY_TYPE(@KWIML@_INT_uintptr_t, sizeof(void*));
  779. #endif
  780. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_int8_t, @KWIML@_INT_uint8_t, <);
  781. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_uint8_t, @KWIML@_INT_uint8_t, >);
  782. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_int16_t, @KWIML@_INT_uint16_t, <);
  783. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_uint16_t, @KWIML@_INT_uint16_t, >);
  784. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_int32_t, @KWIML@_INT_uint32_t, <);
  785. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_uint32_t, @KWIML@_INT_uint32_t, >);
  786. #if !defined(@KWIML@_INT_NO_INT64_T)
  787. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_int64_t, @KWIML@_INT_uint64_t, <);
  788. #endif
  789. #if !defined(@KWIML@_INT_NO_UINT64_T)
  790. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_uint64_t, @KWIML@_INT_uint64_t, >);
  791. #endif
  792. #if !defined(@KWIML@_INT_NO_INTPTR_T)
  793. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_intptr_t, @KWIML@_INT_uintptr_t, <);
  794. #endif
  795. #if !defined(@KWIML@_INT_NO_UINTPTR_T)
  796. @KWIML@_INT__VERIFY_SIGN(@KWIML@_INT_uintptr_t, @KWIML@_INT_uintptr_t, >);
  797. #endif
  798. #undef @KWIML@_INT__VERIFY_SIGN
  799. #undef @KWIML@_INT__VERIFY_TYPE
  800. #undef @KWIML@_INT__VERIFY_BOOL
  801. #undef @KWIML@_INT__VERIFY
  802. #endif
  803. #endif