1
/* -*- buffer-read-only: t -*- vi: set ro: */
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
/* Copyright (C) 2001-2002, 2004-2010 Free Software Foundation, Inc.
1
/* Copyright (C) 2001-2002, 2004-2012 Free Software Foundation, Inc.
4
2
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
5
3
This file is part of gnulib.
15
13
GNU General Public License for more details.
17
15
You should have received a copy of the GNU General Public License
18
along with this program; if not, write to the Free Software Foundation,
19
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
16
along with this program; if not, see <http://www.gnu.org/licenses/>. */
22
19
* ISO C 99 <stdint.h> for platforms that lack it.
23
20
* <http://www.opengroup.org/susv3xbd/stdint.h.html>
23
#ifndef _@GUARD_PREFIX@_STDINT_H
26
@PRAGMA_SYSTEM_HEADER@
28
30
/* When including a system file that in turn includes <inttypes.h>,
29
31
use the system <inttypes.h>, not our substitute. This avoids
32
34
#define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
36
/* On Android (Bionic libc), <sys/types.h> includes this file before
37
having defined 'time_t'. Therefore in this case avoid including
38
other system header files; just include the system's <stdint.h>.
39
Ideally we should test __BIONIC__ here, but it is only defined after
40
<sys/cdefs.h> has been included; hence test __ANDROID__ instead. */
41
#if defined __ANDROID__ \
42
&& defined _SYS_TYPES_H_ && !defined _SSIZE_T_DEFINED_
43
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
34
46
/* Get those types that are already defined in other system include
35
47
files, so that we can "#define int8_t signed char" below without
36
48
worrying about a later system include file containing a "typedef
47
59
# define __STDINT_H__
62
/* Some pre-C++11 <stdint.h> implementations need this. */
64
# ifndef __STDC_CONSTANT_MACROS
65
# define __STDC_CONSTANT_MACROS 1
67
# ifndef __STDC_LIMIT_MACROS
68
# define __STDC_LIMIT_MACROS 1
49
72
/* Other systems may have an incomplete or buggy <stdint.h>.
50
73
Include it before <inttypes.h>, since any "#include <stdint.h>"
51
74
in <inttypes.h> would reinclude us, skipping our contents because
52
_GL_STDINT_H is defined.
75
_@GUARD_PREFIX@_STDINT_H is defined.
53
76
The include_next requires a split double-inclusion guard. */
55
@PRAGMA_SYSTEM_HEADER@
57
77
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
60
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
80
#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
81
#define _@GUARD_PREFIX@_STDINT_H
63
83
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
64
84
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
70
90
# include <sys/types.h>
73
/* Get LONG_MIN, LONG_MAX, ULONG_MAX. */
93
/* Get SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, INT_MIN, INT_MAX,
94
LONG_MIN, LONG_MAX, ULONG_MAX. */
74
95
#include <limits.h>
76
97
#if @HAVE_INTTYPES_H@
94
115
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
96
/* Minimum and maximum values for a integer type under the usual assumption.
117
/* Minimum and maximum values for an integer type under the usual assumption.
97
118
Return an unspecified value if BITS == 0, adding a check to pacify
98
119
picky compilers. */
108
129
warnings in the signed case. */ \
109
130
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
132
#if !GNULIB_defined_stdint_types
111
134
/* 7.18.1.1. Exact-width integer types */
113
136
/* Here we assume a standard architecture where the hardware integer
134
157
#define int32_t gl_int32_t
135
158
#define uint32_t gl_uint32_t
160
/* If the system defines INT64_MAX, assume int64_t works. That way,
161
if the underlying platform defines int64_t to be a 64-bit long long
162
int, the code below won't mistakenly define it to be a 64-bit long
163
int, which would mess up C++ name mangling. We must use #ifdef
164
rather than #if, to avoid an error with HP-UX 10.20 cc. */
137
169
/* Do not undefine int64_t if gnulib is not being used with 64-bit
138
170
types, since otherwise it breaks platforms like Tandem/NSK. */
139
#if LONG_MAX >> 31 >> 31 == 1
171
# if LONG_MAX >> 31 >> 31 == 1
141
173
typedef long int gl_int64_t;
142
# define int64_t gl_int64_t
144
#elif defined _MSC_VER
174
# define int64_t gl_int64_t
176
# elif defined _MSC_VER
146
178
typedef __int64 gl_int64_t;
147
# define int64_t gl_int64_t
149
#elif @HAVE_LONG_LONG_INT@
179
# define int64_t gl_int64_t
181
# elif @HAVE_LONG_LONG_INT@
151
183
typedef long long int gl_int64_t;
152
# define int64_t gl_int64_t
184
# define int64_t gl_int64_t
156
#if ULONG_MAX >> 31 >> 31 >> 1 == 1
192
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
158
194
typedef unsigned long int gl_uint64_t;
159
# define uint64_t gl_uint64_t
161
#elif defined _MSC_VER
195
# define uint64_t gl_uint64_t
197
# elif defined _MSC_VER
163
199
typedef unsigned __int64 gl_uint64_t;
164
# define uint64_t gl_uint64_t
166
#elif @HAVE_UNSIGNED_LONG_LONG_INT@
200
# define uint64_t gl_uint64_t
202
# elif @HAVE_UNSIGNED_LONG_LONG_INT@
168
204
typedef unsigned long long int gl_uint64_t;
169
# define uint64_t gl_uint64_t
205
# define uint64_t gl_uint64_t
173
210
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
211
248
/* Here we assume a standard architecture where the hardware integer
212
249
types have 8, 16, 32, optionally 64 bits. Therefore the fastN_t types
213
are taken from the same list of types. Assume that 'long int'
214
is fast enough for all narrower integers. */
250
are taken from the same list of types. The following code normally
251
uses types consistent with glibc, as that lessens the chance of
252
incompatibility with older GNU hosts. */
216
254
#undef int_fast8_t
217
255
#undef uint_fast8_t
221
259
#undef uint_fast32_t
222
260
#undef int_fast64_t
223
261
#undef uint_fast64_t
224
typedef long int gl_int_fast8_t;
225
typedef unsigned long int gl_uint_fast8_t;
226
typedef long int gl_int_fast16_t;
227
typedef unsigned long int gl_uint_fast16_t;
262
typedef signed char gl_int_fast8_t;
263
typedef unsigned char gl_uint_fast8_t;
266
/* Define types compatible with SunOS 5.10, so that code compiled under
267
earlier SunOS versions works with code compiled under SunOS 5.10. */
268
typedef int gl_int_fast32_t;
269
typedef unsigned int gl_uint_fast32_t;
228
271
typedef long int gl_int_fast32_t;
229
272
typedef unsigned long int gl_uint_fast32_t;
274
typedef gl_int_fast32_t gl_int_fast16_t;
275
typedef gl_uint_fast32_t gl_uint_fast16_t;
230
277
#define int_fast8_t gl_int_fast8_t
231
278
#define uint_fast8_t gl_uint_fast8_t
232
279
#define int_fast16_t gl_int_fast16_t
254
301
/* Note: These types are compiler dependent. It may be unwise to use them in
255
302
public header files. */
258
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
304
/* If the system defines INTMAX_MAX, assume that intmax_t works, and
305
similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
306
assuming one type where another is used by the system. */
311
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
259
312
typedef long long int gl_intmax_t;
260
# define intmax_t gl_intmax_t
261
#elif defined GL_INT64_T
262
# define intmax_t int64_t
313
# define intmax_t gl_intmax_t
314
# elif defined GL_INT64_T
315
# define intmax_t int64_t
264
317
typedef long int gl_intmax_t;
265
# define intmax_t gl_intmax_t
318
# define intmax_t gl_intmax_t
269
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
325
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
270
326
typedef unsigned long long int gl_uintmax_t;
271
# define uintmax_t gl_uintmax_t
272
#elif defined GL_UINT64_T
273
# define uintmax_t uint64_t
327
# define uintmax_t gl_uintmax_t
328
# elif defined GL_UINT64_T
329
# define uintmax_t uint64_t
275
331
typedef unsigned long int gl_uintmax_t;
276
# define uintmax_t gl_uintmax_t
332
# define uintmax_t gl_uintmax_t
279
336
/* Verify that intmax_t and uintmax_t have the same size. Too much code
280
337
breaks if this is not the case. If this check fails, the reason is likely
281
338
to be found in the autoconf macros. */
282
typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];
339
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
342
#define GNULIB_defined_stdint_types 1
343
#endif /* !GNULIB_defined_stdint_types */
284
345
/* 7.18.2. Limits of specified-width integer types */
286
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
288
347
/* 7.18.2.1. Limits of exact-width integer types */
290
349
/* Here we assume a standard architecture where the hardware integer
311
370
#define INT32_MAX 2147483647
312
371
#define UINT32_MAX 4294967295U
373
#if defined GL_INT64_T && ! defined INT64_MAX
317
374
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
318
375
evaluates the latter incorrectly in preprocessor expressions. */
319
376
# define INT64_MIN (- INTMAX_C (1) << 63)
320
377
# define INT64_MAX INTMAX_C (9223372036854775807)
380
#if defined GL_UINT64_T && ! defined UINT64_MAX
325
381
# define UINT64_MAX UINTMAX_C (18446744073709551615)
373
429
#undef INT_FAST8_MIN
374
430
#undef INT_FAST8_MAX
375
431
#undef UINT_FAST8_MAX
376
#define INT_FAST8_MIN LONG_MIN
377
#define INT_FAST8_MAX LONG_MAX
378
#define UINT_FAST8_MAX ULONG_MAX
432
#define INT_FAST8_MIN SCHAR_MIN
433
#define INT_FAST8_MAX SCHAR_MAX
434
#define UINT_FAST8_MAX UCHAR_MAX
380
436
#undef INT_FAST16_MIN
381
437
#undef INT_FAST16_MAX
382
438
#undef UINT_FAST16_MAX
383
#define INT_FAST16_MIN LONG_MIN
384
#define INT_FAST16_MAX LONG_MAX
385
#define UINT_FAST16_MAX ULONG_MAX
439
#define INT_FAST16_MIN INT_FAST32_MIN
440
#define INT_FAST16_MAX INT_FAST32_MAX
441
#define UINT_FAST16_MAX UINT_FAST32_MAX
387
443
#undef INT_FAST32_MIN
388
444
#undef INT_FAST32_MAX
389
445
#undef UINT_FAST32_MAX
390
#define INT_FAST32_MIN LONG_MIN
391
#define INT_FAST32_MAX LONG_MAX
392
#define UINT_FAST32_MAX ULONG_MAX
447
# define INT_FAST32_MIN INT_MIN
448
# define INT_FAST32_MAX INT_MAX
449
# define UINT_FAST32_MAX UINT_MAX
451
# define INT_FAST32_MIN LONG_MIN
452
# define INT_FAST32_MAX LONG_MAX
453
# define UINT_FAST32_MAX ULONG_MAX
394
456
#undef INT_FAST64_MIN
395
457
#undef INT_FAST64_MAX
415
477
/* 7.18.2.5. Limits of greatest-width integer types */
420
# define INTMAX_MIN INT64_MIN
421
# define INTMAX_MAX INT64_MAX
423
# define INTMAX_MIN INT32_MIN
424
# define INTMAX_MAX INT32_MAX
482
# define INTMAX_MIN INT64_MIN
483
# define INTMAX_MAX INT64_MAX
485
# define INTMAX_MIN INT32_MIN
486
# define INTMAX_MAX INT32_MAX
429
# define UINTMAX_MAX UINT64_MAX
431
# define UINTMAX_MAX UINT32_MAX
492
# define UINTMAX_MAX UINT64_MAX
494
# define UINTMAX_MAX UINT32_MAX
434
498
/* 7.18.3. Limits of other integer types */
477
541
/* wchar_t limits */
478
542
/* Get WCHAR_MIN, WCHAR_MAX.
479
This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
480
includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
543
This include is not on the top, above, because on OSF/1 4.0 we have a
544
sequence of nested includes
545
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
481
546
<stdint.h> and assumes its types are already defined. */
482
#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
547
#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
548
/* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
549
included before <wchar.h>. */
483
553
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
484
554
# include <wchar.h>
485
555
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
499
569
#define WINT_MAX \
500
570
_STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
502
#endif /* !defined __cplusplus || defined __STDC_LIMIT_MACROS */
504
572
/* 7.18.4. Macros for integer constants */
506
#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
508
574
/* 7.18.4.1. Macros for minimum-width integer constants */
509
575
/* According to ISO C 99 Technical Corrigendum 1 */
546
612
/* 7.18.4.2. Macros for greatest-width integer constants */
549
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
550
# define INTMAX_C(x) x##LL
551
#elif defined GL_INT64_T
552
# define INTMAX_C(x) INT64_C(x)
554
# define INTMAX_C(x) x##L
558
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
559
# define UINTMAX_C(x) x##ULL
560
#elif defined GL_UINT64_T
561
# define UINTMAX_C(x) UINT64_C(x)
563
# define UINTMAX_C(x) x##UL
566
#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
568
#endif /* _GL_STDINT_H */
569
#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
615
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
616
# define INTMAX_C(x) x##LL
617
# elif defined GL_INT64_T
618
# define INTMAX_C(x) INT64_C(x)
620
# define INTMAX_C(x) x##L
625
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
626
# define UINTMAX_C(x) x##ULL
627
# elif defined GL_UINT64_T
628
# define UINTMAX_C(x) UINT64_C(x)
630
# define UINTMAX_C(x) x##UL
634
#endif /* _@GUARD_PREFIX@_STDINT_H */
635
#endif /* !(defined __ANDROID__ && ...) */
636
#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */