Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/keplerproject/luafilesystem.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2017-09-14 12:01:00 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2017-09-14 12:01:00 +0300
commita84d81bc52590f930e54f108099df5d155bdc8bf (patch)
treed90eb7a222c7894e8fbfa46e1e496ef0eae2a221
parenta90ec38133a131073b2a5a86f3072605daafb554 (diff)
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.
-rw-r--r--src/lfs.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lfs.c b/src/lfs.c
index 25122a3..886add0 100644
--- a/src/lfs.c
+++ b/src/lfs.c
@@ -80,8 +80,10 @@
#endif
-#if LUA_VERSION_NUM < 502
-# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
+#if LUA_VERSION_NUM >= 502
+# define new_lib(L, l) (luaL_newlib(L, l))
+#else
+# define new_lib(L, l) (lua_newtable(L), luaL_register(L, NULL, l))
#endif
/* 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) {
dir_create_meta (L);
lock_create_meta (L);
- luaL_newlib (L, fslib);
+ new_lib (L, fslib);
lua_pushvalue(L, -1);
lua_setglobal(L, LFS_LIBNAME);
set_info (L);