diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lfs.c | 20 |
1 files changed, 7 insertions, 13 deletions
@@ -56,20 +56,14 @@ | |||
56 | #include <utime.h> | 56 | #include <utime.h> |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | #define LUA_COMPAT_ALL | 59 | #include <lua.h> |
60 | #include "lua.h" | 60 | #include <lauxlib.h> |
61 | #include "lauxlib.h" | 61 | #include <lualib.h> |
62 | #include "lualib.h" | ||
63 | #include "lfs.h" | ||
64 | 62 | ||
65 | /* | 63 | #include "lfs.h" |
66 | * ** compatibility with Lua 5.2 | ||
67 | * */ | ||
68 | #if (LUA_VERSION_NUM == 502) | ||
69 | #undef luaL_register | ||
70 | #define luaL_register(L,n,f) \ | ||
71 | { if ((n) == NULL) luaL_setfuncs(L,f,0); else luaL_newlib(L,f); } | ||
72 | 64 | ||
65 | #if LUA_VERSION_NUM < 502 | ||
66 | # define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) | ||
73 | #endif | 67 | #endif |
74 | 68 | ||
75 | /* Define 'strerror' for systems that do not implement it */ | 69 | /* Define 'strerror' for systems that do not implement it */ |
@@ -881,7 +875,7 @@ static const struct luaL_Reg fslib[] = { | |||
881 | int luaopen_lfs (lua_State *L) { | 875 | int luaopen_lfs (lua_State *L) { |
882 | dir_create_meta (L); | 876 | dir_create_meta (L); |
883 | lock_create_meta (L); | 877 | lock_create_meta (L); |
884 | luaL_register (L, "lfs", fslib); | 878 | luaL_newlib (L, fslib); |
885 | set_info (L); | 879 | set_info (L); |
886 | return 1; | 880 | return 1; |
887 | } | 881 | } |