summaryrefslogtreecommitdiff
path: root/src/porting.h
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2014-11-20 14:59:19 -0500
committerShadowNinja <shadowninja@minetest.net>2014-11-20 15:37:20 -0500
commitc4e393deea4f1a6d242a3fdf392c463ed5a3b58d (patch)
tree4230e1af5eaaf697c1c61456d010f8e8f560c4e6 /src/porting.h
parentd2b5ba83b00ce00ff34f627da02f4eb4ceb86412 (diff)
downloadminetest-c4e393deea4f1a6d242a3fdf392c463ed5a3b58d.tar.gz
minetest-c4e393deea4f1a6d242a3fdf392c463ed5a3b58d.tar.bz2
minetest-c4e393deea4f1a6d242a3fdf392c463ed5a3b58d.zip
Simplify loading of Android version of menu
Diffstat (limited to 'src/porting.h')
-rw-r--r--src/porting.h40
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__