# HG changeset patch # User ipse.c99@d525d15b-5824-0410-80a3-6185d19c2cde # Date 1242066135 0 # Node ID 9be805b7c8c6aedc2f5588545311096a75c6e3ef # Parent febb32e4ac04955c9667d73a95c26d0b75610dcb [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. diff --git a/stdint.h b/stdint.h --- 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;