diff options
Diffstat (limited to 'src/porting.h')
-rw-r--r-- | src/porting.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/src/porting.h b/src/porting.h index 9be09da75..b6f71103d 100644 --- a/src/porting.h +++ b/src/porting.h @@ -371,6 +371,46 @@ v2u32 getDisplaySize(); v2u32 getWindowSize(); #endif +inline const char * getPlatformName() +{ + return +#if defined(ANDROID) + "Android" +#elif defined(linux) || defined(__linux) || defined(__linux__) + "Linux" +#elif defined(_WIN32) || defined(_WIN64) + "Windows" +#elif defined(__DragonFly__) || defined(__FreeBSD__) || \ + defined(__NetBSD__) || defined(__OpenBSD__) + "BSD" +#elif defined(__APPLE__) && defined(__MACH__) + #if TARGET_OS_MAC + "OSX" + #elif TARGET_OS_IPHONE + "iOS" + #else + "Apple" + #endif +#elif defined(_AIX) + "AIX" +#elif defined(__hpux) + "HP-UX" +#elif defined(__sun) && defined(__SVR4) + "Solaris" +#elif defined(__CYGWIN__) + "Cygwin" +#elif defined(__unix__) || defined(__unix) + #if defined(_POSIX_VERSION) + "Posix" + #else + "Unix" + #endif +#else + "?" +#endif + ; +} + } // namespace porting #ifdef __ANDROID__ |