Skip to content

Commit

Permalink
add LuaJIT 2.1 detect
Browse files Browse the repository at this point in the history
  • Loading branch information
starwing committed Nov 24, 2023
1 parent 61fa148 commit abd45ae
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lua-physfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
# define LUA_OK 0
# define lua_rawlen lua_objlen
# define luaL_setfuncs(L,libs,nup) luaL_register(L, NULL, libs)

#ifndef LUA_GCISRUNNING /* not LuaJIT 2.1 */

#define luaL_newlibtable(L,l) \
lua_createtable(L, 0, sizeof(l)/sizeof((l)[0]) - 1)
#define luaL_newlib(L,l) \
Expand Down Expand Up @@ -61,6 +64,8 @@ static lua_Integer lua_tointegerx(lua_State *L, int idx, int *isint) {
return v;
}

#endif /* not LuaJIT 2.1 */

#endif

#if LUA_VERSION_NUM < 503
Expand Down

0 comments on commit abd45ae

Please sign in to comment.