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