diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-19 14:24:33 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-06-19 14:24:33 +0000 |
commit | a1e597c7273908071d69644b07e15c1a97c87378 (patch) | |
tree | d1697d4042a48721553e2cf996c7c776c88cb393 | |
parent | 84f817704ce4a111e0a128543036d1d828f9d781 (diff) | |
download | lua-openrc-a1e597c7273908071d69644b07e15c1a97c87378.tar.bz2 lua-openrc-a1e597c7273908071d69644b07e15c1a97c87378.tar.xz |
-rw-r--r-- | rc.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -7,6 +7,9 @@ #include "lualib.h" #include "lauxlib.h" +#if LUA_VERSION_NUM < 502 +# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) +#endif #define MYNAME "rc" #define MYVERSION "OpenRC library for " LUA_VERSION " version " VERSION @@ -238,7 +241,7 @@ static int Psys(lua_State *L) return 1; } -static const luaL_reg R[] = +static const luaL_Reg R[] = { {"runlevel_get", Prunlevel_get}, {"runlevel_exists", Prunlevel_exists}, @@ -269,7 +272,7 @@ static const luaL_reg R[] = LUALIB_API int luaopen_rc (lua_State *L) { - luaL_register(L, MYNAME, R); + luaL_newlib(L, R); set_literal("version", MYVERSION); /** version */ set_literal("initdir", RC_INITDIR); /** initdir */ |