FLAC/ordinals.h : Add <stdint.h> definitions for MSVC < 2010.

This commit is contained in:
Erik de Castro Lopo 2013-03-09 10:25:39 +11:00
parent d5b03bcc36
commit 71d630dbba
1 changed files with 21 additions and 5 deletions

View File

@ -32,13 +32,26 @@
#ifndef FLAC__ORDINALS_H #ifndef FLAC__ORDINALS_H
#define FLAC__ORDINALS_H #define FLAC__ORDINALS_H
/* If your compiler does not provide <stdint.h> you should provide a replacement #if defined(_MSC_VER) && _MSC_VER < 1600
* which has suitable replacements for the following intX_T and uintX_t types.
* For example: /* Microsoft Visual Studio earlier than the 2010 version did not provide
* http://msinttypes.googlecode.com/svn/trunk/stdint.h * the 1999 ISO C Standard header file <stdint.h>.
* http://www.azillionmonkeys.com/qed/pstdint.h
*/ */
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 <stdint.h>. */
#include <stdint.h> #include <stdint.h>
typedef int8_t FLAC__int8; typedef int8_t FLAC__int8;
@ -51,10 +64,13 @@ typedef uint16_t FLAC__uint16;
typedef uint32_t FLAC__uint32; typedef uint32_t FLAC__uint32;
typedef uint64_t FLAC__uint64; typedef uint64_t FLAC__uint64;
#endif
typedef int FLAC__bool; typedef int FLAC__bool;
typedef FLAC__uint8 FLAC__byte; typedef FLAC__uint8 FLAC__byte;
#ifdef true #ifdef true
#undef true #undef true
#endif #endif