lfs.c: use Lua 5.2's own luaL_register

This commit is contained in:
Reuben Thomas
2012-10-01 19:44:00 +01:00
parent d71c63cdb7
commit 584066ee86

View File

@@ -56,6 +56,7 @@
#include <utime.h> #include <utime.h>
#endif #endif
#define LUA_COMPAT_ALL
#include "lua.h" #include "lua.h"
#include "lauxlib.h" #include "lauxlib.h"
#include "lualib.h" #include "lualib.h"
@@ -877,15 +878,6 @@ static const struct luaL_Reg fslib[] = {
{NULL, NULL}, {NULL, NULL},
}; };
#if LUA_VERSION_NUM > 501
static void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l)
{
luaL_newlib (L, l);
lua_pushvalue (L, -1);
lua_setglobal (L, libname);
}
#endif
int luaopen_lfs (lua_State *L) { int luaopen_lfs (lua_State *L) {
dir_create_meta (L); dir_create_meta (L);
lock_create_meta (L); lock_create_meta (L);