diff options
-rw-r--r-- | src/lfs.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -819,6 +819,15 @@ static const struct luaL_Reg fslib[] = { | |||
819 | {NULL, NULL}, | 819 | {NULL, NULL}, |
820 | }; | 820 | }; |
821 | 821 | ||
822 | #if LUA_VERSION_NUM > 501 | ||
823 | static void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l) | ||
824 | { | ||
825 | luaL_newlib (L, l); | ||
826 | lua_pushvalue (L, -1); | ||
827 | lua_setglobal (L, libname); | ||
828 | } | ||
829 | #endif | ||
830 | |||
822 | int luaopen_lfs (lua_State *L) { | 831 | int luaopen_lfs (lua_State *L) { |
823 | dir_create_meta (L); | 832 | dir_create_meta (L); |
824 | lock_create_meta (L); | 833 | lock_create_meta (L); |