From 8b8ec1f39afcfcadf4b813a65aff8e0156d8b5cd Mon Sep 17 00:00:00 2001 From: Joshua Scoggins Date: Sun, 17 Apr 2016 23:30:48 -0700 Subject: [PATCH] Add some C++11 features into Types.h since C++11 is so cool :D --- Sources/Engine/Base/Types.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Sources/Engine/Base/Types.h b/Sources/Engine/Base/Types.h index c32d2a1..13fe3a3 100644 --- a/Sources/Engine/Base/Types.h +++ b/Sources/Engine/Base/Types.h @@ -302,12 +302,31 @@ typedef uint32_t UINT; #define MAX_UWORD ((UWORD)0xFFFF) #define MAX_UBYTE ((UBYTE)0xFF) +#ifdef PLATFORM_WIN32 typedef int BOOL; // this is for TRUE/FALSE typedef int RESULT; // for error codes typedef int INDEX; // for indexed values and quantities - +#else +#if __cplusplus <= 199711L +typedef int32_t BOOL; // this is for TRUE/FALSE +#else // c++11 and greater has nice bool support +typedef bool BOOL; +#endif +typedef int32_t RESULT; // for error codes +typedef int32_t INDEX; // for indexed values and quantities +#endif +#ifdef PLATFORM_WIN32 #define FALSE 0 #define TRUE 1 +#else + #if __cplusplus <= 199711L + #define FALSE 0 + #define TRUE 1 + #else // use boolean types when we have access to C++11 + #define FALSE false + #define TRUE true + #endif +#endif #define NONE 0 #define NOTHING ((void) 0)