use stdint.h instead of courage in Types.h

This commit is contained in:
Joshua Scoggins 2016-04-17 23:18:23 -07:00
parent 5b2933e217
commit 35955d20ba
2 changed files with 32 additions and 16 deletions

View File

@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
// wants to use MINGW then they can
#if (defined _WIN32) || (defined _WIN64)
#ifndef PLATFORM_WIN32
#define PLATFORM_WIN32
#define PLATFORM_WIN32 1
#endif
#ifndef PRAGMA_ONCE
@ -57,25 +57,25 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#if (defined __ANDROID__) || (defined __android__)
#error "Android current isn't supported"
#else
#define PLATFORM_LINUX
#define PLATFORM_LINUX 1
#endif
#elif (defined __APPLE__)
#include "TargetConditionals.h"
#if TARGET_OS_MAC
#define PLATFORM_MACOSX
#define PLATFORM_MACOSX 1
#else
#error "Unsupported apple platform"
#endif
#else
#warning "UNKNOWN PLATFORM IDENTIFIED!!!!"
#define PLATFORM_UNKNOWN
#define PLATFORM_UNKNOWN 1
#warning "USING PORTABLE C!!!"
#define USE_PORTABLE_C
#endif
#if (defined PLATFORM_LINUX) || (defined PLATFORM_MACOSX)
#if PLATFORM_LINUX || PLATFORM_MACOSX
#ifndef PLATFORM_UNIX
#define PLATFORM_UNIX
#define PLATFORM_UNIX 1
#endif
#endif

View File

@ -27,6 +27,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <Engine/Graphics/gl_types.h>
// !!! FIXME: use stdint.h for this (and other things like INDEX, too)?
#ifdef PLATFORM_WIN32
typedef signed int SLONG;
typedef signed short int SWORD;
typedef signed char SBYTE;
@ -36,6 +37,20 @@ typedef unsigned int ULONG;
typedef unsigned short int UWORD;
typedef unsigned char UBYTE;
typedef unsigned int UINT;
#else
#include <stdint.h>
// use the defined typesizes from MSDN to create an equivalent translation on
// non windows platforms
typedef int32_t SLONG;
typedef int16_t SWORD;
typedef int8_t SBYTE;
typedef int32_t SINT;
typedef uint32_t ULONG;
typedef uint16_t UWORD;
typedef uint8_t UBYTE;
typedef uint32_t UINT;
#endif
// Flip this to 1 to turn off these messages everywhere.
// !!! FIXME: I have it forced off for Windows because fprintf.
@ -53,6 +68,7 @@ typedef unsigned int UINT;
} while (0)
#endif
// TODO: add more architecture detection routines
#if __POWERPC__ /* rcg03232004 */
#define PLATFORM_BIGENDIAN 1
#define PLATFORM_LITTLEENDIAN 0
@ -213,22 +229,22 @@ typedef unsigned int UINT;
#endif
}
typedef unsigned long long __uint64;
typedef uint64_t __uint64;
#if (!defined __INTEL_COMPILER)
typedef long long __int64;
typedef int64_t __int64;
#endif
typedef char CHAR;
typedef UBYTE BYTE;
typedef unsigned short WORD;
typedef unsigned int DWORD;
typedef signed int LONG;
typedef uint16_t WORD;
typedef uint32_t DWORD;
typedef int32_t LONG;
typedef void *LPVOID;
typedef char *LPSTR;
typedef signed long int WPARAM;
typedef signed long int LPARAM;
typedef signed short int SHORT;
typedef unsigned short int USHORT;
typedef uint32_t WPARAM;
typedef int32_t LPARAM;
typedef int16_t SHORT;
typedef uint16_t USHORT;
typedef void *HWND; /* !!! FIXME this sucks. */
typedef void *HINSTANCE; /* !!! FIXME this sucks. */