Commit a5e91ec3d6630074b91f35583107592c3056deb3
- Diff rendering mode:
- inline
- side by side
stlport/stdint.h
(33 / 0)
|   | |||
| 1 | /* | ||
| 2 | * Copyright (c) 2009 | ||
| 3 | * Petr Ovtchenkov | ||
| 4 | * | ||
| 5 | * Licensed under the Academic Free License version 3.0 | ||
| 6 | * | ||
| 7 | */ | ||
| 8 | |||
| 9 | #ifndef _STLP_OUTERMOST_HEADER_ID | ||
| 10 | # define _STLP_OUTERMOST_HEADER_ID 0x263 | ||
| 11 | # include <stl/_cprolog.h> | ||
| 12 | #elif (_STLP_OUTERMOST_HEADER_ID == 0x263) && !defined(_STLP_DONT_POP_HEADER_ID) | ||
| 13 | # define _STLP_DONT_POP_HEADER_ID | ||
| 14 | #endif | ||
| 15 | |||
| 16 | #ifdef _MSC_VER | ||
| 17 | # include "stl/msc_stdint.h" | ||
| 18 | #else /* _MSC_VER */ | ||
| 19 | # ifdef _STLP_HAS_INCLUDE_NEXT | ||
| 20 | # include_next <stdint.h> | ||
| 21 | # else | ||
| 22 | # include _STLP_NATIVE_C_HEADER(stdint.h) | ||
| 23 | # endif | ||
| 24 | #endif /* _MSC_VER */ | ||
| 25 | |||
| 26 | #if (_STLP_OUTERMOST_HEADER_ID == 0x263) | ||
| 27 | # ifndef _STLP_DONT_POP_HEADER_ID | ||
| 28 | # include <stl/_epilog.h> | ||
| 29 | # undef _STLP_OUTERMOST_HEADER_ID | ||
| 30 | # else | ||
| 31 | # undef _STLP_DONT_POP_HEADER_ID | ||
| 32 | # endif | ||
| 33 | #endif |
stlport/stl/_alloc.c
(1 / 1)
|   | |||
| 46 | 46 | memset((char*)__result, __shred_byte, __real_n * sizeof(value_type)); | |
| 47 | 47 | __result->__magic = __magic; | |
| 48 | 48 | __result->__type_size = sizeof(value_type); | |
| 49 | __result->_M_size = (_STLP_UINT32_T)__n; | ||
| 49 | __result->_M_size = (uint32_t)__n; | ||
| 50 | 50 | return ((char*)__result) + (long)__extra_before; | |
| 51 | 51 | } | |
| 52 | 52 |
stlport/stl/_alloc.h
(5 / 3)
|   | |||
| 27 | 27 | #ifndef _STLP_INTERNAL_ALLOC_H | |
| 28 | 28 | #define _STLP_INTERNAL_ALLOC_H | |
| 29 | 29 | ||
| 30 | #include <stdint.h> | ||
| 31 | |||
| 30 | 32 | #ifndef _STLP_INTERNAL_CSTDDEF | |
| 31 | 33 | # include <stl/_cstddef.h> | |
| 32 | 34 | #endif | |
| … | … | ||
| 304 | 304 | private: | |
| 305 | 305 | struct __alloc_header | |
| 306 | 306 | { | |
| 307 | size_t __magic: 16; | ||
| 308 | size_t __type_size:16; | ||
| 309 | _STLP_UINT32_T _M_size; | ||
| 307 | uint32_t __magic:16; | ||
| 308 | uint32_t __type_size:16; | ||
| 309 | uint32_t _M_size; | ||
| 310 | 310 | }; // that is 8 bytes for sure | |
| 311 | 311 | ||
| 312 | 312 | // Sunpro CC has bug on enums, so extra_before/after set explicitly |
stlport/stl/_function.h
(39 / 30)
|   | |||
| 30 | 30 | #ifndef _STLP_INTERNAL_FUNCTION_H | |
| 31 | 31 | #define _STLP_INTERNAL_FUNCTION_H | |
| 32 | 32 | ||
| 33 | #include <stdint.h> | ||
| 34 | |||
| 33 | 35 | #ifndef _STLP_INTERNAL_FUNCTION_BASE_H | |
| 34 | 36 | # include <stl/_function_base.h> | |
| 35 | 37 | #endif | |
| … | … | ||
| 356 | 356 | ||
| 357 | 357 | // subtractive_rng is an extension: it is not part of the standard. | |
| 358 | 358 | // Note: this code assumes that int is 32 bits. | |
| 359 | class subtractive_rng : public unary_function<_STLP_UINT32_T, _STLP_UINT32_T> { | ||
| 360 | private: | ||
| 361 | _STLP_UINT32_T _M_table[55]; | ||
| 362 | _STLP_UINT32_T _M_index1; | ||
| 363 | _STLP_UINT32_T _M_index2; | ||
| 364 | public: | ||
| 365 | _STLP_UINT32_T operator()(_STLP_UINT32_T __limit) { | ||
| 366 | _M_index1 = (_M_index1 + 1) % 55; | ||
| 367 | _M_index2 = (_M_index2 + 1) % 55; | ||
| 368 | _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2]; | ||
| 369 | return _M_table[_M_index1] % __limit; | ||
| 370 | } | ||
| 359 | class subtractive_rng : | ||
| 360 | public unary_function<uint32_t,uint32_t> | ||
| 361 | { | ||
| 362 | private: | ||
| 363 | uint32_t _M_table[55]; | ||
| 364 | int _M_index1; | ||
| 365 | int _M_index2; | ||
| 366 | public: | ||
| 367 | uint32_t operator()( uint32_t __limit ) | ||
| 368 | { | ||
| 369 | _M_index1 = (_M_index1 + 1) % 55; | ||
| 370 | _M_index2 = (_M_index2 + 1) % 55; | ||
| 371 | _M_table[_M_index1] = _M_table[_M_index1] - _M_table[_M_index2]; | ||
| 372 | return _M_table[_M_index1] % __limit; | ||
| 373 | } | ||
| 371 | 374 | ||
| 372 | void _M_initialize(_STLP_UINT32_T __seed) { | ||
| 373 | _STLP_UINT32_T __k = 1; | ||
| 374 | _M_table[54] = __seed; | ||
| 375 | _STLP_UINT32_T __i; | ||
| 376 | for (__i = 0; __i < 54; __i++) { | ||
| 377 | _STLP_UINT32_T __ii = (21 * (__i + 1) % 55) - 1; | ||
| 378 | _M_table[__ii] = __k; | ||
| 379 | __k = __seed - __k; | ||
| 380 | __seed = _M_table[__ii]; | ||
| 381 | } | ||
| 382 | for (int __loop = 0; __loop < 4; __loop++) { | ||
| 383 | for (__i = 0; __i < 55; __i++) | ||
| 375 | void _M_initialize( uint32_t __seed ) | ||
| 376 | { | ||
| 377 | uint32_t __k = 1; | ||
| 378 | _M_table[54] = __seed; | ||
| 379 | int __ii; | ||
| 380 | for ( int __i = 0; __i < 54; ++__i ) { | ||
| 381 | __ii = (21 * (__i + 1) % 55) - 1; | ||
| 382 | _M_table[__ii] = __k; | ||
| 383 | __k = __seed - __k; | ||
| 384 | __seed = _M_table[__ii]; | ||
| 385 | } | ||
| 386 | for ( int __loop = 0; __loop < 4; ++__loop ) { | ||
| 387 | for ( int __i = 0; __i < 55; ++__i ) { | ||
| 384 | 388 | _M_table[__i] = _M_table[__i] - _M_table[(1 + __i + 30) % 55]; | |
| 385 | } | ||
| 386 | _M_index1 = 0; | ||
| 387 | _M_index2 = 31; | ||
| 388 | } | ||
| 389 | } | ||
| 390 | } | ||
| 391 | _M_index1 = 0; | ||
| 392 | _M_index2 = 31; | ||
| 393 | } | ||
| 389 | 394 | ||
| 390 | subtractive_rng(unsigned int __seed) { _M_initialize(__seed); } | ||
| 391 | subtractive_rng() { _M_initialize(161803398ul); } | ||
| 395 | subtractive_rng( unsigned int __seed ) | ||
| 396 | { _M_initialize(__seed); } | ||
| 397 | subtractive_rng() | ||
| 398 | { _M_initialize( 161803398UL ); } | ||
| 392 | 399 | }; | |
| 393 | 400 | ||
| 394 | 401 | #endif /* _STLP_NO_EXTENSIONS */ |
stlport/stl/config/_apple.h
(0 / 1)
|   | |||
| 34 | 34 | # include <Types.h> | |
| 35 | 35 | #endif | |
| 36 | 36 | ||
| 37 | #define _STLP_UINT32_T UInt32 | ||
| 38 | 37 | typedef int wint_t; | |
| 39 | 38 | ||
| 40 | 39 | #ifndef TYPE_BOOL |
stlport/stl/config/_como.h
(0 / 2)
|   | |||
| 6 | 6 | ||
| 7 | 7 | #include <stl/config/_native_headers.h> | |
| 8 | 8 | ||
| 9 | #define _STLP_UINT32_T unsigned int | ||
| 10 | |||
| 11 | 9 | #define _STLP_HAS_NO_NEW_C_HEADERS | |
| 12 | 10 | // #define _STLP_VENDOR_GLOBAL_EXCEPT_STD | |
| 13 | 11 | #define _STLP_LONG_LONG long long |
stlport/stl/config/_cray.h
(0 / 4)
|   | |||
| 18 | 18 | ||
| 19 | 19 | #define _STLP_COMPILER "CC" | |
| 20 | 20 | ||
| 21 | // Mostly correct guess, change it for Alpha (and other environments | ||
| 22 | // that has 64-bit "long") | ||
| 23 | # define _STLP_UINT32_T unsigned long | ||
| 24 | |||
| 25 | 21 | // Uncomment if long long is available | |
| 26 | 22 | # define _STLP_LONG_LONG long long | |
| 27 | 23 |
stlport/stl/config/_dec.h
(0 / 2)
|   | |||
| 95 | 95 | # define _STLP_LONG_LONG long long | |
| 96 | 96 | # endif | |
| 97 | 97 | ||
| 98 | /* unsigned 32-bit integer type */ | ||
| 99 | # define _STLP_UINT32_T unsigned int | ||
| 100 | 98 | #if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4) | |
| 101 | 99 | # define _STLP_RAND48 1 | |
| 102 | 100 | #endif |
|   | |||
| 76 | 76 | # define _STLP_LONG_LONG long long | |
| 77 | 77 | # endif | |
| 78 | 78 | ||
| 79 | // unsigned 32-bit integer type | ||
| 80 | # define _STLP_UINT32_T unsigned int | ||
| 81 | 79 | #if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4) | |
| 82 | 80 | # define _STLP_RAND48 1 | |
| 83 | 81 | #endif |
|   | |||
| 2 | 2 | #define _STLP_COMPILER "Fujitsu" | |
| 3 | 3 | ||
| 4 | 4 | #define _STLP_NATIVE_INCLUDE_PATH ../std | |
| 5 | #define _STLP_UINT32_T unsigned int | ||
| 6 | 5 | #define _STLP_LONG_LONG long long | |
| 7 | 6 | #define _STLP_WCHAR_SUNPRO_EXCLUDE 1 |
stlport/stl/config/_ibm.h
(0 / 2)
|   | |||
| 135 | 135 | # define _STLP_USE_EXCEPTIONS 1 | |
| 136 | 136 | # define _STLP_STATIC_CONST_INIT_BUG 1 | |
| 137 | 137 | /* #pragma report(disable,CPPC1500029) | |
| 138 | * unsigned 32-bit integer type | ||
| 139 | 138 | */ | |
| 140 | # define _STLP_UINT32_T unsigned int | ||
| 141 | 139 | # if defined(_XOPEN_SOURCE) && (_XOPEN_VERSION - 0 >= 4) | |
| 142 | 140 | # define _STLP_RAND48 1 | |
| 143 | 141 | # endif |
|   | |||
| 168 | 168 | * final workaround tuning based on given flags | |
| 169 | 169 | * ========================================================== */ | |
| 170 | 170 | ||
| 171 | #ifndef _STLP_UINT32_T | ||
| 172 | # define _STLP_UINT32_T unsigned long | ||
| 173 | #endif | ||
| 174 | 171 | #ifndef _STLP_ABORT | |
| 175 | 172 | # define _STLP_ABORT() abort() | |
| 176 | 173 | #endif |
|   | |||
| 37 | 37 | // the values choosen here as defaults try to give | |
| 38 | 38 | // maximum functionality on the most conservative settings | |
| 39 | 39 | ||
| 40 | // Mostly correct guess, change it for Alpha (and other environments | ||
| 41 | // that has 64-bit "long") | ||
| 42 | // # define _STLP_UINT32_T unsigned long | ||
| 43 | |||
| 44 | 40 | // Disables wchar_t functionality | |
| 45 | 41 | // # define _STLP_NO_WCHAR_T 1 | |
| 46 | 42 |
stlport/stl/msc_stdint.h
(269 / 0)
|   | |||
| 1 | /* | ||
| 2 | * Derived from: http://code.google.com/p/msinttypes/ | ||
| 3 | * | ||
| 4 | * ISO C9x compliant stdint.h for Microsoft Visual Studio | ||
| 5 | * Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 | ||
| 6 | * | ||
| 7 | * Copyright (c) 2006-2008 Alexander Chemeris | ||
| 8 | * | ||
| 9 | * Redistribution and use in source and binary forms, with or without | ||
| 10 | * modification, are permitted provided that the following conditions are met: | ||
| 11 | * | ||
| 12 | * 1. Redistributions of source code must retain the above copyright notice, | ||
| 13 | * this list of conditions and the following disclaimer. | ||
| 14 | * | ||
| 15 | * 2. Redistributions in binary form must reproduce the above copyright | ||
| 16 | * notice, this list of conditions and the following disclaimer in the | ||
| 17 | * documentation and/or other materials provided with the distribution. | ||
| 18 | * | ||
| 19 | * 3. The name of the author may be used to endorse or promote products | ||
| 20 | * derived from this software without specific prior written permission. | ||
| 21 | * | ||
| 22 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
| 23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
| 24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO | ||
| 25 | * EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
| 26 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
| 27 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | ||
| 28 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | ||
| 29 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | ||
| 30 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | ||
| 31 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
| 32 | * | ||
| 33 | */ | ||
| 34 | |||
| 35 | /* Don't include <stl/msc_stdint.h> (this file) directly! */ | ||
| 36 | |||
| 37 | #ifndef _MSC_VER | ||
| 38 | #error "Use this header only with Microsoft Visual C++ compilers!" | ||
| 39 | #endif | ||
| 40 | |||
| 41 | /* | ||
| 42 | #ifndef _MSC_STDINT_H_ | ||
| 43 | #define _MSC_STDINT_H_ | ||
| 44 | */ | ||
| 45 | |||
| 46 | #if _MSC_VER > 1000 | ||
| 47 | #pragma once | ||
| 48 | #endif | ||
| 49 | |||
| 50 | #include <limits.h> | ||
| 51 | |||
| 52 | /* | ||
| 53 | For Visual Studio 6 in C++ mode and for many Visual Studio versions when | ||
| 54 | compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' | ||
| 55 | or compiler give many errors like this: | ||
| 56 | error C2733: second C linkage of overloaded function 'wmemchr' not allowed | ||
| 57 | */ | ||
| 58 | #ifdef __cplusplus | ||
| 59 | extern "C" { | ||
| 60 | #endif | ||
| 61 | # include <wchar.h> | ||
| 62 | #ifdef __cplusplus | ||
| 63 | } | ||
| 64 | #endif | ||
| 65 | |||
| 66 | /* Define _W64 macros to mark types changing their size, like intptr_t. */ | ||
| 67 | |||
| 68 | #ifndef _W64 | ||
| 69 | # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 | ||
| 70 | # define _W64 __w64 | ||
| 71 | # else | ||
| 72 | # define _W64 | ||
| 73 | # endif | ||
| 74 | #endif | ||
| 75 | |||
| 76 | |||
| 77 | /* 7.18.1 Integer types */ | ||
| 78 | |||
| 79 | /* 7.18.1.1 Exact-width integer types */ | ||
| 80 | |||
| 81 | /* | ||
| 82 | Visual Studio 6 and Embedded Visual C++ 4 doesn't | ||
| 83 | realize that, e.g. char has the same size as __int8 | ||
| 84 | so we give up on __intX for them. | ||
| 85 | */ | ||
| 86 | |||
| 87 | #if (_MSC_VER < 1300) | ||
| 88 | typedef char int8_t; | ||
| 89 | typedef short int16_t; | ||
| 90 | typedef int int32_t; | ||
| 91 | typedef unsigned char uint8_t; | ||
| 92 | typedef unsigned short uint16_t; | ||
| 93 | typedef unsigned int uint32_t; | ||
| 94 | #else | ||
| 95 | typedef __int8 int8_t; | ||
| 96 | typedef __int16 int16_t; | ||
| 97 | typedef __int32 int32_t; | ||
| 98 | typedef unsigned __int8 uint8_t; | ||
| 99 | typedef unsigned __int16 uint16_t; | ||
| 100 | typedef unsigned __int32 uint32_t; | ||
| 101 | #endif | ||
| 102 | typedef __int64 int64_t; | ||
| 103 | typedef unsigned __int64 uint64_t; | ||
| 104 | |||
| 105 | |||
| 106 | /* 7.18.1.2 Minimum-width integer types */ | ||
| 107 | |||
| 108 | typedef int8_t int_least8_t; | ||
| 109 | typedef int16_t int_least16_t; | ||
| 110 | typedef int32_t int_least32_t; | ||
| 111 | typedef int64_t int_least64_t; | ||
| 112 | typedef uint8_t uint_least8_t; | ||
| 113 | typedef uint16_t uint_least16_t; | ||
| 114 | typedef uint32_t uint_least32_t; | ||
| 115 | typedef uint64_t uint_least64_t; | ||
| 116 | |||
| 117 | /* 7.18.1.3 Fastest minimum-width integer types */ | ||
| 118 | |||
| 119 | typedef int8_t int_fast8_t; | ||
| 120 | typedef int16_t int_fast16_t; | ||
| 121 | typedef int32_t int_fast32_t; | ||
| 122 | typedef int64_t int_fast64_t; | ||
| 123 | typedef uint8_t uint_fast8_t; | ||
| 124 | typedef uint16_t uint_fast16_t; | ||
| 125 | typedef uint32_t uint_fast32_t; | ||
| 126 | typedef uint64_t uint_fast64_t; | ||
| 127 | |||
| 128 | /* 7.18.1.4 Integer types capable of holding object pointers */ | ||
| 129 | |||
| 130 | #ifdef _WIN64 | ||
| 131 | typedef __int64 intptr_t; | ||
| 132 | typedef unsigned __int64 uintptr_t; | ||
| 133 | #else | ||
| 134 | typedef _W64 int intptr_t; | ||
| 135 | typedef _W64 unsigned int uintptr_t; | ||
| 136 | #endif | ||
| 137 | |||
| 138 | /* 7.18.1.5 Greatest-width integer types */ | ||
| 139 | |||
| 140 | typedef int64_t intmax_t; | ||
| 141 | typedef uint64_t uintmax_t; | ||
| 142 | |||
| 143 | |||
| 144 | /* 7.18.2 Limits of specified-width integer types */ | ||
| 145 | |||
| 146 | #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) /* See footnote 220 at page 257 and footnote 221 at page 259 */ | ||
| 147 | |||
| 148 | /* 7.18.2.1 Limits of exact-width integer types */ | ||
| 149 | |||
| 150 | #define INT8_MIN ((int8_t)_I8_MIN) | ||
| 151 | #define INT8_MAX _I8_MAX | ||
| 152 | #define INT16_MIN ((int16_t)_I16_MIN) | ||
| 153 | #define INT16_MAX _I16_MAX | ||
| 154 | #define INT32_MIN ((int32_t)_I32_MIN) | ||
| 155 | #define INT32_MAX _I32_MAX | ||
| 156 | #define INT64_MIN ((int64_t)_I64_MIN) | ||
| 157 | #define INT64_MAX _I64_MAX | ||
| 158 | #define UINT8_MAX _UI8_MAX | ||
| 159 | #define UINT16_MAX _UI16_MAX | ||
| 160 | #define UINT32_MAX _UI32_MAX | ||
| 161 | #define UINT64_MAX _UI64_MAX | ||
| 162 | |||
| 163 | /* 7.18.2.2 Limits of minimum-width integer types */ | ||
| 164 | |||
| 165 | #define INT_LEAST8_MIN INT8_MIN | ||
| 166 | #define INT_LEAST8_MAX INT8_MAX | ||
| 167 | #define INT_LEAST16_MIN INT16_MIN | ||
| 168 | #define INT_LEAST16_MAX INT16_MAX | ||
| 169 | #define INT_LEAST32_MIN INT32_MIN | ||
| 170 | #define INT_LEAST32_MAX INT32_MAX | ||
| 171 | #define INT_LEAST64_MIN INT64_MIN | ||
| 172 | #define INT_LEAST64_MAX INT64_MAX | ||
| 173 | #define UINT_LEAST8_MAX UINT8_MAX | ||
| 174 | #define UINT_LEAST16_MAX UINT16_MAX | ||
| 175 | #define UINT_LEAST32_MAX UINT32_MAX | ||
| 176 | #define UINT_LEAST64_MAX UINT64_MAX | ||
| 177 | |||
| 178 | /* 7.18.2.3 Limits of fastest minimum-width integer types */ | ||
| 179 | |||
| 180 | #define INT_FAST8_MIN INT8_MIN | ||
| 181 | #define INT_FAST8_MAX INT8_MAX | ||
| 182 | #define INT_FAST16_MIN INT16_MIN | ||
| 183 | #define INT_FAST16_MAX INT16_MAX | ||
| 184 | #define INT_FAST32_MIN INT32_MIN | ||
| 185 | #define INT_FAST32_MAX INT32_MAX | ||
| 186 | #define INT_FAST64_MIN INT64_MIN | ||
| 187 | #define INT_FAST64_MAX INT64_MAX | ||
| 188 | #define UINT_FAST8_MAX UINT8_MAX | ||
| 189 | #define UINT_FAST16_MAX UINT16_MAX | ||
| 190 | #define UINT_FAST32_MAX UINT32_MAX | ||
| 191 | #define UINT_FAST64_MAX UINT64_MAX | ||
| 192 | |||
| 193 | /* 7.18.2.4 Limits of integer types capable of holding object pointers */ | ||
| 194 | |||
| 195 | #ifdef _WIN64 | ||
| 196 | # define INTPTR_MIN INT64_MIN | ||
| 197 | # define INTPTR_MAX INT64_MAX | ||
| 198 | # define UINTPTR_MAX UINT64_MAX | ||
| 199 | #else | ||
| 200 | # define INTPTR_MIN INT32_MIN | ||
| 201 | # define INTPTR_MAX INT32_MAX | ||
| 202 | # define UINTPTR_MAX UINT32_MAX | ||
| 203 | #endif | ||
| 204 | |||
| 205 | /* 7.18.2.5 Limits of greatest-width integer types */ | ||
| 206 | |||
| 207 | #define INTMAX_MIN INT64_MIN | ||
| 208 | #define INTMAX_MAX INT64_MAX | ||
| 209 | #define UINTMAX_MAX UINT64_MAX | ||
| 210 | |||
| 211 | /* 7.18.3 Limits of other integer types */ | ||
| 212 | |||
| 213 | #ifdef _WIN64 | ||
| 214 | # define PTRDIFF_MIN _I64_MIN | ||
| 215 | # define PTRDIFF_MAX _I64_MAX | ||
| 216 | #else | ||
| 217 | # define PTRDIFF_MIN _I32_MIN | ||
| 218 | # define PTRDIFF_MAX _I32_MAX | ||
| 219 | #endif | ||
| 220 | |||
| 221 | #define SIG_ATOMIC_MIN INT_MIN | ||
| 222 | #define SIG_ATOMIC_MAX INT_MAX | ||
| 223 | |||
| 224 | #ifndef SIZE_MAX | ||
| 225 | # ifdef _WIN64 | ||
| 226 | # define SIZE_MAX _UI64_MAX | ||
| 227 | # else | ||
| 228 | # define SIZE_MAX _UI32_MAX | ||
| 229 | # endif | ||
| 230 | #endif | ||
| 231 | |||
| 232 | /* WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> */ | ||
| 233 | #ifndef WCHAR_MIN | ||
| 234 | # define WCHAR_MIN 0 | ||
| 235 | #endif | ||
| 236 | #ifndef WCHAR_MAX | ||
| 237 | # define WCHAR_MAX _UI16_MAX | ||
| 238 | #endif | ||
| 239 | |||
| 240 | #define WINT_MIN 0 | ||
| 241 | #define WINT_MAX _UI16_MAX | ||
| 242 | |||
| 243 | #endif /* __STDC_LIMIT_MACROS */ | ||
| 244 | |||
| 245 | |||
| 246 | /* 7.18.4 Limits of other integer types */ | ||
| 247 | |||
| 248 | #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) /* See footnote 224 at page 260 */ | ||
| 249 | |||
| 250 | /* 7.18.4.1 Macros for minimum-width integer constants */ | ||
| 251 | |||
| 252 | #define INT8_C(val) val##i8 | ||
| 253 | #define INT16_C(val) val##i16 | ||
| 254 | #define INT32_C(val) val##i32 | ||
| 255 | #define INT64_C(val) val##i64 | ||
| 256 | |||
| 257 | #define UINT8_C(val) val##ui8 | ||
| 258 | #define UINT16_C(val) val##ui16 | ||
| 259 | #define UINT32_C(val) val##ui32 | ||
| 260 | #define UINT64_C(val) val##ui64 | ||
| 261 | |||
| 262 | /* 7.18.4.2 Macros for greatest-width integer constants */ | ||
| 263 | #define INTMAX_C INT64_C | ||
| 264 | #define UINTMAX_C UINT64_C | ||
| 265 | |||
| 266 | #endif /* __STDC_CONSTANT_MACROS */ | ||
| 267 | |||
| 268 | |||
| 269 | /* #endif */ /* _MSC_STDINT_H_ */ |

