diff options
| author | Fabio Mascarenhas <mascarenhas@gmail.com> | 2012-10-01 11:53:35 -0700 |
|---|---|---|
| committer | Fabio Mascarenhas <mascarenhas@gmail.com> | 2012-10-01 11:53:35 -0700 |
| commit | 201d18a4977a9d74ec18480bcd7a269a5bd47596 (patch) | |
| tree | d904f0a21a424734f0ddcbced29ae5eda4080cf5 | |
| parent | d71c63cdb776f7d25313f8fcd14f07512ba1f83e (diff) | |
| parent | 584066ee868958267c3d2bf5c544c0e1449d2748 (diff) | |
| download | luafilesystem-201d18a4977a9d74ec18480bcd7a269a5bd47596.tar.gz luafilesystem-201d18a4977a9d74ec18480bcd7a269a5bd47596.tar.bz2 luafilesystem-201d18a4977a9d74ec18480bcd7a269a5bd47596.zip | |
Merge pull request #17 from rrthomas/master
Use Lua 5.2's own luaL_register
| -rw-r--r-- | src/lfs.c | 10 |
1 files changed, 1 insertions, 9 deletions
| @@ -56,6 +56,7 @@ | |||
| 56 | #include <utime.h> | 56 | #include <utime.h> |
| 57 | #endif | 57 | #endif |
| 58 | 58 | ||
| 59 | #define LUA_COMPAT_ALL | ||
| 59 | #include "lua.h" | 60 | #include "lua.h" |
| 60 | #include "lauxlib.h" | 61 | #include "lauxlib.h" |
| 61 | #include "lualib.h" | 62 | #include "lualib.h" |
| @@ -877,15 +878,6 @@ static const struct luaL_Reg fslib[] = { | |||
| 877 | {NULL, NULL}, | 878 | {NULL, NULL}, |
| 878 | }; | 879 | }; |
| 879 | 880 | ||
| 880 | #if LUA_VERSION_NUM > 501 | ||
| 881 | static void luaL_register (lua_State *L, const char *libname, const luaL_Reg *l) | ||
| 882 | { | ||
| 883 | luaL_newlib (L, l); | ||
| 884 | lua_pushvalue (L, -1); | ||
| 885 | lua_setglobal (L, libname); | ||
| 886 | } | ||
| 887 | #endif | ||
| 888 | |||
| 889 | int luaopen_lfs (lua_State *L) { | 881 | int luaopen_lfs (lua_State *L) { |
| 890 | dir_create_meta (L); | 882 | dir_create_meta (L); |
| 891 | lock_create_meta (L); | 883 | lock_create_meta (L); |
