diff options
Diffstat (limited to 'src')
| -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); |
