Skip to content

Commit

Permalink
From Lua 5.2: Add lua_version().
Browse files Browse the repository at this point in the history
Contributed by François Perrad.
  • Loading branch information
Mike Pall committed Apr 7, 2017
1 parent 9c685f7 commit c67a098
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lj_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,13 @@ LUA_API void lua_xmove(lua_State *from, lua_State *to, int n)
from->top = f;
}

LUA_API const lua_Number *lua_version(lua_State *L)
{
static const lua_Number version = LUA_VERSION_NUM;
UNUSED(L);
return &version;
}

/* -- Stack manipulation -------------------------------------------------- */

LUA_API int lua_gettop(lua_State *L)
Expand Down
1 change: 1 addition & 0 deletions src/lua.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ LUA_API void *lua_upvalueid (lua_State *L, int idx, int n);
LUA_API void lua_upvaluejoin (lua_State *L, int idx1, int n1, int idx2, int n2);
LUA_API int lua_loadx (lua_State *L, lua_Reader reader, void *dt,
const char *chunkname, const char *mode);
LUA_API const lua_Number *lua_version (lua_State *L);


struct lua_Debug {
Expand Down

0 comments on commit c67a098

Please sign in to comment.