1
/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
1
/* -*- buffer-read-only: t -*- vi: set ro: */
2
/* DO NOT EDIT! GENERATED AUTOMATICALLY! */
3
/* Copyright (C) 2001-2002, 2004-2011 Free Software Foundation, Inc.
2
4
Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
3
5
This file is part of gnulib.
21
23
* <http://www.opengroup.org/susv3xbd/stdint.h.html>
26
#ifndef _@GUARD_PREFIX@_STDINT_H
29
@PRAGMA_SYSTEM_HEADER@
26
33
/* When including a system file that in turn includes <inttypes.h>,
27
34
use the system <inttypes.h>, not our substitute. This avoids
47
54
/* Other systems may have an incomplete or buggy <stdint.h>.
48
55
Include it before <inttypes.h>, since any "#include <stdint.h>"
49
56
in <inttypes.h> would reinclude us, skipping our contents because
50
_GL_STDINT_H is defined.
57
_@GUARD_PREFIX@_STDINT_H is defined.
51
58
The include_next requires a split double-inclusion guard. */
53
@PRAGMA_SYSTEM_HEADER@
55
59
# @INCLUDE_NEXT@ @NEXT_STDINT_H@
58
#if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
62
#if ! defined _@GUARD_PREFIX@_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
63
#define _@GUARD_PREFIX@_STDINT_H
61
65
/* <sys/types.h> defines some of the stdint.h types as well, on glibc,
62
66
IRIX 6.5, and OpenBSD 3.8 (via <machine/types.h>).
92
96
#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
94
/* Minimum and maximum values for a integer type under the usual assumption.
98
/* Minimum and maximum values for an integer type under the usual assumption.
95
99
Return an unspecified value if BITS == 0, adding a check to pacify
96
100
picky compilers. */
103
107
? ~ _STDINT_MIN (signed, bits, zero) \
104
108
: /* The expression for the unsigned case. The subtraction of (signed) \
105
is a nop in the unsigned case and avoids "signed integer overflow" \
106
warnings in the signed case. */ \
109
is a nop in the unsigned case and avoids "signed integer overflow" \
110
warnings in the signed case. */ \
107
111
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
113
#if !GNULIB_defined_stdint_types
109
115
/* 7.18.1.1. Exact-width integer types */
111
117
/* Here we assume a standard architecture where the hardware integer
132
138
#define int32_t gl_int32_t
133
139
#define uint32_t gl_uint32_t
141
/* If the system defines INT64_MAX, assume int64_t works. That way,
142
if the underlying platform defines int64_t to be a 64-bit long long
143
int, the code below won't mistakenly define it to be a 64-bit long
144
int, which would mess up C++ name mangling. We must use #ifdef
145
rather than #if, to avoid an error with HP-UX 10.20 cc. */
135
150
/* Do not undefine int64_t if gnulib is not being used with 64-bit
136
151
types, since otherwise it breaks platforms like Tandem/NSK. */
137
#if LONG_MAX >> 31 >> 31 == 1
152
# if LONG_MAX >> 31 >> 31 == 1
139
154
typedef long int gl_int64_t;
140
# define int64_t gl_int64_t
142
#elif defined _MSC_VER
155
# define int64_t gl_int64_t
157
# elif defined _MSC_VER
144
159
typedef __int64 gl_int64_t;
145
# define int64_t gl_int64_t
147
#elif @HAVE_LONG_LONG_INT@
160
# define int64_t gl_int64_t
162
# elif @HAVE_LONG_LONG_INT@
149
164
typedef long long int gl_int64_t;
150
# define int64_t gl_int64_t
165
# define int64_t gl_int64_t
154
#if ULONG_MAX >> 31 >> 31 >> 1 == 1
173
# if ULONG_MAX >> 31 >> 31 >> 1 == 1
156
175
typedef unsigned long int gl_uint64_t;
157
# define uint64_t gl_uint64_t
159
#elif defined _MSC_VER
176
# define uint64_t gl_uint64_t
178
# elif defined _MSC_VER
161
180
typedef unsigned __int64 gl_uint64_t;
162
# define uint64_t gl_uint64_t
164
#elif @HAVE_UNSIGNED_LONG_LONG_INT@
181
# define uint64_t gl_uint64_t
183
# elif @HAVE_UNSIGNED_LONG_LONG_INT@
166
185
typedef unsigned long long int gl_uint64_t;
167
# define uint64_t gl_uint64_t
186
# define uint64_t gl_uint64_t
171
191
/* Avoid collision with Solaris 2.5.1 <pthread.h> etc. */
252
272
/* Note: These types are compiler dependent. It may be unwise to use them in
253
273
public header files. */
256
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
275
/* If the system defines INTMAX_MAX, assume that intmax_t works, and
276
similarly for UINTMAX_MAX and uintmax_t. This avoids problems with
277
assuming one type where another is used by the system. */
282
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
257
283
typedef long long int gl_intmax_t;
258
# define intmax_t gl_intmax_t
259
#elif defined GL_INT64_T
260
# define intmax_t int64_t
284
# define intmax_t gl_intmax_t
285
# elif defined GL_INT64_T
286
# define intmax_t int64_t
262
288
typedef long int gl_intmax_t;
263
# define intmax_t gl_intmax_t
289
# define intmax_t gl_intmax_t
267
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
296
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
268
297
typedef unsigned long long int gl_uintmax_t;
269
# define uintmax_t gl_uintmax_t
270
#elif defined GL_UINT64_T
271
# define uintmax_t uint64_t
298
# define uintmax_t gl_uintmax_t
299
# elif defined GL_UINT64_T
300
# define uintmax_t uint64_t
273
302
typedef unsigned long int gl_uintmax_t;
274
# define uintmax_t gl_uintmax_t
303
# define uintmax_t gl_uintmax_t
277
307
/* Verify that intmax_t and uintmax_t have the same size. Too much code
278
308
breaks if this is not the case. If this check fails, the reason is likely
279
309
to be found in the autoconf macros. */
280
typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) - 1];
310
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
313
#define GNULIB_defined_stdint_types 1
314
#endif /* !GNULIB_defined_stdint_types */
282
316
/* 7.18.2. Limits of specified-width integer types */
309
343
#define INT32_MAX 2147483647
310
344
#define UINT32_MAX 4294967295U
346
#if defined GL_INT64_T && ! defined INT64_MAX
315
347
/* Prefer (- INTMAX_C (1) << 63) over (~ INT64_MAX) because SunPRO C 5.0
316
348
evaluates the latter incorrectly in preprocessor expressions. */
317
349
# define INT64_MIN (- INTMAX_C (1) << 63)
318
350
# define INT64_MAX INTMAX_C (9223372036854775807)
353
#if defined GL_UINT64_T && ! defined UINT64_MAX
323
354
# define UINT64_MAX UINTMAX_C (18446744073709551615)
413
444
/* 7.18.2.5. Limits of greatest-width integer types */
418
# define INTMAX_MIN INT64_MIN
419
# define INTMAX_MAX INT64_MAX
421
# define INTMAX_MIN INT32_MIN
422
# define INTMAX_MAX INT32_MAX
449
# define INTMAX_MIN INT64_MIN
450
# define INTMAX_MAX INT64_MAX
452
# define INTMAX_MIN INT32_MIN
453
# define INTMAX_MAX INT32_MAX
427
# define UINTMAX_MAX UINT64_MAX
429
# define UINTMAX_MAX UINT32_MAX
459
# define UINTMAX_MAX UINT64_MAX
461
# define UINTMAX_MAX UINT32_MAX
432
465
/* 7.18.3. Limits of other integer types */
475
508
/* wchar_t limits */
476
509
/* Get WCHAR_MIN, WCHAR_MAX.
477
This include is not on the top, above, because on OSF/1 4.0 we have a sequence of nested
478
includes <wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
510
This include is not on the top, above, because on OSF/1 4.0 we have a
511
sequence of nested includes
512
<wchar.h> -> <stdio.h> -> <getopt.h> -> <stdlib.h>, and the latter includes
479
513
<stdint.h> and assumes its types are already defined. */
480
#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
514
#if @HAVE_WCHAR_H@ && ! (defined WCHAR_MIN && defined WCHAR_MAX)
515
/* BSD/OS 4.0.1 has a bug: <stddef.h>, <stdio.h> and <time.h> must be
516
included before <wchar.h>. */
481
520
# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
482
521
# include <wchar.h>
483
522
# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
544
583
/* 7.18.4.2. Macros for greatest-width integer constants */
547
#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
548
# define INTMAX_C(x) x##LL
549
#elif defined GL_INT64_T
550
# define INTMAX_C(x) INT64_C(x)
552
# define INTMAX_C(x) x##L
586
# if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
587
# define INTMAX_C(x) x##LL
588
# elif defined GL_INT64_T
589
# define INTMAX_C(x) INT64_C(x)
591
# define INTMAX_C(x) x##L
556
#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
557
# define UINTMAX_C(x) x##ULL
558
#elif defined GL_UINT64_T
559
# define UINTMAX_C(x) UINT64_C(x)
561
# define UINTMAX_C(x) x##UL
596
# if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
597
# define UINTMAX_C(x) x##ULL
598
# elif defined GL_UINT64_T
599
# define UINTMAX_C(x) UINT64_C(x)
601
# define UINTMAX_C(x) x##UL
564
605
#endif /* !defined __cplusplus || defined __STDC_CONSTANT_MACROS */
566
#endif /* _GL_STDINT_H */
567
#endif /* !defined _GL_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */
607
#endif /* _@GUARD_PREFIX@_STDINT_H */
608
#endif /* !defined _@GUARD_PREFIX@_STDINT_H && !defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H */