aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2017-04-07 12:21:41 +0200
committerMike Pall <mike>2017-04-07 12:21:41 +0200
commitc67a0982920b94f081a5e2a4e65efc6851e78500 (patch)
treea9e36fbe2e0753caa82c207ec4392c278f75f106 /src
parent9c685f7003388725c91ef38627113015676b6d65 (diff)
downloadluajit-c67a0982920b94f081a5e2a4e65efc6851e78500.tar.gz
luajit-c67a0982920b94f081a5e2a4e65efc6851e78500.tar.bz2
luajit-c67a0982920b94f081a5e2a4e65efc6851e78500.zip
From Lua 5.2: Add lua_version().
Contributed by François Perrad.
Diffstat (limited to 'src')
-rw-r--r--src/lj_api.c7
-rw-r--r--src/lua.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/lj_api.c b/src/lj_api.c
index 711c7e9d..f0f41766 100644
--- a/src/lj_api.c
+++ b/src/lj_api.c
@@ -112,6 +112,13 @@ LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
112 from->top = f; 112 from->top = f;
113} 113}
114 114
115LUA_API const lua_Number *lua_version(lua_State *L)
116{
117 static const lua_Number version = LUA_VERSION_NUM;
118 UNUSED(L);
119 return &version;
120}
121
115/* -- Stack manipulation -------------------------------------------------- */ 122/* -- Stack manipulation -------------------------------------------------- */
116 123
117LUA_API int lua_gettop(lua_State *L) 124LUA_API int lua_gettop(lua_State *L)
diff --git a/src/lua.h b/src/lua.h
index 3d527401..f067483a 100644
--- a/src/lua.h
+++ b/src/lua.h
@@ -348,6 +348,7 @@ LUA_API void *lua_upvalueid (lua_State *L, int idx, int n);
348LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2); 348LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);
349LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt, 349LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,
350 const char *chunkname, const char *mode); 350 const char *chunkname, const char *mode);
351LUA_API const lua_Number *lua_version (lua_State *L);
351 352
352 353
353struct lua_Debug { 354struct lua_Debug {