1 /* -*- buffer-read-only: t -*- vi: set ro: */
2 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3 /* Copyright (C) 2001-2002, 2004-2019 Free Software Foundation, Inc.
4    Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
5    This file is part of gnulib.
6 
7    This program is free software; you can redistribute it and/or modify
8    it under the terms of the GNU General Public License as published by
9    the Free Software Foundation; either version 3, or (at your option)
10    any later version.
11 
12    This program is distributed in the hope that it will be useful,
13    but WITHOUT ANY WARRANTY; without even the implied warranty of
14    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15    GNU General Public License for more details.
16 
17    You should have received a copy of the GNU General Public License
18    along with this program; if not, see <https://www.gnu.org/licenses/>.  */
19 
20 /*
21  * ISO C 99 <stdint.h> for platforms that lack it.
22  * <http://www.opengroup.org/susv3xbd/stdint.h.html>
23  */
24 
25 #ifndef _@GUARD_PREFIX@_STDINT_H
26 
27 #if __GNUC__ >= 3
28 @PRAGMA_SYSTEM_HEADER@
29 #endif
30 @PRAGMA_COLUMNS@
31 
32 /* When including a system file that in turn includes <inttypes.h>,
33    use the system <inttypes.h>, not our substitute.  This avoids
34    problems with (for example) VMS, whose <sys/bitypes.h> includes
35    <inttypes.h>.  */
36 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
37 
38 /* On Android (Bionic libc), <sys/types.h> includes this file before
39    having defined 'time_t'.  Therefore in this case avoid including
40    other system header files; just include the system's <stdint.h>.
41    Ideally we should test __BIONIC__ here, but it is only defined after
42    <sys/cdefs.h> has been included; hence test __ANDROID__ instead.  */
43 #if defined __ANDROID__ && defined _GL_INCLUDING_SYS_TYPES_H
44 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
45 #else
46 
47 /* Get those types that are already defined in other system include
48    files, so that we can "#define int8_t signed char" below without
49    worrying about a later system include file containing a "typedef
50    signed char int8_t;" that will get messed up by our macro.  Our
51    macros should all be consistent with the system versions, except
52    for the "fast" types and macros, which we recommend against using
53    in public interfaces due to compiler differences.  */
54 
55 #if @HAVE_STDINT_H@
56 # if defined __sgi && ! defined __c99
57    /* Bypass IRIX's <stdint.h> if in C89 mode, since it merely annoys users
58       with "This header file is to be used only for c99 mode compilations"
59       diagnostics.  */
60 #  define __STDINT_H__
61 # endif
62 
63   /* Some pre-C++11 <stdint.h> implementations need this.  */
64 # ifdef __cplusplus
65 #  ifndef __STDC_CONSTANT_MACROS
66 #   define __STDC_CONSTANT_MACROS 1
67 #  endif
68 #  ifndef __STDC_LIMIT_MACROS
69 #   define __STDC_LIMIT_MACROS 1
70 #  endif
71 # endif
72 
73   /* Other systems may have an incomplete or buggy <stdint.h>.
74      Include it before <inttypes.h>, since any "#include <stdint.h>"
75      in <inttypes.h> would reinclude us, skipping our contents because
76      _@GUARD_PREFIX@_STDINT_H is defined.
77      The include_next requires a split double-inclusion guard.  */
78 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
79 #endif
80 
81 #if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
82 #define _@GUARD_PREFIX@_STDINT_H
83 
84 /* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
85    LONG_MIN, LONG_MAX, ULONG_MAX, _GL_INTEGER_WIDTH.  */
86 #include <limits.h>
87 
88 /* Override WINT_MIN and WINT_MAX if gnulib's <wchar.h> or <wctype.h> overrides
89    wint_t.  */
90 #if @GNULIB_OVERRIDES_WINT_T@
91 # undef WINT_MIN
92 # undef WINT_MAX
93 # define WINT_MIN 0x0U
94 # define WINT_MAX 0xffffffffU
95 #endif
96 
97 #if ! @HAVE_C99_STDINT_H@
98 
99 /* <sys/types.h> defines some of the stdint.h types as well, on glibc,
100    IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
101    AIX 5.2 <sys/types.h> isn't needed and causes troubles.
102    Mac OS X 10.4.6 <sys/types.h> includes <stdint.h> (which is us), but
103    relies on the system <stdint.h> definitions, so include
104    <sys/types.h> after @NEXT_STDINT_H@.  */
105 # if @HAVE_SYS_TYPES_H@ && ! defined _AIX
106 #  include <sys/types.h>
107 # endif
108 
109 # if @HAVE_INTTYPES_H@
110   /* In OpenBSD 3.8, <inttypes.h> includes <machine/types.h>, which defines
111      int{8,16,32,64}_t, uint{8,16,32,64}_t and __BIT_TYPES_DEFINED__.
112      <inttypes.h> also defines intptr_t and uintptr_t.  */
113 #  include <inttypes.h>
114 # elif @HAVE_SYS_INTTYPES_H@
115   /* Solaris 7 <sys/inttypes.h> has the types except the *_fast*_t types, and
116      the macros except for *_FAST*_*, INTPTR_MIN, PTRDIFF_MIN, PTRDIFF_MAX.  */
117 #  include <sys/inttypes.h>
118 # endif
119 
120 # if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
121   /* Linux libc4 >= 4.6.7 and libc5 have a <sys/bitypes.h> that defines
122      int{8,16,32,64}_t and __BIT_TYPES_DEFINED__.  In libc5 >= 5.2.2 it is
123      included by <sys/types.h>.  */
124 #  include <sys/bitypes.h>
125 # endif
126 
127 # undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
128 
129 /* Minimum and maximum values for an integer type under the usual assumption.
130    Return an unspecified value if BITS == 0, adding a check to pacify
131    picky compilers.  */
132 
133 /* These are separate macros, because if you try to merge these macros into
134    a single one, HP-UX cc rejects the resulting expression in constant
135    expressions.  */
136 # define _STDINT_UNSIGNED_MIN(bits, zero) \
137     (zero)
138 # define _STDINT_SIGNED_MIN(bits, zero) \
139     (~ _STDINT_MAX (1, bits, zero))
140 
141 # define _STDINT_MAX(signed, bits, zero) \
142     (((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
143 
144 #if !GNULIB_defined_stdint_types
145 
146 /* 7.18.1.1. Exact-width integer types */
147 
148 /* Here we assume a standard architecture where the hardware integer
149    types have 8, 16, 32, optionally 64 bits.  */
150 
151 # undef int8_t
152 # undef uint8_t
153 typedef signed char gl_int8_t;
154 typedef unsigned char gl_uint8_t;
155 # define int8_t gl_int8_t
156 # define uint8_t gl_uint8_t
157 
158 # undef int16_t
159 # undef uint16_t
160 typedef short int gl_int16_t;
161 typedef unsigned short int gl_uint16_t;
162 # define int16_t gl_int16_t
163 # define uint16_t gl_uint16_t
164 
165 # undef int32_t
166 # undef uint32_t
167 typedef int gl_int32_t;
168 typedef unsigned int gl_uint32_t;
169 # define int32_t gl_int32_t
170 # define uint32_t gl_uint32_t
171 
172 /* If the system defines INT64_MAX, assume int64_t works.  That way,
173    if the underlying platform defines int64_t to be a 64-bit long long
174    int, the code below won't mistakenly define it to be a 64-bit long
175    int, which would mess up C++ name mangling.  We must use #ifdef
176    rather than #if, to avoid an error with HP-UX 10.20 cc.  */
177 
178 # ifdef INT64_MAX
179 #  define GL_INT64_T
180 # else
181 /* Do not undefine int64_t if gnulib is not being used with 64-bit
182    types, since otherwise it breaks platforms like Tandem/NSK.  */
183 #  if LONG_MAX >> 31 >> 31 == 1
184 #   undef int64_t
185 typedef long int gl_int64_t;
186 #   define int64_t gl_int64_t
187 #   define GL_INT64_T
188 #  elif defined _MSC_VER
189 #   undef int64_t
190 typedef __int64 gl_int64_t;
191 #   define int64_t gl_int64_t
192 #   define GL_INT64_T
193 #  elif @HAVE_LONG_LONG_INT@
194 #   undef int64_t
195 typedef long long int gl_int64_t;
196 #   define int64_t gl_int64_t
197 #   define GL_INT64_T
198 #  endif
199 # endif
200 
201 # ifdef UINT64_MAX
202 #  define GL_UINT64_T
203 # else
204 #  if ULONG_MAX >> 31 >> 31 >> 1 == 1
205 #   undef uint64_t
206 typedef unsigned long int gl_uint64_t;
207 #   define uint64_t gl_uint64_t
208 #   define GL_UINT64_T
209 #  elif defined _MSC_VER
210 #   undef uint64_t
211 typedef unsigned __int64 gl_uint64_t;
212 #   define uint64_t gl_uint64_t
213 #   define GL_UINT64_T
214 #  elif @HAVE_UNSIGNED_LONG_LONG_INT@
215 #   undef uint64_t
216 typedef unsigned long long int gl_uint64_t;
217 #   define uint64_t gl_uint64_t
218 #   define GL_UINT64_T
219 #  endif
220 # endif
221 
222 /* Avoid collision with Solaris 2.5.1 <pthread.h> etc.  */
223 # define _UINT8_T
224 # define _UINT32_T
225 # define _UINT64_T
226 
227 
228 /* 7.18.1.2. Minimum-width integer types */
229 
230 /* Here we assume a standard architecture where the hardware integer
231    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
232    are the same as the corresponding N_t types.  */
233 
234 # undef int_least8_t
235 # undef uint_least8_t
236 # undef int_least16_t
237 # undef uint_least16_t
238 # undef int_least32_t
239 # undef uint_least32_t
240 # undef int_least64_t
241 # undef uint_least64_t
242 # define int_least8_t int8_t
243 # define uint_least8_t uint8_t
244 # define int_least16_t int16_t
245 # define uint_least16_t uint16_t
246 # define int_least32_t int32_t
247 # define uint_least32_t uint32_t
248 # ifdef GL_INT64_T
249 #  define int_least64_t int64_t
250 # endif
251 # ifdef GL_UINT64_T
252 #  define uint_least64_t uint64_t
253 # endif
254 
255 /* 7.18.1.3. Fastest minimum-width integer types */
256 
257 /* Note: Other <stdint.h> substitutes may define these types differently.
258    It is not recommended to use these types in public header files. */
259 
260 /* Here we assume a standard architecture where the hardware integer
261    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
262    are taken from the same list of types.  The following code normally
263    uses types consistent with glibc, as that lessens the chance of
264    incompatibility with older GNU hosts.  */
265 
266 # undef int_fast8_t
267 # undef uint_fast8_t
268 # undef int_fast16_t
269 # undef uint_fast16_t
270 # undef int_fast32_t
271 # undef uint_fast32_t
272 # undef int_fast64_t
273 # undef uint_fast64_t
274 typedef signed char gl_int_fast8_t;
275 typedef unsigned char gl_uint_fast8_t;
276 
277 # ifdef __sun
278 /* Define types compatible with SunOS 5.10, so that code compiled under
279    earlier SunOS versions works with code compiled under SunOS 5.10.  */
280 typedef int gl_int_fast32_t;
281 typedef unsigned int gl_uint_fast32_t;
282 # else
283 typedef long int gl_int_fast32_t;
284 typedef unsigned long int gl_uint_fast32_t;
285 # endif
286 typedef gl_int_fast32_t gl_int_fast16_t;
287 typedef gl_uint_fast32_t gl_uint_fast16_t;
288 
289 # define int_fast8_t gl_int_fast8_t
290 # define uint_fast8_t gl_uint_fast8_t
291 # define int_fast16_t gl_int_fast16_t
292 # define uint_fast16_t gl_uint_fast16_t
293 # define int_fast32_t gl_int_fast32_t
294 # define uint_fast32_t gl_uint_fast32_t
295 # ifdef GL_INT64_T
296 #  define int_fast64_t int64_t
297 # endif
298 # ifdef GL_UINT64_T
299 #  define uint_fast64_t uint64_t
300 # endif
301 
302 /* 7.18.1.4. Integer types capable of holding object pointers */
303 
304 /* kLIBC's stdint.h defines _INTPTR_T_DECLARED and needs its own
305    definitions of intptr_t and uintptr_t (which use int and unsigned)
306    to avoid clashes with declarations of system functions like sbrk.  */
307 # ifndef _INTPTR_T_DECLARED
308 # undef intptr_t
309 # undef uintptr_t
310 typedef long int gl_intptr_t;
311 typedef unsigned long int gl_uintptr_t;
312 # define intptr_t gl_intptr_t
313 # define uintptr_t gl_uintptr_t
314 # endif
315 
316 /* 7.18.1.5. Greatest-width integer types */
317 
318 /* Note: These types are compiler dependent. It may be unwise to use them in
319    public header files. */
320 
321 /* If the system defines INTMAX_MAX, assume that intmax_t works, and
322    similarly for UINTMAX_MAX and uintmax_t.  This avoids problems with
323    assuming one type where another is used by the system.  */
324 
325 # ifndef INTMAX_MAX
326 #  undef INTMAX_C
327 #  undef intmax_t
328 #  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
329 typedef long long int gl_intmax_t;
330 #   define intmax_t gl_intmax_t
331 #  elif defined GL_INT64_T
332 #   define intmax_t int64_t
333 #  else
334 typedef long int gl_intmax_t;
335 #   define intmax_t gl_intmax_t
336 #  endif
337 # endif
338 
339 # ifndef UINTMAX_MAX
340 #  undef UINTMAX_C
341 #  undef uintmax_t
342 #  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
343 typedef unsigned long long int gl_uintmax_t;
344 #   define uintmax_t gl_uintmax_t
345 #  elif defined GL_UINT64_T
346 #   define uintmax_t uint64_t
347 #  else
348 typedef unsigned long int gl_uintmax_t;
349 #   define uintmax_t gl_uintmax_t
350 #  endif
351 # endif
352 
353 /* Verify that intmax_t and uintmax_t have the same size.  Too much code
354    breaks if this is not the case.  If this check fails, the reason is likely
355    to be found in the autoconf macros.  */
356 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
357                                 ? 1 : -1];
358 
359 # define GNULIB_defined_stdint_types 1
360 # endif /* !GNULIB_defined_stdint_types */
361 
362 /* 7.18.2. Limits of specified-width integer types */
363 
364 /* 7.18.2.1. Limits of exact-width integer types */
365 
366 /* Here we assume a standard architecture where the hardware integer
367    types have 8, 16, 32, optionally 64 bits.  */
368 
369 # undef INT8_MIN
370 # undef INT8_MAX
371 # undef UINT8_MAX
372 # define INT8_MIN  (~ INT8_MAX)
373 # define INT8_MAX  127
374 # define UINT8_MAX  255
375 
376 # undef INT16_MIN
377 # undef INT16_MAX
378 # undef UINT16_MAX
379 # define INT16_MIN  (~ INT16_MAX)
380 # define INT16_MAX  32767
381 # define UINT16_MAX  65535
382 
383 # undef INT32_MIN
384 # undef INT32_MAX
385 # undef UINT32_MAX
386 # define INT32_MIN  (~ INT32_MAX)
387 # define INT32_MAX  2147483647
388 # define UINT32_MAX  4294967295U
389 
390 # if defined GL_INT64_T && ! defined INT64_MAX
391 /* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
392    evaluates the latter incorrectly in preprocessor expressions.  */
393 #  define INT64_MIN  (- INTMAX_C (1) << 63)
394 #  define INT64_MAX  INTMAX_C (9223372036854775807)
395 # endif
396 
397 # if defined GL_UINT64_T && ! defined UINT64_MAX
398 #  define UINT64_MAX  UINTMAX_C (18446744073709551615)
399 # endif
400 
401 /* 7.18.2.2. Limits of minimum-width integer types */
402 
403 /* Here we assume a standard architecture where the hardware integer
404    types have 8, 16, 32, optionally 64 bits. Therefore the leastN_t types
405    are the same as the corresponding N_t types.  */
406 
407 # undef INT_LEAST8_MIN
408 # undef INT_LEAST8_MAX
409 # undef UINT_LEAST8_MAX
410 # define INT_LEAST8_MIN  INT8_MIN
411 # define INT_LEAST8_MAX  INT8_MAX
412 # define UINT_LEAST8_MAX  UINT8_MAX
413 
414 # undef INT_LEAST16_MIN
415 # undef INT_LEAST16_MAX
416 # undef UINT_LEAST16_MAX
417 # define INT_LEAST16_MIN  INT16_MIN
418 # define INT_LEAST16_MAX  INT16_MAX
419 # define UINT_LEAST16_MAX  UINT16_MAX
420 
421 # undef INT_LEAST32_MIN
422 # undef INT_LEAST32_MAX
423 # undef UINT_LEAST32_MAX
424 # define INT_LEAST32_MIN  INT32_MIN
425 # define INT_LEAST32_MAX  INT32_MAX
426 # define UINT_LEAST32_MAX  UINT32_MAX
427 
428 # undef INT_LEAST64_MIN
429 # undef INT_LEAST64_MAX
430 # ifdef GL_INT64_T
431 #  define INT_LEAST64_MIN  INT64_MIN
432 #  define INT_LEAST64_MAX  INT64_MAX
433 # endif
434 
435 # undef UINT_LEAST64_MAX
436 # ifdef GL_UINT64_T
437 #  define UINT_LEAST64_MAX  UINT64_MAX
438 # endif
439 
440 /* 7.18.2.3. Limits of fastest minimum-width integer types */
441 
442 /* Here we assume a standard architecture where the hardware integer
443    types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
444    are taken from the same list of types.  */
445 
446 # undef INT_FAST8_MIN
447 # undef INT_FAST8_MAX
448 # undef UINT_FAST8_MAX
449 # define INT_FAST8_MIN  SCHAR_MIN
450 # define INT_FAST8_MAX  SCHAR_MAX
451 # define UINT_FAST8_MAX  UCHAR_MAX
452 
453 # undef INT_FAST16_MIN
454 # undef INT_FAST16_MAX
455 # undef UINT_FAST16_MAX
456 # define INT_FAST16_MIN  INT_FAST32_MIN
457 # define INT_FAST16_MAX  INT_FAST32_MAX
458 # define UINT_FAST16_MAX  UINT_FAST32_MAX
459 
460 # undef INT_FAST32_MIN
461 # undef INT_FAST32_MAX
462 # undef UINT_FAST32_MAX
463 # ifdef __sun
464 #  define INT_FAST32_MIN  INT_MIN
465 #  define INT_FAST32_MAX  INT_MAX
466 #  define UINT_FAST32_MAX  UINT_MAX
467 # else
468 #  define INT_FAST32_MIN  LONG_MIN
469 #  define INT_FAST32_MAX  LONG_MAX
470 #  define UINT_FAST32_MAX  ULONG_MAX
471 # endif
472 
473 # undef INT_FAST64_MIN
474 # undef INT_FAST64_MAX
475 # ifdef GL_INT64_T
476 #  define INT_FAST64_MIN  INT64_MIN
477 #  define INT_FAST64_MAX  INT64_MAX
478 # endif
479 
480 # undef UINT_FAST64_MAX
481 # ifdef GL_UINT64_T
482 #  define UINT_FAST64_MAX  UINT64_MAX
483 # endif
484 
485 /* 7.18.2.4. Limits of integer types capable of holding object pointers */
486 
487 # undef INTPTR_MIN
488 # undef INTPTR_MAX
489 # undef UINTPTR_MAX
490 # define INTPTR_MIN  LONG_MIN
491 # define INTPTR_MAX  LONG_MAX
492 # define UINTPTR_MAX  ULONG_MAX
493 
494 /* 7.18.2.5. Limits of greatest-width integer types */
495 
496 # ifndef INTMAX_MAX
497 #  undef INTMAX_MIN
498 #  ifdef INT64_MAX
499 #   define INTMAX_MIN  INT64_MIN
500 #   define INTMAX_MAX  INT64_MAX
501 #  else
502 #   define INTMAX_MIN  INT32_MIN
503 #   define INTMAX_MAX  INT32_MAX
504 #  endif
505 # endif
506 
507 # ifndef UINTMAX_MAX
508 #  ifdef UINT64_MAX
509 #   define UINTMAX_MAX  UINT64_MAX
510 #  else
511 #   define UINTMAX_MAX  UINT32_MAX
512 #  endif
513 # endif
514 
515 /* 7.18.3. Limits of other integer types */
516 
517 /* ptrdiff_t limits */
518 # undef PTRDIFF_MIN
519 # undef PTRDIFF_MAX
520 # if @APPLE_UNIVERSAL_BUILD@
521 #  ifdef _LP64
522 #   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (64, 0l)
523 #   define PTRDIFF_MAX  _STDINT_MAX (1, 64, 0l)
524 #  else
525 #   define PTRDIFF_MIN  _STDINT_SIGNED_MIN (32, 0)
526 #   define PTRDIFF_MAX  _STDINT_MAX (1, 32, 0)
527 #  endif
528 # else
529 #  define PTRDIFF_MIN  \
530     _STDINT_SIGNED_MIN (@BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
531 #  define PTRDIFF_MAX  \
532     _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
533 # endif
534 
535 /* sig_atomic_t limits */
536 # undef SIG_ATOMIC_MIN
537 # undef SIG_ATOMIC_MAX
538 # if @HAVE_SIGNED_SIG_ATOMIC_T@
539 #  define SIG_ATOMIC_MIN  \
540     _STDINT_SIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
541 # else
542 #  define SIG_ATOMIC_MIN  \
543     _STDINT_UNSIGNED_MIN (@BITSIZEOF_SIG_ATOMIC_T@, 0@SIG_ATOMIC_T_SUFFIX@)
544 # endif
545 # define SIG_ATOMIC_MAX  \
546    _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
547                 0@SIG_ATOMIC_T_SUFFIX@)
548 
549 
550 /* size_t limit */
551 # undef SIZE_MAX
552 # if @APPLE_UNIVERSAL_BUILD@
553 #  ifdef _LP64
554 #   define SIZE_MAX  _STDINT_MAX (0, 64, 0ul)
555 #  else
556 #   define SIZE_MAX  _STDINT_MAX (0, 32, 0ul)
557 #  endif
558 # else
559 #  define SIZE_MAX  _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
560 # endif
561 
562 /* wchar_t limits */
563 /* Get WCHAR_MIN, WCHAR_MAX.
564    This include is not on the top, above, because on OSF/1 4.0 we have a
565    sequence of nested includes
566    <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
567    <stdint.h> and assumes its types are already defined.  */
568 # if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
569   /* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
570      included before <wchar.h>.  */
571 #  include <stddef.h>
572 #  include <stdio.h>
573 #  include <time.h>
574 #  define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
575 #  include <wchar.h>
576 #  undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
577 # endif
578 # undef WCHAR_MIN
579 # undef WCHAR_MAX
580 # if @HAVE_SIGNED_WCHAR_T@
581 #  define WCHAR_MIN  \
582     _STDINT_SIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
583 # else
584 #  define WCHAR_MIN  \
585     _STDINT_UNSIGNED_MIN (@BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
586 # endif
587 # define WCHAR_MAX  \
588    _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
589 
590 /* wint_t limits */
591 # undef WINT_MIN
592 # undef WINT_MAX
593 # if @HAVE_SIGNED_WINT_T@
594 #  define WINT_MIN  \
595     _STDINT_SIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
596 # else
597 #  define WINT_MIN  \
598     _STDINT_UNSIGNED_MIN (@BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
599 # endif
600 # define WINT_MAX  \
601    _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
602 
603 /* 7.18.4. Macros for integer constants */
604 
605 /* 7.18.4.1. Macros for minimum-width integer constants */
606 /* According to ISO C 99 Technical Corrigendum 1 */
607 
608 /* Here we assume a standard architecture where the hardware integer
609    types have 8, 16, 32, optionally 64 bits, and int is 32 bits.  */
610 
611 # undef INT8_C
612 # undef UINT8_C
613 # define INT8_C(x) x
614 # define UINT8_C(x) x
615 
616 # undef INT16_C
617 # undef UINT16_C
618 # define INT16_C(x) x
619 # define UINT16_C(x) x
620 
621 # undef INT32_C
622 # undef UINT32_C
623 # define INT32_C(x) x
624 # define UINT32_C(x) x ## U
625 
626 # undef INT64_C
627 # undef UINT64_C
628 # if LONG_MAX >> 31 >> 31 == 1
629 #  define INT64_C(x) x##L
630 # elif defined _MSC_VER
631 #  define INT64_C(x) x##i64
632 # elif @HAVE_LONG_LONG_INT@
633 #  define INT64_C(x) x##LL
634 # endif
635 # if ULONG_MAX >> 31 >> 31 >> 1 == 1
636 #  define UINT64_C(x) x##UL
637 # elif defined _MSC_VER
638 #  define UINT64_C(x) x##ui64
639 # elif @HAVE_UNSIGNED_LONG_LONG_INT@
640 #  define UINT64_C(x) x##ULL
641 # endif
642 
643 /* 7.18.4.2. Macros for greatest-width integer constants */
644 
645 # ifndef INTMAX_C
646 #  if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
647 #   define INTMAX_C(x)   x##LL
648 #  elif defined GL_INT64_T
649 #   define INTMAX_C(x)   INT64_C(x)
650 #  else
651 #   define INTMAX_C(x)   x##L
652 #  endif
653 # endif
654 
655 # ifndef UINTMAX_C
656 #  if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
657 #   define UINTMAX_C(x)  x##ULL
658 #  elif defined GL_UINT64_T
659 #   define UINTMAX_C(x)  UINT64_C(x)
660 #  else
661 #   define UINTMAX_C(x)  x##UL
662 #  endif
663 # endif
664 
665 #endif /* !@HAVE_C99_STDINT_H@ */
666 
667 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
668 
669 #if (!defined UINTMAX_WIDTH \
670      && (defined _GNU_SOURCE || defined __STDC_WANT_IEC_60559_BFP_EXT__))
671 # ifdef INT8_MAX
672 #  define INT8_WIDTH _GL_INTEGER_WIDTH (INT8_MIN, INT8_MAX)
673 # endif
674 # ifdef UINT8_MAX
675 #  define UINT8_WIDTH _GL_INTEGER_WIDTH (0, UINT8_MAX)
676 # endif
677 # ifdef INT16_MAX
678 #  define INT16_WIDTH _GL_INTEGER_WIDTH (INT16_MIN, INT16_MAX)
679 # endif
680 # ifdef UINT16_MAX
681 #  define UINT16_WIDTH _GL_INTEGER_WIDTH (0, UINT16_MAX)
682 # endif
683 # ifdef INT32_MAX
684 #  define INT32_WIDTH _GL_INTEGER_WIDTH (INT32_MIN, INT32_MAX)
685 # endif
686 # ifdef UINT32_MAX
687 #  define UINT32_WIDTH _GL_INTEGER_WIDTH (0, UINT32_MAX)
688 # endif
689 # ifdef INT64_MAX
690 #  define INT64_WIDTH _GL_INTEGER_WIDTH (INT64_MIN, INT64_MAX)
691 # endif
692 # ifdef UINT64_MAX
693 #  define UINT64_WIDTH _GL_INTEGER_WIDTH (0, UINT64_MAX)
694 # endif
695 # define INT_LEAST8_WIDTH _GL_INTEGER_WIDTH (INT_LEAST8_MIN, INT_LEAST8_MAX)
696 # define UINT_LEAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST8_MAX)
697 # define INT_LEAST16_WIDTH _GL_INTEGER_WIDTH (INT_LEAST16_MIN, INT_LEAST16_MAX)
698 # define UINT_LEAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST16_MAX)
699 # define INT_LEAST32_WIDTH _GL_INTEGER_WIDTH (INT_LEAST32_MIN, INT_LEAST32_MAX)
700 # define UINT_LEAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST32_MAX)
701 # define INT_LEAST64_WIDTH _GL_INTEGER_WIDTH (INT_LEAST64_MIN, INT_LEAST64_MAX)
702 # define UINT_LEAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_LEAST64_MAX)
703 # define INT_FAST8_WIDTH _GL_INTEGER_WIDTH (INT_FAST8_MIN, INT_FAST8_MAX)
704 # define UINT_FAST8_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST8_MAX)
705 # define INT_FAST16_WIDTH _GL_INTEGER_WIDTH (INT_FAST16_MIN, INT_FAST16_MAX)
706 # define UINT_FAST16_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST16_MAX)
707 # define INT_FAST32_WIDTH _GL_INTEGER_WIDTH (INT_FAST32_MIN, INT_FAST32_MAX)
708 # define UINT_FAST32_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST32_MAX)
709 # define INT_FAST64_WIDTH _GL_INTEGER_WIDTH (INT_FAST64_MIN, INT_FAST64_MAX)
710 # define UINT_FAST64_WIDTH _GL_INTEGER_WIDTH (0, UINT_FAST64_MAX)
711 # define INTPTR_WIDTH _GL_INTEGER_WIDTH (INTPTR_MIN, INTPTR_MAX)
712 # define UINTPTR_WIDTH _GL_INTEGER_WIDTH (0, UINTPTR_MAX)
713 # define INTMAX_WIDTH _GL_INTEGER_WIDTH (INTMAX_MIN, INTMAX_MAX)
714 # define UINTMAX_WIDTH _GL_INTEGER_WIDTH (0, UINTMAX_MAX)
715 # define PTRDIFF_WIDTH _GL_INTEGER_WIDTH (PTRDIFF_MIN, PTRDIFF_MAX)
716 # define SIZE_WIDTH _GL_INTEGER_WIDTH (0, SIZE_MAX)
717 # define WCHAR_WIDTH _GL_INTEGER_WIDTH (WCHAR_MIN, WCHAR_MAX)
718 # ifdef WINT_MAX
719 #  define WINT_WIDTH _GL_INTEGER_WIDTH (WINT_MIN, WINT_MAX)
720 # endif
721 # ifdef SIG_ATOMIC_MAX
722 #  define SIG_ATOMIC_WIDTH _GL_INTEGER_WIDTH (SIG_ATOMIC_MIN, SIG_ATOMIC_MAX)
723 # endif
724 #endif /* !WINT_WIDTH && (_GNU_SOURCE || __STDC_WANT_IEC_60559_BFP_EXT__) */
725 
726 #endif /* _@GUARD_PREFIX@_STDINT_H */
727 #endif /* !(defined __ANDROID__ && ...) */
728 #endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
729