Thu, 28 Feb 2013 08:17:26 +0100
added headers that are missing under visual studio
msc/inttypes.h | file | annotate | diff | comparison | revisions | |
msc/stdint.h | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/msc/inttypes.h Thu Feb 28 08:17:26 2013 +0100 1.3 @@ -0,0 +1,305 @@ 1.4 +// ISO C9x compliant inttypes.h for Microsoft Visual Studio 1.5 +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 1.6 +// 1.7 +// Copyright (c) 2006 Alexander Chemeris 1.8 +// 1.9 +// Redistribution and use in source and binary forms, with or without 1.10 +// modification, are permitted provided that the following conditions are met: 1.11 +// 1.12 +// 1. Redistributions of source code must retain the above copyright notice, 1.13 +// this list of conditions and the following disclaimer. 1.14 +// 1.15 +// 2. Redistributions in binary form must reproduce the above copyright 1.16 +// notice, this list of conditions and the following disclaimer in the 1.17 +// documentation and/or other materials provided with the distribution. 1.18 +// 1.19 +// 3. The name of the author may be used to endorse or promote products 1.20 +// derived from this software without specific prior written permission. 1.21 +// 1.22 +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 1.23 +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 1.24 +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 1.25 +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 1.26 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 1.27 +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 1.28 +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 1.29 +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 1.30 +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1.31 +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1.32 +// 1.33 +/////////////////////////////////////////////////////////////////////////////// 1.34 + 1.35 +#ifndef _MSC_VER // [ 1.36 +#error "Use this header only with Microsoft Visual C++ compilers!" 1.37 +#endif // _MSC_VER ] 1.38 + 1.39 +#ifndef _MSC_INTTYPES_H_ // [ 1.40 +#define _MSC_INTTYPES_H_ 1.41 + 1.42 +#if _MSC_VER > 1000 1.43 +#pragma once 1.44 +#endif 1.45 + 1.46 +#include "stdint.h" 1.47 + 1.48 +// 7.8 Format conversion of integer types 1.49 + 1.50 +typedef struct { 1.51 + intmax_t quot; 1.52 + intmax_t rem; 1.53 +} imaxdiv_t; 1.54 + 1.55 +// 7.8.1 Macros for format specifiers 1.56 + 1.57 +#if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 1.58 + 1.59 +// The fprintf macros for signed integers are: 1.60 +#define PRId8 "d" 1.61 +#define PRIi8 "i" 1.62 +#define PRIdLEAST8 "d" 1.63 +#define PRIiLEAST8 "i" 1.64 +#define PRIdFAST8 "d" 1.65 +#define PRIiFAST8 "i" 1.66 + 1.67 +#define PRId16 "hd" 1.68 +#define PRIi16 "hi" 1.69 +#define PRIdLEAST16 "hd" 1.70 +#define PRIiLEAST16 "hi" 1.71 +#define PRIdFAST16 "hd" 1.72 +#define PRIiFAST16 "hi" 1.73 + 1.74 +#define PRId32 "I32d" 1.75 +#define PRIi32 "I32i" 1.76 +#define PRIdLEAST32 "I32d" 1.77 +#define PRIiLEAST32 "I32i" 1.78 +#define PRIdFAST32 "I32d" 1.79 +#define PRIiFAST32 "I32i" 1.80 + 1.81 +#define PRId64 "I64d" 1.82 +#define PRIi64 "I64i" 1.83 +#define PRIdLEAST64 "I64d" 1.84 +#define PRIiLEAST64 "I64i" 1.85 +#define PRIdFAST64 "I64d" 1.86 +#define PRIiFAST64 "I64i" 1.87 + 1.88 +#define PRIdMAX "I64d" 1.89 +#define PRIiMAX "I64i" 1.90 + 1.91 +#define PRIdPTR "Id" 1.92 +#define PRIiPTR "Ii" 1.93 + 1.94 +// The fprintf macros for unsigned integers are: 1.95 +#define PRIo8 "o" 1.96 +#define PRIu8 "u" 1.97 +#define PRIx8 "x" 1.98 +#define PRIX8 "X" 1.99 +#define PRIoLEAST8 "o" 1.100 +#define PRIuLEAST8 "u" 1.101 +#define PRIxLEAST8 "x" 1.102 +#define PRIXLEAST8 "X" 1.103 +#define PRIoFAST8 "o" 1.104 +#define PRIuFAST8 "u" 1.105 +#define PRIxFAST8 "x" 1.106 +#define PRIXFAST8 "X" 1.107 + 1.108 +#define PRIo16 "ho" 1.109 +#define PRIu16 "hu" 1.110 +#define PRIx16 "hx" 1.111 +#define PRIX16 "hX" 1.112 +#define PRIoLEAST16 "ho" 1.113 +#define PRIuLEAST16 "hu" 1.114 +#define PRIxLEAST16 "hx" 1.115 +#define PRIXLEAST16 "hX" 1.116 +#define PRIoFAST16 "ho" 1.117 +#define PRIuFAST16 "hu" 1.118 +#define PRIxFAST16 "hx" 1.119 +#define PRIXFAST16 "hX" 1.120 + 1.121 +#define PRIo32 "I32o" 1.122 +#define PRIu32 "I32u" 1.123 +#define PRIx32 "I32x" 1.124 +#define PRIX32 "I32X" 1.125 +#define PRIoLEAST32 "I32o" 1.126 +#define PRIuLEAST32 "I32u" 1.127 +#define PRIxLEAST32 "I32x" 1.128 +#define PRIXLEAST32 "I32X" 1.129 +#define PRIoFAST32 "I32o" 1.130 +#define PRIuFAST32 "I32u" 1.131 +#define PRIxFAST32 "I32x" 1.132 +#define PRIXFAST32 "I32X" 1.133 + 1.134 +#define PRIo64 "I64o" 1.135 +#define PRIu64 "I64u" 1.136 +#define PRIx64 "I64x" 1.137 +#define PRIX64 "I64X" 1.138 +#define PRIoLEAST64 "I64o" 1.139 +#define PRIuLEAST64 "I64u" 1.140 +#define PRIxLEAST64 "I64x" 1.141 +#define PRIXLEAST64 "I64X" 1.142 +#define PRIoFAST64 "I64o" 1.143 +#define PRIuFAST64 "I64u" 1.144 +#define PRIxFAST64 "I64x" 1.145 +#define PRIXFAST64 "I64X" 1.146 + 1.147 +#define PRIoMAX "I64o" 1.148 +#define PRIuMAX "I64u" 1.149 +#define PRIxMAX "I64x" 1.150 +#define PRIXMAX "I64X" 1.151 + 1.152 +#define PRIoPTR "Io" 1.153 +#define PRIuPTR "Iu" 1.154 +#define PRIxPTR "Ix" 1.155 +#define PRIXPTR "IX" 1.156 + 1.157 +// The fscanf macros for signed integers are: 1.158 +#define SCNd8 "d" 1.159 +#define SCNi8 "i" 1.160 +#define SCNdLEAST8 "d" 1.161 +#define SCNiLEAST8 "i" 1.162 +#define SCNdFAST8 "d" 1.163 +#define SCNiFAST8 "i" 1.164 + 1.165 +#define SCNd16 "hd" 1.166 +#define SCNi16 "hi" 1.167 +#define SCNdLEAST16 "hd" 1.168 +#define SCNiLEAST16 "hi" 1.169 +#define SCNdFAST16 "hd" 1.170 +#define SCNiFAST16 "hi" 1.171 + 1.172 +#define SCNd32 "ld" 1.173 +#define SCNi32 "li" 1.174 +#define SCNdLEAST32 "ld" 1.175 +#define SCNiLEAST32 "li" 1.176 +#define SCNdFAST32 "ld" 1.177 +#define SCNiFAST32 "li" 1.178 + 1.179 +#define SCNd64 "I64d" 1.180 +#define SCNi64 "I64i" 1.181 +#define SCNdLEAST64 "I64d" 1.182 +#define SCNiLEAST64 "I64i" 1.183 +#define SCNdFAST64 "I64d" 1.184 +#define SCNiFAST64 "I64i" 1.185 + 1.186 +#define SCNdMAX "I64d" 1.187 +#define SCNiMAX "I64i" 1.188 + 1.189 +#ifdef _WIN64 // [ 1.190 +# define SCNdPTR "I64d" 1.191 +# define SCNiPTR "I64i" 1.192 +#else // _WIN64 ][ 1.193 +# define SCNdPTR "ld" 1.194 +# define SCNiPTR "li" 1.195 +#endif // _WIN64 ] 1.196 + 1.197 +// The fscanf macros for unsigned integers are: 1.198 +#define SCNo8 "o" 1.199 +#define SCNu8 "u" 1.200 +#define SCNx8 "x" 1.201 +#define SCNX8 "X" 1.202 +#define SCNoLEAST8 "o" 1.203 +#define SCNuLEAST8 "u" 1.204 +#define SCNxLEAST8 "x" 1.205 +#define SCNXLEAST8 "X" 1.206 +#define SCNoFAST8 "o" 1.207 +#define SCNuFAST8 "u" 1.208 +#define SCNxFAST8 "x" 1.209 +#define SCNXFAST8 "X" 1.210 + 1.211 +#define SCNo16 "ho" 1.212 +#define SCNu16 "hu" 1.213 +#define SCNx16 "hx" 1.214 +#define SCNX16 "hX" 1.215 +#define SCNoLEAST16 "ho" 1.216 +#define SCNuLEAST16 "hu" 1.217 +#define SCNxLEAST16 "hx" 1.218 +#define SCNXLEAST16 "hX" 1.219 +#define SCNoFAST16 "ho" 1.220 +#define SCNuFAST16 "hu" 1.221 +#define SCNxFAST16 "hx" 1.222 +#define SCNXFAST16 "hX" 1.223 + 1.224 +#define SCNo32 "lo" 1.225 +#define SCNu32 "lu" 1.226 +#define SCNx32 "lx" 1.227 +#define SCNX32 "lX" 1.228 +#define SCNoLEAST32 "lo" 1.229 +#define SCNuLEAST32 "lu" 1.230 +#define SCNxLEAST32 "lx" 1.231 +#define SCNXLEAST32 "lX" 1.232 +#define SCNoFAST32 "lo" 1.233 +#define SCNuFAST32 "lu" 1.234 +#define SCNxFAST32 "lx" 1.235 +#define SCNXFAST32 "lX" 1.236 + 1.237 +#define SCNo64 "I64o" 1.238 +#define SCNu64 "I64u" 1.239 +#define SCNx64 "I64x" 1.240 +#define SCNX64 "I64X" 1.241 +#define SCNoLEAST64 "I64o" 1.242 +#define SCNuLEAST64 "I64u" 1.243 +#define SCNxLEAST64 "I64x" 1.244 +#define SCNXLEAST64 "I64X" 1.245 +#define SCNoFAST64 "I64o" 1.246 +#define SCNuFAST64 "I64u" 1.247 +#define SCNxFAST64 "I64x" 1.248 +#define SCNXFAST64 "I64X" 1.249 + 1.250 +#define SCNoMAX "I64o" 1.251 +#define SCNuMAX "I64u" 1.252 +#define SCNxMAX "I64x" 1.253 +#define SCNXMAX "I64X" 1.254 + 1.255 +#ifdef _WIN64 // [ 1.256 +# define SCNoPTR "I64o" 1.257 +# define SCNuPTR "I64u" 1.258 +# define SCNxPTR "I64x" 1.259 +# define SCNXPTR "I64X" 1.260 +#else // _WIN64 ][ 1.261 +# define SCNoPTR "lo" 1.262 +# define SCNuPTR "lu" 1.263 +# define SCNxPTR "lx" 1.264 +# define SCNXPTR "lX" 1.265 +#endif // _WIN64 ] 1.266 + 1.267 +#endif // __STDC_FORMAT_MACROS ] 1.268 + 1.269 +// 7.8.2 Functions for greatest-width integer types 1.270 + 1.271 +// 7.8.2.1 The imaxabs function 1.272 +#define imaxabs _abs64 1.273 + 1.274 +// 7.8.2.2 The imaxdiv function 1.275 + 1.276 +// This is modified version of div() function from Microsoft's div.c found 1.277 +// in %MSVC.NET%\crt\src\div.c 1.278 +#ifdef STATIC_IMAXDIV // [ 1.279 +static 1.280 +#else // STATIC_IMAXDIV ][ 1.281 +_inline 1.282 +#endif // STATIC_IMAXDIV ] 1.283 +imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) 1.284 +{ 1.285 + imaxdiv_t result; 1.286 + 1.287 + result.quot = numer / denom; 1.288 + result.rem = numer % denom; 1.289 + 1.290 + if (numer < 0 && result.rem > 0) { 1.291 + // did division wrong; must fix up 1.292 + ++result.quot; 1.293 + result.rem -= denom; 1.294 + } 1.295 + 1.296 + return result; 1.297 +} 1.298 + 1.299 +// 7.8.2.3 The strtoimax and strtoumax functions 1.300 +#define strtoimax _strtoi64 1.301 +#define strtoumax _strtoui64 1.302 + 1.303 +// 7.8.2.4 The wcstoimax and wcstoumax functions 1.304 +#define wcstoimax _wcstoi64 1.305 +#define wcstoumax _wcstoui64 1.306 + 1.307 + 1.308 +#endif // _MSC_INTTYPES_H_ ]
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/msc/stdint.h Thu Feb 28 08:17:26 2013 +0100 2.3 @@ -0,0 +1,247 @@ 2.4 +// ISO C9x compliant stdint.h for Microsoft Visual Studio 2.5 +// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 2.6 +// 2.7 +// Copyright (c) 2006-2008 Alexander Chemeris 2.8 +// 2.9 +// Redistribution and use in source and binary forms, with or without 2.10 +// modification, are permitted provided that the following conditions are met: 2.11 +// 2.12 +// 1. Redistributions of source code must retain the above copyright notice, 2.13 +// this list of conditions and the following disclaimer. 2.14 +// 2.15 +// 2. Redistributions in binary form must reproduce the above copyright 2.16 +// notice, this list of conditions and the following disclaimer in the 2.17 +// documentation and/or other materials provided with the distribution. 2.18 +// 2.19 +// 3. The name of the author may be used to endorse or promote products 2.20 +// derived from this software without specific prior written permission. 2.21 +// 2.22 +// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 2.23 +// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 2.24 +// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 2.25 +// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2.26 +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 2.27 +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 2.28 +// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 2.29 +// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 2.30 +// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 2.31 +// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2.32 +// 2.33 +/////////////////////////////////////////////////////////////////////////////// 2.34 + 2.35 +#ifndef _MSC_VER // [ 2.36 +#error "Use this header only with Microsoft Visual C++ compilers!" 2.37 +#endif // _MSC_VER ] 2.38 + 2.39 +#ifndef _MSC_STDINT_H_ // [ 2.40 +#define _MSC_STDINT_H_ 2.41 + 2.42 +#if _MSC_VER > 1000 2.43 +#pragma once 2.44 +#endif 2.45 + 2.46 +#include <limits.h> 2.47 + 2.48 +// For Visual Studio 6 in C++ mode and for many Visual Studio versions when 2.49 +// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}' 2.50 +// or compiler give many errors like this: 2.51 +// error C2733: second C linkage of overloaded function 'wmemchr' not allowed 2.52 +#ifdef __cplusplus 2.53 +extern "C" { 2.54 +#endif 2.55 +# include <wchar.h> 2.56 +#ifdef __cplusplus 2.57 +} 2.58 +#endif 2.59 + 2.60 +// Define _W64 macros to mark types changing their size, like intptr_t. 2.61 +#ifndef _W64 2.62 +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 2.63 +# define _W64 __w64 2.64 +# else 2.65 +# define _W64 2.66 +# endif 2.67 +#endif 2.68 + 2.69 + 2.70 +// 7.18.1 Integer types 2.71 + 2.72 +// 7.18.1.1 Exact-width integer types 2.73 + 2.74 +// Visual Studio 6 and Embedded Visual C++ 4 doesn't 2.75 +// realize that, e.g. char has the same size as __int8 2.76 +// so we give up on __intX for them. 2.77 +#if (_MSC_VER < 1300) 2.78 + typedef signed char int8_t; 2.79 + typedef signed short int16_t; 2.80 + typedef signed int int32_t; 2.81 + typedef unsigned char uint8_t; 2.82 + typedef unsigned short uint16_t; 2.83 + typedef unsigned int uint32_t; 2.84 +#else 2.85 + typedef signed __int8 int8_t; 2.86 + typedef signed __int16 int16_t; 2.87 + typedef signed __int32 int32_t; 2.88 + typedef unsigned __int8 uint8_t; 2.89 + typedef unsigned __int16 uint16_t; 2.90 + typedef unsigned __int32 uint32_t; 2.91 +#endif 2.92 +typedef signed __int64 int64_t; 2.93 +typedef unsigned __int64 uint64_t; 2.94 + 2.95 + 2.96 +// 7.18.1.2 Minimum-width integer types 2.97 +typedef int8_t int_least8_t; 2.98 +typedef int16_t int_least16_t; 2.99 +typedef int32_t int_least32_t; 2.100 +typedef int64_t int_least64_t; 2.101 +typedef uint8_t uint_least8_t; 2.102 +typedef uint16_t uint_least16_t; 2.103 +typedef uint32_t uint_least32_t; 2.104 +typedef uint64_t uint_least64_t; 2.105 + 2.106 +// 7.18.1.3 Fastest minimum-width integer types 2.107 +typedef int8_t int_fast8_t; 2.108 +typedef int16_t int_fast16_t; 2.109 +typedef int32_t int_fast32_t; 2.110 +typedef int64_t int_fast64_t; 2.111 +typedef uint8_t uint_fast8_t; 2.112 +typedef uint16_t uint_fast16_t; 2.113 +typedef uint32_t uint_fast32_t; 2.114 +typedef uint64_t uint_fast64_t; 2.115 + 2.116 +// 7.18.1.4 Integer types capable of holding object pointers 2.117 +#ifdef _WIN64 // [ 2.118 + typedef signed __int64 intptr_t; 2.119 + typedef unsigned __int64 uintptr_t; 2.120 +#else // _WIN64 ][ 2.121 + typedef _W64 signed int intptr_t; 2.122 + typedef _W64 unsigned int uintptr_t; 2.123 +#endif // _WIN64 ] 2.124 + 2.125 +// 7.18.1.5 Greatest-width integer types 2.126 +typedef int64_t intmax_t; 2.127 +typedef uint64_t uintmax_t; 2.128 + 2.129 + 2.130 +// 7.18.2 Limits of specified-width integer types 2.131 + 2.132 +#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 2.133 + 2.134 +// 7.18.2.1 Limits of exact-width integer types 2.135 +#define INT8_MIN ((int8_t)_I8_MIN) 2.136 +#define INT8_MAX _I8_MAX 2.137 +#define INT16_MIN ((int16_t)_I16_MIN) 2.138 +#define INT16_MAX _I16_MAX 2.139 +#define INT32_MIN ((int32_t)_I32_MIN) 2.140 +#define INT32_MAX _I32_MAX 2.141 +#define INT64_MIN ((int64_t)_I64_MIN) 2.142 +#define INT64_MAX _I64_MAX 2.143 +#define UINT8_MAX _UI8_MAX 2.144 +#define UINT16_MAX _UI16_MAX 2.145 +#define UINT32_MAX _UI32_MAX 2.146 +#define UINT64_MAX _UI64_MAX 2.147 + 2.148 +// 7.18.2.2 Limits of minimum-width integer types 2.149 +#define INT_LEAST8_MIN INT8_MIN 2.150 +#define INT_LEAST8_MAX INT8_MAX 2.151 +#define INT_LEAST16_MIN INT16_MIN 2.152 +#define INT_LEAST16_MAX INT16_MAX 2.153 +#define INT_LEAST32_MIN INT32_MIN 2.154 +#define INT_LEAST32_MAX INT32_MAX 2.155 +#define INT_LEAST64_MIN INT64_MIN 2.156 +#define INT_LEAST64_MAX INT64_MAX 2.157 +#define UINT_LEAST8_MAX UINT8_MAX 2.158 +#define UINT_LEAST16_MAX UINT16_MAX 2.159 +#define UINT_LEAST32_MAX UINT32_MAX 2.160 +#define UINT_LEAST64_MAX UINT64_MAX 2.161 + 2.162 +// 7.18.2.3 Limits of fastest minimum-width integer types 2.163 +#define INT_FAST8_MIN INT8_MIN 2.164 +#define INT_FAST8_MAX INT8_MAX 2.165 +#define INT_FAST16_MIN INT16_MIN 2.166 +#define INT_FAST16_MAX INT16_MAX 2.167 +#define INT_FAST32_MIN INT32_MIN 2.168 +#define INT_FAST32_MAX INT32_MAX 2.169 +#define INT_FAST64_MIN INT64_MIN 2.170 +#define INT_FAST64_MAX INT64_MAX 2.171 +#define UINT_FAST8_MAX UINT8_MAX 2.172 +#define UINT_FAST16_MAX UINT16_MAX 2.173 +#define UINT_FAST32_MAX UINT32_MAX 2.174 +#define UINT_FAST64_MAX UINT64_MAX 2.175 + 2.176 +// 7.18.2.4 Limits of integer types capable of holding object pointers 2.177 +#ifdef _WIN64 // [ 2.178 +# define INTPTR_MIN INT64_MIN 2.179 +# define INTPTR_MAX INT64_MAX 2.180 +# define UINTPTR_MAX UINT64_MAX 2.181 +#else // _WIN64 ][ 2.182 +# define INTPTR_MIN INT32_MIN 2.183 +# define INTPTR_MAX INT32_MAX 2.184 +# define UINTPTR_MAX UINT32_MAX 2.185 +#endif // _WIN64 ] 2.186 + 2.187 +// 7.18.2.5 Limits of greatest-width integer types 2.188 +#define INTMAX_MIN INT64_MIN 2.189 +#define INTMAX_MAX INT64_MAX 2.190 +#define UINTMAX_MAX UINT64_MAX 2.191 + 2.192 +// 7.18.3 Limits of other integer types 2.193 + 2.194 +#ifdef _WIN64 // [ 2.195 +# define PTRDIFF_MIN _I64_MIN 2.196 +# define PTRDIFF_MAX _I64_MAX 2.197 +#else // _WIN64 ][ 2.198 +# define PTRDIFF_MIN _I32_MIN 2.199 +# define PTRDIFF_MAX _I32_MAX 2.200 +#endif // _WIN64 ] 2.201 + 2.202 +#define SIG_ATOMIC_MIN INT_MIN 2.203 +#define SIG_ATOMIC_MAX INT_MAX 2.204 + 2.205 +#ifndef SIZE_MAX // [ 2.206 +# ifdef _WIN64 // [ 2.207 +# define SIZE_MAX _UI64_MAX 2.208 +# else // _WIN64 ][ 2.209 +# define SIZE_MAX _UI32_MAX 2.210 +# endif // _WIN64 ] 2.211 +#endif // SIZE_MAX ] 2.212 + 2.213 +// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h> 2.214 +#ifndef WCHAR_MIN // [ 2.215 +# define WCHAR_MIN 0 2.216 +#endif // WCHAR_MIN ] 2.217 +#ifndef WCHAR_MAX // [ 2.218 +# define WCHAR_MAX _UI16_MAX 2.219 +#endif // WCHAR_MAX ] 2.220 + 2.221 +#define WINT_MIN 0 2.222 +#define WINT_MAX _UI16_MAX 2.223 + 2.224 +#endif // __STDC_LIMIT_MACROS ] 2.225 + 2.226 + 2.227 +// 7.18.4 Limits of other integer types 2.228 + 2.229 +#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 2.230 + 2.231 +// 7.18.4.1 Macros for minimum-width integer constants 2.232 + 2.233 +#define INT8_C(val) val##i8 2.234 +#define INT16_C(val) val##i16 2.235 +#define INT32_C(val) val##i32 2.236 +#define INT64_C(val) val##i64 2.237 + 2.238 +#define UINT8_C(val) val##ui8 2.239 +#define UINT16_C(val) val##ui16 2.240 +#define UINT32_C(val) val##ui32 2.241 +#define UINT64_C(val) val##ui64 2.242 + 2.243 +// 7.18.4.2 Macros for greatest-width integer constants 2.244 +#define INTMAX_C INT64_C 2.245 +#define UINTMAX_C UINT64_C 2.246 + 2.247 +#endif // __STDC_CONSTANT_MACROS ] 2.248 + 2.249 + 2.250 +#endif // _MSC_STDINT_H_ ]