stdint.in.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603
  1. /* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
  2. Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
  3. This file is part of gnulib.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software Foundation,
  14. Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
  15. /*
  16. * ISO C 99 <stdint.h> for platforms that lack it.
  17. * <http://www.opengroup.org/susv3xbd/stdint.h.html>
  18. */
  19. #ifndef _@GUARD_PREFIX@_STDINT_H
  20. #if __GNUC__ >= 3
  21. @PRAGMA_SYSTEM_HEADER@
  22. #endif
  23. @PRAGMA_COLUMNS@
  24. /* When including a system file that in turn includes <inttypes.h>,
  25. use the system <inttypes.h>, not our substitute. This avoids
  26. problems with (for example) VMS, whose <sys/bitypes.h> includes
  27. <inttypes.h>. */
  28. #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
  29. /* On Android (Bionic libc), <sys/types.h> includes this file before
  30. having defined 'time_t'. Therefore in this case avoid including
  31. other system header files; just include the system's <stdint.h>.
  32. Ideally we should test __BIONIC__ here, but it is only defined after
  33. <sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
  34. #if defined __ANDROID__ \
  35. && defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
  36. # @INCLUDE_NEXT@ @NEXT_STDINT_H@
  37. #else
  38. /* Get those types that are already defined in other system include
  39. files, so that we can "#define int8_t signed char" below without
  40. worrying about a later system include file containing a "typedef
  41. signed char int8_t;" that will get messed up by our macro. Our
  42. macros should all be consistent with the system versions, except
  43. for the "fast" types and macros, which we recommend against using
  44. in public interfaces due to compiler differences. */
  45. #if @HAVE_STDINT_H@
  46. # if defined __sgi && ! defined __c99
  47. /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
  48. with "This header file is to be used only for c99 mode compilations"
  49. diagnostics. */
  50. # define __STDINT_H__
  51. # endif
  52. /* Other systems may have an incomplete or buggy <stdint.h>.
  53. Include it before <inttypes.h>, since any "#include <stdint.h>"
  54. in <inttypes.h> would reinclude us, skipping our contents because
  55. _@GUARD_PREFIX@_STDINT_H is defined.
  56. The include_next requires a split double-inclusion guard. */
  57. # @INCLUDE_NEXT@ @NEXT_STDINT_H@
  58. #endif
  59. #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
  60. #define _@GUARD_PREFIX@_STDINT_H
  61. /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
  62. IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
  63. AIX 5.2 <sys/types.h> isn't needed and causes troubles.
  64. MacOS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
  65. relies on the system <stdint.h> definitions, so include
  66. <sys/types.h> after @NEXT_STDINT_H@. */
  67. #if @HAVE_SYS_TYPES_H@ && ! defined _AIX
  68. # include <sys/types.h>
  69. #endif
  70. /* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
  71. #include <limits.h>
  72. #if @HAVE_INTTYPES_H@
  73. /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
  74. int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
  75. <inttypes.h> also defines intptr_t and uintptr_t. */
  76. # include <inttypes.h>
  77. #elif @HAVE_SYS_INTTYPES_H@
  78. /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
  79. the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX. */
  80. # include <sys/inttypes.h>
  81. #endif
  82. #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
  83. /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
  84. int{8,16,32,64}_t and __BIT_TYPES_DEFINED__. In libc5 >= 5.2.2 it is
  85. included by <sys/types.h>. */
  86. # include <sys/bitypes.h>
  87. #endif
  88. #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
  89. /* Minimum and maximum values for an integer type under the usual assumption.
  90. Return an unspecified value if BITS == 0, adding a check to pacify
  91. picky compilers. */
  92. #define _STDINT_MIN(signed, bits, zero) \
  93. ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
  94. #define _STDINT_MAX(signed, bits, zero) \
  95. ((signed) \
  96. ? ~ _STDINT_MIN (signed, bits, zero) \
  97. : /* The expression for the unsigned case. The subtraction of (signed) \
  98. is a nop in the unsigned case and avoids "signed integer overflow" \
  99. warnings in the signed case. */ \
  100. ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
  101. #if !GNULIB_defined_stdint_types
  102. /* 7.18.1.1. Exact-width integer types */
  103. /* Here we assume a standard architecture where the hardware integer
  104. types have 8, 16, 32, optionally 64 bits. */
  105. #undef int8_t
  106. #undef uint8_t
  107. typedef signed char gl_int8_t;
  108. typedef unsigned char gl_uint8_t;
  109. #define int8_t gl_int8_t
  110. #define uint8_t gl_uint8_t
  111. #undef int16_t
  112. #undef uint16_t
  113. typedef short int gl_int16_t;
  114. typedef unsigned short int gl_uint16_t;
  115. #define int16_t gl_int16_t
  116. #define uint16_t gl_uint16_t
  117. #undef int32_t
  118. #undef uint32_t
  119. typedef int gl_int32_t;
  120. typedef unsigned int gl_uint32_t;
  121. #define int32_t gl_int32_t
  122. #define uint32_t gl_uint32_t
  123. /* If the system defines INT64_MAX, assume int64_t works. That way,
  124. if the underlying platform defines int64_t to be a 64-bit long long
  125. int, the code below won't mistakenly define it to be a 64-bit long
  126. int, which would mess up C++ name mangling. We must use #ifdef
  127. rather than #if, to avoid an error with HP-UX 10.20 cc. */
  128. #ifdef INT64_MAX
  129. # define GL_INT64_T
  130. #else
  131. /* Do not undefine int64_t if gnulib is not being used with 64-bit
  132. types, since otherwise it breaks platforms like Tandem/NSK. */
  133. # if LONG_MAX >> 31 >> 31 == 1
  134. # undef int64_t
  135. typedef long int gl_int64_t;
  136. # define int64_t gl_int64_t
  137. # define GL_INT64_T
  138. # elif defined _MSC_VER
  139. # undef int64_t
  140. typedef __int64 gl_int64_t;
  141. # define int64_t gl_int64_t
  142. # define GL_INT64_T
  143. # elif @HAVE_LONG_LONG_INT@
  144. # undef int64_t
  145. typedef long long int gl_int64_t;
  146. # define int64_t gl_int64_t
  147. # define GL_INT64_T
  148. # endif
  149. #endif
  150. #ifdef UINT64_MAX
  151. # define GL_UINT64_T
  152. #else
  153. # if ULONG_MAX >> 31 >> 31 >> 1 == 1
  154. # undef uint64_t
  155. typedef unsigned long int gl_uint64_t;
  156. # define uint64_t gl_uint64_t
  157. # define GL_UINT64_T
  158. # elif defined _MSC_VER
  159. # undef uint64_t
  160. typedef unsigned __int64 gl_uint64_t;
  161. # define uint64_t gl_uint64_t
  162. # define GL_UINT64_T
  163. # elif @HAVE_UNSIGNED_LONG_LONG_INT@
  164. # undef uint64_t
  165. typedef unsigned long long int gl_uint64_t;
  166. # define uint64_t gl_uint64_t
  167. # define GL_UINT64_T
  168. # endif
  169. #endif
  170. /* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
  171. #define _UINT8_T
  172. #define _UINT32_T
  173. #define _UINT64_T
  174. /* 7.18.1.2. Minimum-width integer types */
  175. /* Here we assume a standard architecture where the hardware integer
  176. types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
  177. are the same as the corresponding N_t types. */
  178. #undef int_least8_t
  179. #undef uint_least8_t
  180. #undef int_least16_t
  181. #undef uint_least16_t
  182. #undef int_least32_t
  183. #undef uint_least32_t
  184. #undef int_least64_t
  185. #undef uint_least64_t
  186. #define int_least8_t int8_t
  187. #define uint_least8_t uint8_t
  188. #define int_least16_t int16_t
  189. #define uint_least16_t uint16_t
  190. #define int_least32_t int32_t
  191. #define uint_least32_t uint32_t
  192. #ifdef GL_INT64_T
  193. # define int_least64_t int64_t
  194. #endif
  195. #ifdef GL_UINT64_T
  196. # define uint_least64_t uint64_t
  197. #endif
  198. /* 7.18.1.3. Fastest minimum-width integer types */
  199. /* Note: Other <stdint.h> substitutes may define these types differently.
  200. It is not recommended to use these types in public header files. */
  201. /* Here we assume a standard architecture where the hardware integer
  202. types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
  203. are taken from the same list of types. Assume that 'long int'
  204. is fast enough for all narrower integers. */
  205. #undef int_fast8_t
  206. #undef uint_fast8_t
  207. #undef int_fast16_t
  208. #undef uint_fast16_t
  209. #undef int_fast32_t
  210. #undef uint_fast32_t
  211. #undef int_fast64_t
  212. #undef uint_fast64_t
  213. typedef long int gl_int_fast8_t;
  214. typedef unsigned long int gl_uint_fast8_t;
  215. typedef long int gl_int_fast16_t;
  216. typedef unsigned long int gl_uint_fast16_t;
  217. typedef long int gl_int_fast32_t;
  218. typedef unsigned long int gl_uint_fast32_t;
  219. #define int_fast8_t gl_int_fast8_t
  220. #define uint_fast8_t gl_uint_fast8_t
  221. #define int_fast16_t gl_int_fast16_t
  222. #define uint_fast16_t gl_uint_fast16_t
  223. #define int_fast32_t gl_int_fast32_t
  224. #define uint_fast32_t gl_uint_fast32_t
  225. #ifdef GL_INT64_T
  226. # define int_fast64_t int64_t
  227. #endif
  228. #ifdef GL_UINT64_T
  229. # define uint_fast64_t uint64_t
  230. #endif
  231. /* 7.18.1.4. Integer types capable of holding object pointers */
  232. #undef intptr_t
  233. #undef uintptr_t
  234. typedef long int gl_intptr_t;
  235. typedef unsigned long int gl_uintptr_t;
  236. #define intptr_t gl_intptr_t
  237. #define uintptr_t gl_uintptr_t
  238. /* 7.18.1.5. Greatest-width integer types */
  239. /* Note: These types are compiler dependent. It may be unwise to use them in
  240. public header files. */
  241. #undef intmax_t
  242. #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
  243. typedef long long int gl_intmax_t;
  244. # define intmax_t gl_intmax_t
  245. #elif defined GL_INT64_T
  246. # define intmax_t int64_t
  247. #else
  248. typedef long int gl_intmax_t;
  249. # define intmax_t gl_intmax_t
  250. #endif
  251. #undef uintmax_t
  252. #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
  253. typedef unsigned long long int gl_uintmax_t;
  254. # define uintmax_t gl_uintmax_t
  255. #elif defined GL_UINT64_T
  256. # define uintmax_t uint64_t
  257. #else
  258. typedef unsigned long int gl_uintmax_t;
  259. # define uintmax_t gl_uintmax_t
  260. #endif
  261. /* Verify that intmax_t and uintmax_t have the same size. Too much code
  262. breaks if this is not the case. If this check fails, the reason is likely
  263. to be found in the autoconf macros. */
  264. typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
  265. ? 1 : -1];
  266. #define GNULIB_defined_stdint_types 1
  267. #endif /* !GNULIB_defined_stdint_types */
  268. /* 7.18.2. Limits of specified-width integer types */
  269. #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
  270. /* 7.18.2.1. Limits of exact-width integer types */
  271. /* Here we assume a standard architecture where the hardware integer
  272. types have 8, 16, 32, optionally 64 bits. */
  273. #undef INT8_MIN
  274. #undef INT8_MAX
  275. #undef UINT8_MAX
  276. #define INT8_MIN (~ INT8_MAX)
  277. #define INT8_MAX 127
  278. #define UINT8_MAX 255
  279. #undef INT16_MIN
  280. #undef INT16_MAX
  281. #undef UINT16_MAX
  282. #define INT16_MIN (~ INT16_MAX)
  283. #define INT16_MAX 32767
  284. #define UINT16_MAX 65535
  285. #undef INT32_MIN
  286. #undef INT32_MAX
  287. #undef UINT32_MAX
  288. #define INT32_MIN (~ INT32_MAX)
  289. #define INT32_MAX 2147483647
  290. #define UINT32_MAX 4294967295U
  291. #if defined GL_INT64_T && ! defined INT64_MAX
  292. /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
  293. evaluates the latter incorrectly in preprocessor expressions. */
  294. # define INT64_MIN (- INTMAX_C (1) << 63)
  295. # define INT64_MAX INTMAX_C (9223372036854775807)
  296. #endif
  297. #if defined GL_UINT64_T && ! defined UINT64_MAX
  298. # define UINT64_MAX UINTMAX_C (18446744073709551615)
  299. #endif
  300. /* 7.18.2.2. Limits of minimum-width integer types */
  301. /* Here we assume a standard architecture where the hardware integer
  302. types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
  303. are the same as the corresponding N_t types. */
  304. #undef INT_LEAST8_MIN
  305. #undef INT_LEAST8_MAX
  306. #undef UINT_LEAST8_MAX
  307. #define INT_LEAST8_MIN INT8_MIN
  308. #define INT_LEAST8_MAX INT8_MAX
  309. #define UINT_LEAST8_MAX UINT8_MAX
  310. #undef INT_LEAST16_MIN
  311. #undef INT_LEAST16_MAX
  312. #undef UINT_LEAST16_MAX
  313. #define INT_LEAST16_MIN INT16_MIN
  314. #define INT_LEAST16_MAX INT16_MAX
  315. #define UINT_LEAST16_MAX UINT16_MAX
  316. #undef INT_LEAST32_MIN
  317. #undef INT_LEAST32_MAX
  318. #undef UINT_LEAST32_MAX
  319. #define INT_LEAST32_MIN INT32_MIN
  320. #define INT_LEAST32_MAX INT32_MAX
  321. #define UINT_LEAST32_MAX UINT32_MAX
  322. #undef INT_LEAST64_MIN
  323. #undef INT_LEAST64_MAX
  324. #ifdef GL_INT64_T
  325. # define INT_LEAST64_MIN INT64_MIN
  326. # define INT_LEAST64_MAX INT64_MAX
  327. #endif
  328. #undef UINT_LEAST64_MAX
  329. #ifdef GL_UINT64_T
  330. # define UINT_LEAST64_MAX UINT64_MAX
  331. #endif
  332. /* 7.18.2.3. Limits of fastest minimum-width integer types */
  333. /* Here we assume a standard architecture where the hardware integer
  334. types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
  335. are taken from the same list of types. */
  336. #undef INT_FAST8_MIN
  337. #undef INT_FAST8_MAX
  338. #undef UINT_FAST8_MAX
  339. #define INT_FAST8_MIN LONG_MIN
  340. #define INT_FAST8_MAX LONG_MAX
  341. #define UINT_FAST8_MAX ULONG_MAX
  342. #undef INT_FAST16_MIN
  343. #undef INT_FAST16_MAX
  344. #undef UINT_FAST16_MAX
  345. #define INT_FAST16_MIN LONG_MIN
  346. #define INT_FAST16_MAX LONG_MAX
  347. #define UINT_FAST16_MAX ULONG_MAX
  348. #undef INT_FAST32_MIN
  349. #undef INT_FAST32_MAX
  350. #undef UINT_FAST32_MAX
  351. #define INT_FAST32_MIN LONG_MIN
  352. #define INT_FAST32_MAX LONG_MAX
  353. #define UINT_FAST32_MAX ULONG_MAX
  354. #undef INT_FAST64_MIN
  355. #undef INT_FAST64_MAX
  356. #ifdef GL_INT64_T
  357. # define INT_FAST64_MIN INT64_MIN
  358. # define INT_FAST64_MAX INT64_MAX
  359. #endif
  360. #undef UINT_FAST64_MAX
  361. #ifdef GL_UINT64_T
  362. # define UINT_FAST64_MAX UINT64_MAX
  363. #endif
  364. /* 7.18.2.4. Limits of integer types capable of holding object pointers */
  365. #undef INTPTR_MIN
  366. #undef INTPTR_MAX
  367. #undef UINTPTR_MAX
  368. #define INTPTR_MIN LONG_MIN
  369. #define INTPTR_MAX LONG_MAX
  370. #define UINTPTR_MAX ULONG_MAX
  371. /* 7.18.2.5. Limits of greatest-width integer types */
  372. #undef INTMAX_MIN
  373. #undef INTMAX_MAX
  374. #ifdef INT64_MAX
  375. # define INTMAX_MIN INT64_MIN
  376. # define INTMAX_MAX INT64_MAX
  377. #else
  378. # define INTMAX_MIN INT32_MIN
  379. # define INTMAX_MAX INT32_MAX
  380. #endif
  381. #undef UINTMAX_MAX
  382. #ifdef UINT64_MAX
  383. # define UINTMAX_MAX UINT64_MAX
  384. #else
  385. # define UINTMAX_MAX UINT32_MAX
  386. #endif
  387. /* 7.18.3. Limits of other integer types */
  388. /* ptrdiff_t limits */
  389. #undef PTRDIFF_MIN
  390. #undef PTRDIFF_MAX
  391. #if @APPLE_UNIVERSAL_BUILD@
  392. # ifdef _LP64
  393. # define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
  394. # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
  395. # else
  396. # define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
  397. # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
  398. # endif
  399. #else
  400. # define PTRDIFF_MIN \
  401. _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
  402. # define PTRDIFF_MAX \
  403. _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
  404. #endif
  405. /* sig_atomic_t limits */
  406. #undef SIG_ATOMIC_MIN
  407. #undef SIG_ATOMIC_MAX
  408. #define SIG_ATOMIC_MIN \
  409. _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
  410. 0@SIG_ATOMIC_T_SUFFIX@)
  411. #define SIG_ATOMIC_MAX \
  412. _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
  413. 0@SIG_ATOMIC_T_SUFFIX@)
  414. /* size_t limit */
  415. #undef SIZE_MAX
  416. #if @APPLE_UNIVERSAL_BUILD@
  417. # ifdef _LP64
  418. # define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
  419. # else
  420. # define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
  421. # endif
  422. #else
  423. # define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
  424. #endif
  425. /* wchar_t limits */
  426. /* Get WCHAR_MIN, WCHAR_MAX.
  427. This include is not on the top, above, because on OSF/1 4.0 we have a
  428. sequence of nested includes
  429. <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
  430. <stdint.h> and assumes its types are already defined. */
  431. #if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
  432. /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
  433. included before <wchar.h>. */
  434. # include <stddef.h>
  435. # include <stdio.h>
  436. # include <time.h>
  437. # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
  438. # include <wchar.h>
  439. # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
  440. #endif
  441. #undef WCHAR_MIN
  442. #undef WCHAR_MAX
  443. #define WCHAR_MIN \
  444. _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
  445. #define WCHAR_MAX \
  446. _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
  447. /* wint_t limits */
  448. #undef WINT_MIN
  449. #undef WINT_MAX
  450. #define WINT_MIN \
  451. _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
  452. #define WINT_MAX \
  453. _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
  454. #endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
  455. /* 7.18.4. Macros for integer constants */
  456. #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
  457. /* 7.18.4.1. Macros for minimum-width integer constants */
  458. /* According to ISO C 99 Technical Corrigendum 1 */
  459. /* Here we assume a standard architecture where the hardware integer
  460. types have 8, 16, 32, optionally 64 bits, and int is 32 bits. */
  461. #undef INT8_C
  462. #undef UINT8_C
  463. #define INT8_C(x) x
  464. #define UINT8_C(x) x
  465. #undef INT16_C
  466. #undef UINT16_C
  467. #define INT16_C(x) x
  468. #define UINT16_C(x) x
  469. #undef INT32_C
  470. #undef UINT32_C
  471. #define INT32_C(x) x
  472. #define UINT32_C(x) x ## U
  473. #undef INT64_C
  474. #undef UINT64_C
  475. #if LONG_MAX >> 31 >> 31 == 1
  476. # define INT64_C(x) x##L
  477. #elif defined _MSC_VER
  478. # define INT64_C(x) x##i64
  479. #elif @HAVE_LONG_LONG_INT@
  480. # define INT64_C(x) x##LL
  481. #endif
  482. #if ULONG_MAX >> 31 >> 31 >> 1 == 1
  483. # define UINT64_C(x) x##UL
  484. #elif defined _MSC_VER
  485. # define UINT64_C(x) x##ui64
  486. #elif @HAVE_UNSIGNED_LONG_LONG_INT@
  487. # define UINT64_C(x) x##ULL
  488. #endif
  489. /* 7.18.4.2. Macros for greatest-width integer constants */
  490. #undef INTMAX_C
  491. #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
  492. # define INTMAX_C(x) x##LL
  493. #elif defined GL_INT64_T
  494. # define INTMAX_C(x) INT64_C(x)
  495. #else
  496. # define INTMAX_C(x) x##L
  497. #endif
  498. #undef UINTMAX_C
  499. #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
  500. # define UINTMAX_C(x) x##ULL
  501. #elif defined GL_UINT64_T
  502. # define UINTMAX_C(x) UINT64_C(x)
  503. #else
  504. # define UINTMAX_C(x) x##UL
  505. #endif
  506. #endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
  507. #endif /* _@GUARD_PREFIX@_STDINT_H */
  508. #endif /* !(defined __ANDROID__ && ...) */
  509. #endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */