]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Add jit.os string.
authorMike Pall <mike>
Tue, 16 Nov 2010 14:05:21 +0000 (15:05 +0100)
committerMike Pall <mike>
Tue, 16 Nov 2010 14:05:21 +0000 (15:05 +0100)
doc/ext_jit.html
src/lib_jit.c

index d621476b5001ddf7967a489cd74d2111a148587f..0d056b35683057eb027c9be1964c64a47496e01a 100644 (file)
@@ -127,9 +127,16 @@ Contains the version number of the LuaJIT core. Version xx.yy.zz
 is represented by the decimal number xxyyzz.
 </p>
 
+<h3 id="jit_os"><tt>jit.os</tt></h3>
+<p>
+Contains the target OS name:
+"Windows", "Linux", "OSX", "BSD", "Posix" or "Other".
+</p>
+
 <h3 id="jit_arch"><tt>jit.arch</tt></h3>
 <p>
-Contains the target architecture name (CPU and optional ABI).
+Contains the target architecture name:
+"x86", "x64" or "ppcspe".
 </p>
 
 <h2 id="jit_opt"><tt>jit.opt.*</tt> &mdash; JIT compiler optimization control</h2>
index 57b50749f3ff9f41df22b47e6ce10b91af0ed437..7b2eaf4466d7c4f8461351482f16fbb4578a84b0 100644 (file)
@@ -133,6 +133,7 @@ LJLIB_CF(jit_attach)
   return 0;
 }
 
+LJLIB_PUSH(top-5) LJLIB_SET(os)
 LJLIB_PUSH(top-4) LJLIB_SET(arch)
 LJLIB_PUSH(top-3) LJLIB_SET(version_num)
 LJLIB_PUSH(top-2) LJLIB_SET(version)
@@ -584,6 +585,7 @@ static void jit_init(lua_State *L)
 
 LUALIB_API int luaopen_jit(lua_State *L)
 {
+  lua_pushliteral(L, LJ_OS_NAME);
   lua_pushliteral(L, LJ_ARCH_NAME);
   lua_pushinteger(L, LUAJIT_VERSION_NUM);
   lua_pushliteral(L, LUAJIT_VERSION);