Skip to content
This repository has been archived by the owner on Nov 20, 2020. It is now read-only.

Commit

Permalink
Merge pull request lunarmodules#17 from rrthomas/master
Browse files Browse the repository at this point in the history
Use Lua 5.2's own luaL_register
  • Loading branch information
mascarenhas committed Oct 1, 2012
2 parents d71c63c + 584066e commit 201d18a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/lfs.c
Expand Up @@ -56,6 +56,7 @@
#include <utime.h>
#endif

#define LUA_COMPAT_ALL
#include "lua.h"
#include "lauxlib.h"
#include "lualib.h"
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 201d18a

Please sign in to comment.