aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 @@
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[] = {
943LFS_EXPORT int luaopen_lfs (lua_State *L) { 945LFS_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);