summaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
authorjussi2024-05-20 17:56:28 +0300
committerjussi2024-05-20 17:56:28 +0300
commitc95c797da61b4b2829d542f6d7c164a88951cad4 (patch)
tree1af6e709ccbb2c15d7799be70ad42b2ab311a734 /src/core.c
parent9edaf7a47b02bd351c400f0c6aec517884449551 (diff)
downloadreilua-enhanced-c95c797da61b4b2829d542f6d7c164a88951cad4.tar.gz
reilua-enhanced-c95c797da61b4b2829d542f6d7c164a88951cad4.tar.bz2
reilua-enhanced-c95c797da61b4b2829d542f6d7c164a88951cad4.zip
GetPlatform.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/core.c b/src/core.c
index 2146510..d22ed60 100644
--- a/src/core.c
+++ b/src/core.c
@@ -1491,6 +1491,31 @@ int lcoreSetGCUnload( lua_State* L ) {
}
/*
+> platform = RL.GetPlatform()
+
+Get platform. Returns "Windows", "Linux", "FreeBSD", "OpenBSD", "Apple" or "Emscripten"
+
+- Success return string
+*/
+int lcoreGetPlatform( lua_State* L ) {
+#if defined( _WIN32 )
+ lua_pushstring( L, "Windows" );
+#elif defined( __linux__ )
+ lua_pushstring( L, "Linux" );
+#elif defined( __FreeBSD__ )
+ lua_pushstring( L, "FreeBSD" );
+#elif defined( __OpenBSD__ )
+ lua_pushstring( L, "OpenBSD" );
+#elif defined( __APPLE__ )
+ lua_pushstring( L, "Apple" );
+#elif defined( __EMSCRIPTEN__ )
+ lua_pushstring( L, "Emscripten" );
+#endif
+
+ return 1;
+}
+
+/*
## Core - Files management functions
*/