changeset 20:9be805b7c8c6

[Issue 3] Visual Studio 6 and Embedded Visual C++ 4 doesn't realize that, e.g. char has the same size as __int8 so we give up on __intX for them. his should close Issue 3 in issue tracker.
author ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde
date Mon, 11 May 2009 18:22:15 +0000
parents febb32e4ac04
children c0040f8fc49b
files stdint.h
diffstat 1 files changed, 22 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/stdint.h
+++ b/stdint.h
@@ -66,14 +66,28 @@
 // 7.18.1 Integer types
 
 // 7.18.1.1 Exact-width integer types
-typedef __int8            int8_t;
-typedef __int16           int16_t;
-typedef __int32           int32_t;
-typedef __int64           int64_t;
-typedef unsigned __int8   uint8_t;
-typedef unsigned __int16  uint16_t;
-typedef unsigned __int32  uint32_t;
-typedef unsigned __int64  uint64_t;
+
+// Visual Studio 6 and Embedded Visual C++ 4 doesn't
+// realize that, e.g. char has the same size as __int8
+// so we give up on __intX for them.
+#if (_MSC_VER < 1300)
+   typedef char              int8_t;
+   typedef short             int16_t;
+   typedef int               int32_t;
+   typedef unsigned char     uint8_t;
+   typedef unsigned short    uint16_t;
+   typedef unsigned int      uint32_t;
+#else
+   typedef __int8            int8_t;
+   typedef __int16           int16_t;
+   typedef __int32           int32_t;
+   typedef unsigned __int8   uint8_t;
+   typedef unsigned __int16  uint16_t;
+   typedef unsigned __int32  uint32_t;
+#endif
+typedef __int64              int64_t;
+typedef unsigned __int64     uint64_t;
+
 
 // 7.18.1.2 Minimum-width integer types
 typedef int8_t    int_least8_t;