From 71d630dbba09266832753c4773d89492884cbc7e Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Sat, 9 Mar 2013 10:25:39 +1100 Subject: [PATCH] FLAC/ordinals.h : Add definitions for MSVC < 2010. --- include/FLAC/ordinals.h | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/include/FLAC/ordinals.h b/include/FLAC/ordinals.h index 3c6dd184..b781edcd 100644 --- a/include/FLAC/ordinals.h +++ b/include/FLAC/ordinals.h @@ -32,13 +32,26 @@ #ifndef FLAC__ORDINALS_H #define FLAC__ORDINALS_H -/* If your compiler does not provide you should provide a replacement - * which has suitable replacements for the following intX_T and uintX_t types. - * For example: - * http://msinttypes.googlecode.com/svn/trunk/stdint.h - * http://www.azillionmonkeys.com/qed/pstdint.h +#if defined(_MSC_VER) && _MSC_VER < 1600 + +/* Microsoft Visual Studio earlier than the 2010 version did not provide + * the 1999 ISO C Standard header file . */ +typedef __int8 FLAC__int8; +typedef unsigned __int8 FLAC__uint8; + +typedef __int16 FLAC__int16; +typedef __int32 FLAC__int32; +typedef __int64 FLAC__int64; +typedef unsigned __int16 FLAC__uint16; +typedef unsigned __int32 FLAC__uint32; +typedef unsigned __int64 FLAC__uint64; + +#else + +/* For MSVC 2010 and everything else which provides . */ + #include typedef int8_t FLAC__int8; @@ -51,10 +64,13 @@ typedef uint16_t FLAC__uint16; typedef uint32_t FLAC__uint32; typedef uint64_t FLAC__uint64; +#endif + typedef int FLAC__bool; typedef FLAC__uint8 FLAC__byte; + #ifdef true #undef true #endif