summaryrefslogtreecommitdiffstats
path: root/lua-posixtz.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2013-10-07 16:43:35 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2013-10-07 16:43:35 +0200
commit6b43aa3ad0c4d41ec0f83add4cabc7361b1e327b (patch)
treedda3ba086f0f135671c35370673cc89c2063d580 /lua-posixtz.c
parentaec67b4e608465017ad67665f8cd1f37ae35d6cc (diff)
downloadposixtz-9d584f93fb343e3228e05151fe5b33cbbf68be16.tar.bz2
posixtz-9d584f93fb343e3228e05151fe5b33cbbf68be16.tar.xz
support for Lua 5.2v0.4
Diffstat (limited to 'lua-posixtz.c')
-rw-r--r--lua-posixtz.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/lua-posixtz.c b/lua-posixtz.c
index a641ac6..b87f2e9 100644
--- a/lua-posixtz.c
+++ b/lua-posixtz.c
@@ -6,6 +6,10 @@
#define MYNAME "posixtz"
+#if LUA_VERSION_NUM < 502
+# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l))
+#endif
+
static int Pfrom_file(lua_State *L)
{
const char *s = luaL_checkstring(L, 1);
@@ -13,15 +17,14 @@ static int Pfrom_file(lua_State *L)
return 1;
}
-static const luaL_reg R[] =
+static const luaL_Reg R[] =
{
{"from_file", Pfrom_file},
NULL, NULL
};
-
LUALIB_API int luaopen_posixtz_core(lua_State *L)
{
- luaL_register(L,MYNAME,R);
+ luaL_newlib(L, R);
return 1;
}