LuaJIT 2.1.0 added luaL_newlib() as extension

This commit is contained in:
Bruno Silvestre 2017-09-26 17:39:32 -03:00
parent fe1fb0b350
commit 60f02f7701

View File

@ -14,9 +14,13 @@
#endif
#if (LUA_VERSION_NUM == 501)
#define setfuncs(L, R) luaL_register(L, NULL, R)
#define lua_rawlen(L, i) lua_objlen(L, i)
#ifndef luaL_newlib
#define luaL_newlib(L, R) do { lua_newtable(L); luaL_register(L, NULL, R); } while(0)
#endif
#else
#define setfuncs(L, R) luaL_setfuncs(L, R, 0)
#endif