diff options
author | Peter Melnichenko <mpeterval@gmail.com> | 2017-09-14 12:01:00 +0300 |
---|---|---|
committer | Peter Melnichenko <mpeterval@gmail.com> | 2017-09-14 12:01:00 +0300 |
commit | a84d81bc52590f930e54f108099df5d155bdc8bf (patch) | |
tree | d90eb7a222c7894e8fbfa46e1e496ef0eae2a221 | |
parent | a90ec38133a131073b2a5a86f3072605daafb554 (diff) | |
download | luafilesystem-a84d81bc52590f930e54f108099df5d155bdc8bf.tar.gz luafilesystem-a84d81bc52590f930e54f108099df5d155bdc8bf.tar.bz2 luafilesystem-a84d81bc52590f930e54f108099df5d155bdc8bf.zip |
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.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -80,8 +80,10 @@ | |||
80 | 80 | ||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #if LUA_VERSION_NUM < 502 | 83 | #if LUA_VERSION_NUM >= 502 |
84 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) | 84 | # define new_lib(L, l) (luaL_newlib(L, l)) |
85 | #else | ||
86 | # define new_lib(L, l) (lua_newtable(L), luaL_register(L, NULL, l)) | ||
85 | #endif | 87 | #endif |
86 | 88 | ||
87 | /* Define 'strerror' for systems that do not implement it */ | 89 | /* Define 'strerror' for systems that do not implement it */ |
@@ -943,7 +945,7 @@ static const struct luaL_Reg fslib[] = { | |||
943 | LFS_EXPORT int luaopen_lfs (lua_State *L) { | 945 | LFS_EXPORT int luaopen_lfs (lua_State *L) { |
944 | dir_create_meta (L); | 946 | dir_create_meta (L); |
945 | lock_create_meta (L); | 947 | lock_create_meta (L); |
946 | luaL_newlib (L, fslib); | 948 | new_lib (L, fslib); |
947 | lua_pushvalue(L, -1); | 949 | lua_pushvalue(L, -1); |
948 | lua_setglobal(L, LFS_LIBNAME); | 950 | lua_setglobal(L, LFS_LIBNAME); |
949 | set_info (L); | 951 | set_info (L); |