Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef _GL_STDINT_H
00027
00028 #if __GNUC__ >= 3
00029 @PRAGMA_SYSTEM_HEADER@
00030 #endif
00031 @PRAGMA_COLUMNS@
00032
00033
00034
00035
00036
00037 #define _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047 #if @HAVE_STDINT_H@
00048 # if defined __sgi && ! defined __c99
00049
00050
00051
00052 # define __STDINT_H__
00053 # endif
00054
00055
00056
00057
00058
00059 # @INCLUDE_NEXT@ @NEXT_STDINT_H@
00060 #endif
00061
00062 #if ! defined _GL_STDINT_H && ! defined _GL_JUST_INCLUDE_SYSTEM_STDINT_H
00063 #define _GL_STDINT_H
00064
00065
00066
00067
00068
00069
00070
00071 #if @HAVE_SYS_TYPES_H@ && ! defined _AIX
00072 # include <sys/types.h>
00073 #endif
00074
00075
00076 #include <limits.h>
00077
00078 #if @HAVE_INTTYPES_H@
00079
00080
00081
00082 # include <inttypes.h>
00083 #elif @HAVE_SYS_INTTYPES_H@
00084
00085
00086 # include <sys/inttypes.h>
00087 #endif
00088
00089 #if @HAVE_SYS_BITYPES_H@ && ! defined __BIT_TYPES_DEFINED__
00090
00091
00092
00093 # include <sys/bitypes.h>
00094 #endif
00095
00096 #undef _GL_JUST_INCLUDE_SYSTEM_INTTYPES_H
00097
00098
00099
00100
00101
00102 #define _STDINT_MIN(signed, bits, zero) \
00103 ((signed) ? (- ((zero) + 1) << ((bits) ? (bits) - 1 : 0)) : (zero))
00104
00105 #define _STDINT_MAX(signed, bits, zero) \
00106 ((signed) \
00107 ? ~ _STDINT_MIN (signed, bits, zero) \
00108 :
00109
00110 \
00111 ((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
00112
00113 #if !GNULIB_defined_stdint_types
00114
00115
00116
00117
00118
00119
00120 #undef int8_t
00121 #undef uint8_t
00122 typedef signed char gl_int8_t;
00123 typedef unsigned char gl_uint8_t;
00124 #define int8_t gl_int8_t
00125 #define uint8_t gl_uint8_t
00126
00127 #undef int16_t
00128 #undef uint16_t
00129 typedef short int gl_int16_t;
00130 typedef unsigned short int gl_uint16_t;
00131 #define int16_t gl_int16_t
00132 #define uint16_t gl_uint16_t
00133
00134 #undef int32_t
00135 #undef uint32_t
00136 typedef int gl_int32_t;
00137 typedef unsigned int gl_uint32_t;
00138 #define int32_t gl_int32_t
00139 #define uint32_t gl_uint32_t
00140
00141
00142
00143
00144
00145
00146
00147 #ifdef INT64_MAX
00148 # define GL_INT64_T
00149 #else
00150
00151
00152 # if LONG_MAX >> 31 >> 31 == 1
00153 # undef int64_t
00154 typedef long int gl_int64_t;
00155 # define int64_t gl_int64_t
00156 # define GL_INT64_T
00157 # elif defined _MSC_VER
00158 # undef int64_t
00159 typedef __int64 gl_int64_t;
00160 # define int64_t gl_int64_t
00161 # define GL_INT64_T
00162 # elif @HAVE_LONG_LONG_INT@
00163 # undef int64_t
00164 typedef long long int gl_int64_t;
00165 # define int64_t gl_int64_t
00166 # define GL_INT64_T
00167 # endif
00168 #endif
00169
00170 #ifdef UINT64_MAX
00171 # define GL_UINT64_T
00172 #else
00173 # if ULONG_MAX >> 31 >> 31 >> 1 == 1
00174 # undef uint64_t
00175 typedef unsigned long int gl_uint64_t;
00176 # define uint64_t gl_uint64_t
00177 # define GL_UINT64_T
00178 # elif defined _MSC_VER
00179 # undef uint64_t
00180 typedef unsigned __int64 gl_uint64_t;
00181 # define uint64_t gl_uint64_t
00182 # define GL_UINT64_T
00183 # elif @HAVE_UNSIGNED_LONG_LONG_INT@
00184 # undef uint64_t
00185 typedef unsigned long long int gl_uint64_t;
00186 # define uint64_t gl_uint64_t
00187 # define GL_UINT64_T
00188 # endif
00189 #endif
00190
00191
00192 #define _UINT8_T
00193 #define _UINT32_T
00194 #define _UINT64_T
00195
00196
00197
00198
00199
00200
00201
00202
00203 #undef int_least8_t
00204 #undef uint_least8_t
00205 #undef int_least16_t
00206 #undef uint_least16_t
00207 #undef int_least32_t
00208 #undef uint_least32_t
00209 #undef int_least64_t
00210 #undef uint_least64_t
00211 #define int_least8_t int8_t
00212 #define uint_least8_t uint8_t
00213 #define int_least16_t int16_t
00214 #define uint_least16_t uint16_t
00215 #define int_least32_t int32_t
00216 #define uint_least32_t uint32_t
00217 #ifdef GL_INT64_T
00218 # define int_least64_t int64_t
00219 #endif
00220 #ifdef GL_UINT64_T
00221 # define uint_least64_t uint64_t
00222 #endif
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234 #undef int_fast8_t
00235 #undef uint_fast8_t
00236 #undef int_fast16_t
00237 #undef uint_fast16_t
00238 #undef int_fast32_t
00239 #undef uint_fast32_t
00240 #undef int_fast64_t
00241 #undef uint_fast64_t
00242 typedef long int gl_int_fast8_t;
00243 typedef unsigned long int gl_uint_fast8_t;
00244 typedef long int gl_int_fast16_t;
00245 typedef unsigned long int gl_uint_fast16_t;
00246 typedef long int gl_int_fast32_t;
00247 typedef unsigned long int gl_uint_fast32_t;
00248 #define int_fast8_t gl_int_fast8_t
00249 #define uint_fast8_t gl_uint_fast8_t
00250 #define int_fast16_t gl_int_fast16_t
00251 #define uint_fast16_t gl_uint_fast16_t
00252 #define int_fast32_t gl_int_fast32_t
00253 #define uint_fast32_t gl_uint_fast32_t
00254 #ifdef GL_INT64_T
00255 # define int_fast64_t int64_t
00256 #endif
00257 #ifdef GL_UINT64_T
00258 # define uint_fast64_t uint64_t
00259 #endif
00260
00261
00262
00263 #undef intptr_t
00264 #undef uintptr_t
00265 typedef long int gl_intptr_t;
00266 typedef unsigned long int gl_uintptr_t;
00267 #define intptr_t gl_intptr_t
00268 #define uintptr_t gl_uintptr_t
00269
00270
00271
00272
00273
00274
00275 #undef intmax_t
00276 #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
00277 typedef long long int gl_intmax_t;
00278 # define intmax_t gl_intmax_t
00279 #elif defined GL_INT64_T
00280 # define intmax_t int64_t
00281 #else
00282 typedef long int gl_intmax_t;
00283 # define intmax_t gl_intmax_t
00284 #endif
00285
00286 #undef uintmax_t
00287 #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
00288 typedef unsigned long long int gl_uintmax_t;
00289 # define uintmax_t gl_uintmax_t
00290 #elif defined GL_UINT64_T
00291 # define uintmax_t uint64_t
00292 #else
00293 typedef unsigned long int gl_uintmax_t;
00294 # define uintmax_t gl_uintmax_t
00295 #endif
00296
00297
00298
00299
00300 typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
00301 ? 1 : -1];
00302
00303 #define GNULIB_defined_stdint_types 1
00304 #endif
00305
00306
00307
00308 #if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
00309
00310
00311
00312
00313
00314
00315 #undef INT8_MIN
00316 #undef INT8_MAX
00317 #undef UINT8_MAX
00318 #define INT8_MIN (~ INT8_MAX)
00319 #define INT8_MAX 127
00320 #define UINT8_MAX 255
00321
00322 #undef INT16_MIN
00323 #undef INT16_MAX
00324 #undef UINT16_MAX
00325 #define INT16_MIN (~ INT16_MAX)
00326 #define INT16_MAX 32767
00327 #define UINT16_MAX 65535
00328
00329 #undef INT32_MIN
00330 #undef INT32_MAX
00331 #undef UINT32_MAX
00332 #define INT32_MIN (~ INT32_MAX)
00333 #define INT32_MAX 2147483647
00334 #define UINT32_MAX 4294967295U
00335
00336 #if defined GL_INT64_T && ! defined INT64_MAX
00337
00338
00339 # define INT64_MIN (- INTMAX_C (1) << 63)
00340 # define INT64_MAX INTMAX_C (9223372036854775807)
00341 #endif
00342
00343 #if defined GL_UINT64_T && ! defined UINT64_MAX
00344 # define UINT64_MAX UINTMAX_C (18446744073709551615)
00345 #endif
00346
00347
00348
00349
00350
00351
00352
00353 #undef INT_LEAST8_MIN
00354 #undef INT_LEAST8_MAX
00355 #undef UINT_LEAST8_MAX
00356 #define INT_LEAST8_MIN INT8_MIN
00357 #define INT_LEAST8_MAX INT8_MAX
00358 #define UINT_LEAST8_MAX UINT8_MAX
00359
00360 #undef INT_LEAST16_MIN
00361 #undef INT_LEAST16_MAX
00362 #undef UINT_LEAST16_MAX
00363 #define INT_LEAST16_MIN INT16_MIN
00364 #define INT_LEAST16_MAX INT16_MAX
00365 #define UINT_LEAST16_MAX UINT16_MAX
00366
00367 #undef INT_LEAST32_MIN
00368 #undef INT_LEAST32_MAX
00369 #undef UINT_LEAST32_MAX
00370 #define INT_LEAST32_MIN INT32_MIN
00371 #define INT_LEAST32_MAX INT32_MAX
00372 #define UINT_LEAST32_MAX UINT32_MAX
00373
00374 #undef INT_LEAST64_MIN
00375 #undef INT_LEAST64_MAX
00376 #ifdef GL_INT64_T
00377 # define INT_LEAST64_MIN INT64_MIN
00378 # define INT_LEAST64_MAX INT64_MAX
00379 #endif
00380
00381 #undef UINT_LEAST64_MAX
00382 #ifdef GL_UINT64_T
00383 # define UINT_LEAST64_MAX UINT64_MAX
00384 #endif
00385
00386
00387
00388
00389
00390
00391
00392 #undef INT_FAST8_MIN
00393 #undef INT_FAST8_MAX
00394 #undef UINT_FAST8_MAX
00395 #define INT_FAST8_MIN LONG_MIN
00396 #define INT_FAST8_MAX LONG_MAX
00397 #define UINT_FAST8_MAX ULONG_MAX
00398
00399 #undef INT_FAST16_MIN
00400 #undef INT_FAST16_MAX
00401 #undef UINT_FAST16_MAX
00402 #define INT_FAST16_MIN LONG_MIN
00403 #define INT_FAST16_MAX LONG_MAX
00404 #define UINT_FAST16_MAX ULONG_MAX
00405
00406 #undef INT_FAST32_MIN
00407 #undef INT_FAST32_MAX
00408 #undef UINT_FAST32_MAX
00409 #define INT_FAST32_MIN LONG_MIN
00410 #define INT_FAST32_MAX LONG_MAX
00411 #define UINT_FAST32_MAX ULONG_MAX
00412
00413 #undef INT_FAST64_MIN
00414 #undef INT_FAST64_MAX
00415 #ifdef GL_INT64_T
00416 # define INT_FAST64_MIN INT64_MIN
00417 # define INT_FAST64_MAX INT64_MAX
00418 #endif
00419
00420 #undef UINT_FAST64_MAX
00421 #ifdef GL_UINT64_T
00422 # define UINT_FAST64_MAX UINT64_MAX
00423 #endif
00424
00425
00426
00427 #undef INTPTR_MIN
00428 #undef INTPTR_MAX
00429 #undef UINTPTR_MAX
00430 #define INTPTR_MIN LONG_MIN
00431 #define INTPTR_MAX LONG_MAX
00432 #define UINTPTR_MAX ULONG_MAX
00433
00434
00435
00436 #undef INTMAX_MIN
00437 #undef INTMAX_MAX
00438 #ifdef INT64_MAX
00439 # define INTMAX_MIN INT64_MIN
00440 # define INTMAX_MAX INT64_MAX
00441 #else
00442 # define INTMAX_MIN INT32_MIN
00443 # define INTMAX_MAX INT32_MAX
00444 #endif
00445
00446 #undef UINTMAX_MAX
00447 #ifdef UINT64_MAX
00448 # define UINTMAX_MAX UINT64_MAX
00449 #else
00450 # define UINTMAX_MAX UINT32_MAX
00451 #endif
00452
00453
00454
00455
00456 #undef PTRDIFF_MIN
00457 #undef PTRDIFF_MAX
00458 #if @APPLE_UNIVERSAL_BUILD@
00459 # ifdef _LP64
00460 # define PTRDIFF_MIN _STDINT_MIN (1, 64, 0l)
00461 # define PTRDIFF_MAX _STDINT_MAX (1, 64, 0l)
00462 # else
00463 # define PTRDIFF_MIN _STDINT_MIN (1, 32, 0)
00464 # define PTRDIFF_MAX _STDINT_MAX (1, 32, 0)
00465 # endif
00466 #else
00467 # define PTRDIFF_MIN \
00468 _STDINT_MIN (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
00469 # define PTRDIFF_MAX \
00470 _STDINT_MAX (1, @BITSIZEOF_PTRDIFF_T@, 0@PTRDIFF_T_SUFFIX@)
00471 #endif
00472
00473
00474 #undef SIG_ATOMIC_MIN
00475 #undef SIG_ATOMIC_MAX
00476 #define SIG_ATOMIC_MIN \
00477 _STDINT_MIN (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
00478 0@SIG_ATOMIC_T_SUFFIX@)
00479 #define SIG_ATOMIC_MAX \
00480 _STDINT_MAX (@HAVE_SIGNED_SIG_ATOMIC_T@, @BITSIZEOF_SIG_ATOMIC_T@, \
00481 0@SIG_ATOMIC_T_SUFFIX@)
00482
00483
00484
00485 #undef SIZE_MAX
00486 #if @APPLE_UNIVERSAL_BUILD@
00487 # ifdef _LP64
00488 # define SIZE_MAX _STDINT_MAX (0, 64, 0ul)
00489 # else
00490 # define SIZE_MAX _STDINT_MAX (0, 32, 0ul)
00491 # endif
00492 #else
00493 # define SIZE_MAX _STDINT_MAX (0, @BITSIZEOF_SIZE_T@, 0@SIZE_T_SUFFIX@)
00494 #endif
00495
00496
00497
00498
00499
00500
00501
00502 #if ! (defined WCHAR_MIN && defined WCHAR_MAX)
00503 # define _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
00504 # include <wchar.h>
00505 # undef _GL_JUST_INCLUDE_SYSTEM_WCHAR_H
00506 #endif
00507 #undef WCHAR_MIN
00508 #undef WCHAR_MAX
00509 #define WCHAR_MIN \
00510 _STDINT_MIN (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
00511 #define WCHAR_MAX \
00512 _STDINT_MAX (@HAVE_SIGNED_WCHAR_T@, @BITSIZEOF_WCHAR_T@, 0@WCHAR_T_SUFFIX@)
00513
00514
00515 #undef WINT_MIN
00516 #undef WINT_MAX
00517 #define WINT_MIN \
00518 _STDINT_MIN (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
00519 #define WINT_MAX \
00520 _STDINT_MAX (@HAVE_SIGNED_WINT_T@, @BITSIZEOF_WINT_T@, 0@WINT_T_SUFFIX@)
00521
00522 #endif
00523
00524
00525
00526 #if ! defined __cplusplus || defined __STDC_CONSTANT_MACROS
00527
00528
00529
00530
00531
00532
00533
00534 #undef INT8_C
00535 #undef UINT8_C
00536 #define INT8_C(x) x
00537 #define UINT8_C(x) x
00538
00539 #undef INT16_C
00540 #undef UINT16_C
00541 #define INT16_C(x) x
00542 #define UINT16_C(x) x
00543
00544 #undef INT32_C
00545 #undef UINT32_C
00546 #define INT32_C(x) x
00547 #define UINT32_C(x) x ## U
00548
00549 #undef INT64_C
00550 #undef UINT64_C
00551 #if LONG_MAX >> 31 >> 31 == 1
00552 # define INT64_C(x) x##L
00553 #elif defined _MSC_VER
00554 # define INT64_C(x) x##i64
00555 #elif @HAVE_LONG_LONG_INT@
00556 # define INT64_C(x) x##LL
00557 #endif
00558 #if ULONG_MAX >> 31 >> 31 >> 1 == 1
00559 # define UINT64_C(x) x##UL
00560 #elif defined _MSC_VER
00561 # define UINT64_C(x) x##ui64
00562 #elif @HAVE_UNSIGNED_LONG_LONG_INT@
00563 # define UINT64_C(x) x##ULL
00564 #endif
00565
00566
00567
00568 #undef INTMAX_C
00569 #if @HAVE_LONG_LONG_INT@ && LONG_MAX >> 30 == 1
00570 # define INTMAX_C(x) x##LL
00571 #elif defined GL_INT64_T
00572 # define INTMAX_C(x) INT64_C(x)
00573 #else
00574 # define INTMAX_C(x) x##L
00575 #endif
00576
00577 #undef UINTMAX_C
00578 #if @HAVE_UNSIGNED_LONG_LONG_INT@ && ULONG_MAX >> 31 == 1
00579 # define UINTMAX_C(x) x##ULL
00580 #elif defined GL_UINT64_T
00581 # define UINTMAX_C(x) UINT64_C(x)
00582 #else
00583 # define UINTMAX_C(x) x##UL
00584 #endif
00585
00586 #endif
00587
00588 #endif
00589 #endif