medfall

A super great game engine
Log | Files | Refs

commit b4bb97fb0b82f0e90a1ec109a45b547c56246790
parent 07f8f71b23904686cceb856b30e9b7296ebd28fb
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sun Jul  2 12:07:12 +0300

Define PLATFORM_NAME

Diffstat:
platform.h | 34++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+), 0 deletions(-)
diff --git a/platform.h b/platform.h @@ -30,6 +30,20 @@ # error new compiler #endif +#if COMPILER_MSVC +# if _WIN64 == 1 +# define PLATFORM_64BIT 1 +# else +# define PLATFORM_32BIT 1 +# endif +#elif COMPILER_GCCORCLANG +# if __x86_64__ +# define PLATFORM_64BIT 1 +# else +# define PLATFORM_32BIT 1 +# endif +#endif + #if defined( __MINGW32__ ) # define COMPILER_MINGW 1 #endif @@ -41,3 +55,23 @@ #if __cplusplus >= 201103L # define PLATFORM_CPP11 1 #endif + +#if PLATFORM_WINDOWS +# if PLATFORM_64BIT +# define PLATFORM_NAME "windows64" +# else +# define PLATFORM_NAME "windows32" +# endif +#elif PLATFORM_LINUX +# if PLATFORM_64BIT +# define PLATFORM_NAME "linux64" +# else +# define PLATFORM_NAME "linux32" +# endif +#elif PLATFORM_OSX +# if PLATFORM_64BIT +# define PLATFORM_NAME "macos64" +# else +# define PLATFORM_NAME "macos32" +# endif +#endif