mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-22 02:53:06 +00:00
Fix compilation warning for LuaJIT 2.1
Do not redefine or reimplement standard Lua C API function luaL_newlib, use another name (new_lib) instead.
This commit is contained in:
@@ -80,8 +80,10 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if LUA_VERSION_NUM < 502
|
#if LUA_VERSION_NUM >= 502
|
||||||
# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
|
# define new_lib(L, l) (luaL_newlib(L, l))
|
||||||
|
#else
|
||||||
|
# define new_lib(L, l) (lua_newtable(L), luaL_register(L, NULL, l))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Define 'strerror' for systems that do not implement it */
|
/* Define 'strerror' for systems that do not implement it */
|
||||||
@@ -943,7 +945,7 @@ static const struct luaL_Reg fslib[] = {
|
|||||||
LFS_EXPORT int luaopen_lfs (lua_State *L) {
|
LFS_EXPORT int luaopen_lfs (lua_State *L) {
|
||||||
dir_create_meta (L);
|
dir_create_meta (L);
|
||||||
lock_create_meta (L);
|
lock_create_meta (L);
|
||||||
luaL_newlib (L, fslib);
|
new_lib (L, fslib);
|
||||||
lua_pushvalue(L, -1);
|
lua_pushvalue(L, -1);
|
||||||
lua_setglobal(L, LFS_LIBNAME);
|
lua_setglobal(L, LFS_LIBNAME);
|
||||||
set_info (L);
|
set_info (L);
|
||||||
|
|||||||
Reference in New Issue
Block a user