Mercurial > ms-int-types
comparison stdint.h @ 23:b1e002710e2d
[Issue 4] Fix incorrect int8_t behaviour if compiled with /J flag.
| author | alexander.chemeris@d525d15b-5824-0410-80a3-6185d19c2cde |
|---|---|
| date | Thu, 17 Sep 2009 19:46:49 +0000 |
| parents | ff2caa6b48d1 |
| children | a5b39e660e83 |
comparison
equal
deleted
inserted
replaced
| 22:ff2caa6b48d1 | 23:b1e002710e2d |
|---|---|
| 70 | 70 |
| 71 // Visual Studio 6 and Embedded Visual C++ 4 doesn't | 71 // Visual Studio 6 and Embedded Visual C++ 4 doesn't |
| 72 // realize that, e.g. char has the same size as __int8 | 72 // realize that, e.g. char has the same size as __int8 |
| 73 // so we give up on __intX for them. | 73 // so we give up on __intX for them. |
| 74 #if (_MSC_VER < 1300) | 74 #if (_MSC_VER < 1300) |
| 75 typedef char int8_t; | 75 typedef signed char int8_t; |
| 76 typedef short int16_t; | 76 typedef signed short int16_t; |
| 77 typedef int int32_t; | 77 typedef signed int int32_t; |
| 78 typedef unsigned char uint8_t; | 78 typedef unsigned char uint8_t; |
| 79 typedef unsigned short uint16_t; | 79 typedef unsigned short uint16_t; |
| 80 typedef unsigned int uint32_t; | 80 typedef unsigned int uint32_t; |
| 81 #else | 81 #else |
| 82 typedef __int8 int8_t; | 82 typedef signed __int8 int8_t; |
| 83 typedef __int16 int16_t; | 83 typedef signed __int16 int16_t; |
| 84 typedef __int32 int32_t; | 84 typedef signed __int32 int32_t; |
| 85 typedef unsigned __int8 uint8_t; | 85 typedef unsigned __int8 uint8_t; |
| 86 typedef unsigned __int16 uint16_t; | 86 typedef unsigned __int16 uint16_t; |
| 87 typedef unsigned __int32 uint32_t; | 87 typedef unsigned __int32 uint32_t; |
| 88 #endif | 88 #endif |
| 89 typedef __int64 int64_t; | 89 typedef signed __int64 int64_t; |
| 90 typedef unsigned __int64 uint64_t; | 90 typedef unsigned __int64 uint64_t; |
| 91 | 91 |
| 92 | 92 |
| 93 // 7.18.1.2 Minimum-width integer types | 93 // 7.18.1.2 Minimum-width integer types |
| 94 typedef int8_t int_least8_t; | 94 typedef int8_t int_least8_t; |
| 110 typedef uint32_t uint_fast32_t; | 110 typedef uint32_t uint_fast32_t; |
| 111 typedef uint64_t uint_fast64_t; | 111 typedef uint64_t uint_fast64_t; |
| 112 | 112 |
| 113 // 7.18.1.4 Integer types capable of holding object pointers | 113 // 7.18.1.4 Integer types capable of holding object pointers |
| 114 #ifdef _WIN64 // [ | 114 #ifdef _WIN64 // [ |
| 115 typedef __int64 intptr_t; | 115 typedef signed __int64 intptr_t; |
| 116 typedef unsigned __int64 uintptr_t; | 116 typedef unsigned __int64 uintptr_t; |
| 117 #else // _WIN64 ][ | 117 #else // _WIN64 ][ |
| 118 typedef _W64 int intptr_t; | 118 typedef _W64 signed int intptr_t; |
| 119 typedef _W64 unsigned int uintptr_t; | 119 typedef _W64 unsigned int uintptr_t; |
| 120 #endif // _WIN64 ] | 120 #endif // _WIN64 ] |
| 121 | 121 |
| 122 // 7.18.1.5 Greatest-width integer types | 122 // 7.18.1.5 Greatest-width integer types |
| 123 typedef int64_t intmax_t; | 123 typedef int64_t intmax_t; |
| 124 typedef uint64_t uintmax_t; | 124 typedef uint64_t uintmax_t; |
