summaryrefslogtreecommitdiffstats
path: root/gl/stdint.in.h
diff options
context:
space:
mode:
authorThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-15 04:22:57 -0500
committerThomas Guyot-Sionnest <dermoth@aei.ca>2009-01-15 05:19:08 -0500
commit71cdb52799220f8d9052643baf1d3e9836a9c755 (patch)
tree27aee97a35d9ab51f0d8f64a46690bd41a5f8c1b /gl/stdint.in.h
parentf7afa46586645e50498d8b2d0c67884f014dc3a4 (diff)
downloadmonitoring-plugins-71cdb52799220f8d9052643baf1d3e9836a9c755.tar.gz
Sync with gnulib
Diffstat (limited to 'gl/stdint.in.h')
-rw-r--r--gl/stdint.in.h123
1 files changed, 84 insertions, 39 deletions
diff --git a/gl/stdint.in.h b/gl/stdint.in.h
index 67baceb6..f141c8f6 100644
--- a/gl/stdint.in.h
+++ b/gl/stdint.in.h
@@ -1,4 +1,4 @@
1/* Copyright (C) 2001-2002, 2004-2007 Free Software Foundation, Inc. 1/* Copyright (C) 2001-2002, 2004-2009 Free Software Foundation, Inc.
2 Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood. 2 Written by Paul Eggert, Bruno Haible, Sam Steingold, Peter Burwood.
3 This file is part of gnulib. 3 This file is part of gnulib.
4 4
@@ -49,6 +49,9 @@
49 in <inttypes.h> would reinclude us, skipping our contents because 49 in <inttypes.h> would reinclude us, skipping our contents because
50 _GL_STDINT_H is defined. 50 _GL_STDINT_H is defined.
51 The include_next requires a split double-inclusion guard. */ 51 The include_next requires a split double-inclusion guard. */
52# if __GNUC__ >= 3
53@PRAGMA_SYSTEM_HEADER@
54# endif
52# @INCLUDE_NEXT@ @NEXT_STDINT_H@ 55# @INCLUDE_NEXT@ @NEXT_STDINT_H@
53#endif 56#endif
54 57
@@ -86,15 +89,6 @@
86# include <sys/bitypes.h> 89# include <sys/bitypes.h>
87#endif 90#endif
88 91
89#if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
90
91/* Get WCHAR_MIN, WCHAR_MAX. */
92# if ! (defined WCHAR_MIN && defined WCHAR_MAX)
93# include <wchar.h>
94# endif
95
96#endif
97
98#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H 92#undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
99 93
100/* Minimum and maximum values for a integer type under the usual assumption. 94/* Minimum and maximum values for a integer type under the usual assumption.
@@ -119,46 +113,58 @@
119 113
120#undef int8_t 114#undef int8_t
121#undef uint8_t 115#undef uint8_t
122#define int8_t signed char 116typedef signed char gl_int8_t;
123#define uint8_t unsigned char 117typedef unsigned char gl_uint8_t;
118#define int8_t gl_int8_t
119#define uint8_t gl_uint8_t
124 120
125#undef int16_t 121#undef int16_t
126#undef uint16_t 122#undef uint16_t
127#define int16_t short int 123typedef short int gl_int16_t;
128#define uint16_t unsigned short int 124typedef unsigned short int gl_uint16_t;
125#define int16_t gl_int16_t
126#define uint16_t gl_uint16_t
129 127
130#undef int32_t 128#undef int32_t
131#undef uint32_t 129#undef uint32_t
132#define int32_t int 130typedef int gl_int32_t;
133#define uint32_t unsigned int 131typedef unsigned int gl_uint32_t;
132#define int32_t gl_int32_t
133#define uint32_t gl_uint32_t
134 134
135/* Do not undefine int64_t if gnulib is not being used with 64-bit 135/* Do not undefine int64_t if gnulib is not being used with 64-bit
136 types, since otherwise it breaks platforms like Tandem/NSK. */ 136 types, since otherwise it breaks platforms like Tandem/NSK. */
137#if LONG_MAX >> 31 >> 31 == 1 137#if LONG_MAX >> 31 >> 31 == 1
138# undef int64_t 138# undef int64_t
139# define int64_t long int 139typedef long int gl_int64_t;
140# define int64_t gl_int64_t
140# define GL_INT64_T 141# define GL_INT64_T
141#elif defined _MSC_VER 142#elif defined _MSC_VER
142# undef int64_t 143# undef int64_t
143# define int64_t __int64 144typedef __int64 gl_int64_t;
145# define int64_t gl_int64_t
144# define GL_INT64_T 146# define GL_INT64_T
145#elif @HAVE_LONG_LONG_INT@ 147#elif @HAVE_LONG_LONG_INT@
146# undef int64_t 148# undef int64_t
147# define int64_t long long int 149typedef long long int gl_int64_t;
150# define int64_t gl_int64_t
148# define GL_INT64_T 151# define GL_INT64_T
149#endif 152#endif
150 153
151#if ULONG_MAX >> 31 >> 31 >> 1 == 1 154#if ULONG_MAX >> 31 >> 31 >> 1 == 1
152# undef uint64_t 155# undef uint64_t
153# define uint64_t unsigned long int 156typedef unsigned long int gl_uint64_t;
157# define uint64_t gl_uint64_t
154# define GL_UINT64_T 158# define GL_UINT64_T
155#elif defined _MSC_VER 159#elif defined _MSC_VER
156# undef uint64_t 160# undef uint64_t
157# define uint64_t unsigned __int64 161typedef unsigned __int64 gl_uint64_t;
162# define uint64_t gl_uint64_t
158# define GL_UINT64_T 163# define GL_UINT64_T
159#elif @HAVE_UNSIGNED_LONG_LONG_INT@ 164#elif @HAVE_UNSIGNED_LONG_LONG_INT@
160# undef uint64_t 165# undef uint64_t
161# define uint64_t unsigned long long int 166typedef unsigned long long int gl_uint64_t;
167# define uint64_t gl_uint64_t
162# define GL_UINT64_T 168# define GL_UINT64_T
163#endif 169#endif
164 170
@@ -213,12 +219,18 @@
213#undef uint_fast32_t 219#undef uint_fast32_t
214#undef int_fast64_t 220#undef int_fast64_t
215#undef uint_fast64_t 221#undef uint_fast64_t
216#define int_fast8_t long int 222typedef long int gl_int_fast8_t;
217#define uint_fast8_t unsigned int_fast8_t 223typedef unsigned long int gl_uint_fast8_t;
218#define int_fast16_t long int 224typedef long int gl_int_fast16_t;
219#define uint_fast16_t unsigned int_fast16_t 225typedef unsigned long int gl_uint_fast16_t;
220#define int_fast32_t long int 226typedef long int gl_int_fast32_t;
221#define uint_fast32_t unsigned int_fast32_t 227typedef unsigned long int gl_uint_fast32_t;
228#define int_fast8_t gl_int_fast8_t
229#define uint_fast8_t gl_uint_fast8_t
230#define int_fast16_t gl_int_fast16_t
231#define uint_fast16_t gl_uint_fast16_t
232#define int_fast32_t gl_int_fast32_t
233#define uint_fast32_t gl_uint_fast32_t
222#ifdef GL_INT64_T 234#ifdef GL_INT64_T
223# define int_fast64_t int64_t 235# define int_fast64_t int64_t
224#endif 236#endif
@@ -230,8 +242,10 @@
230 242
231#undef intptr_t 243#undef intptr_t
232#undef uintptr_t 244#undef uintptr_t
233#define intptr_t long int 245typedef long int gl_intptr_t;
234#define uintptr_t unsigned long int 246typedef unsigned long int gl_uintptr_t;
247#define intptr_t gl_intptr_t
248#define uintptr_t gl_uintptr_t
235 249
236/* 7.18.1.5. Greatest-width integer types */ 250/* 7.18.1.5. Greatest-width integer types */
237 251
@@ -240,20 +254,24 @@
240 254
241#undef intmax_t 255#undef intmax_t
242#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1 256#if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
243# define intmax_t long long int 257typedef long long int gl_intmax_t;
258# define intmax_t gl_intmax_t
244#elif defined GL_INT64_T 259#elif defined GL_INT64_T
245# define intmax_t int64_t 260# define intmax_t int64_t
246#else 261#else
247# define intmax_t long int 262typedef long int gl_intmax_t;
263# define intmax_t gl_intmax_t
248#endif 264#endif
249 265
250#undef uintmax_t 266#undef uintmax_t
251#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1 267#if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
252# define uintmax_t unsigned long long int 268typedef unsigned long long int gl_uintmax_t;
269# define uintmax_t gl_uintmax_t
253#elif defined GL_UINT64_T 270#elif defined GL_UINT64_T
254# define uintmax_t uint64_t 271# define uintmax_t uint64_t
255#else 272#else
256# define uintmax_t unsigned long int 273typedef unsigned long int gl_uintmax_t;
274# define uintmax_t gl_uintmax_t
257#endif 275#endif
258 276
259/* Verify that intmax_t and uintmax_t have the same size. Too much code 277/* Verify that intmax_t and uintmax_t have the same size. Too much code
@@ -416,10 +434,20 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
416/* ptrdiff_t limits */ 434/* ptrdiff_t limits */
417#undef PTRDIFF_MIN 435#undef PTRDIFF_MIN
418#undef PTRDIFF_MAX 436#undef PTRDIFF_MAX
419#define PTRDIFF_MIN \ 437#if @APPLE_UNIVERSAL_BUILD@
420 _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) 438# if _LP64
421#define PTRDIFF_MAX \ 439# define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
422 _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@) 440# define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
441# else
442# define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
443# define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
444# endif
445#else
446# define PTRDIFF_MIN \
447 _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
448# define PTRDIFF_MAX \
449 _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
450#endif
423 451
424/* sig_atomic_t limits */ 452/* sig_atomic_t limits */
425#undef SIG_ATOMIC_MIN 453#undef SIG_ATOMIC_MIN
@@ -434,9 +462,26 @@ typedef int _verify_intmax_size[2 * (sizeof (intmax_t) == sizeof (uintmax_t)) -
434 462
435/* size_t limit */ 463/* size_t limit */
436#undef SIZE_MAX 464#undef SIZE_MAX
437#define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@) 465#if @APPLE_UNIVERSAL_BUILD@
466# if _LP64
467# define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
468# else
469# define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
470# endif
471#else
472# define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
473#endif
438 474
439/* wchar_t limits */ 475/* wchar_t limits */
476/* 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
479 <stdint.h> and assumes its types are already defined. */
480#if ! (defined WCHAR_MIN && defined WCHAR_MAX)
481# define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
482# include <wchar.h>
483# undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
484#endif
440#undef WCHAR_MIN 485#undef WCHAR_MIN
441#undef WCHAR_MAX 486#undef WCHAR_MAX
442#define WCHAR_MIN \ 487#define WCHAR_MIN \