mirror of
https://github.com/lunarmodules/luafilesystem.git
synced 2026-07-22 02:53:06 +00:00
Merge pull request #17 from rrthomas/master
Use Lua 5.2's own luaL_register
This commit is contained in:
10
src/lfs.c
10
src/lfs.c
@@ -56,6 +56,7 @@
|
||||
#include <utime.h>
|
||||
#endif
|
||||
|
||||
#define LUA_COMPAT_ALL
|
||||
#include "lua.h"
|
||||
#include "lauxlib.h"
|
||||
#include "lualib.h"
|
||||
@@ -877,15 +878,6 @@ static const struct luaL_Reg fslib[] = {
|
||||
{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) {
|
||||
dir_create_meta (L);
|
||||
lock_create_meta (L);
|
||||
|
||||
Reference in New Issue
Block a user