From 5a2e166f5aeedecdb637d14db5d840396b8d62c3 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Fri, 8 May 2015 19:02:15 +0200 Subject: nopsyncd builds now using Lua 5.2 diff --git a/src/l_pipe.c b/src/l_pipe.c index 3812905..dd08fd1 100644 --- a/src/l_pipe.c +++ b/src/l_pipe.c @@ -123,7 +123,7 @@ static int l_pipe_consume(lua_State *L) return 1; } -static const struct luaL_reg pipe_funcs [] = { +static const struct luaL_Reg pipe_funcs [] = { { "signal", l_pipe_signal }, { "getreadfd", l_pipe_getreadfd }, { "consume", l_pipe_consume }, @@ -132,6 +132,13 @@ static const struct luaL_reg pipe_funcs [] = { LUALIB_API int luaopen_pipe(lua_State *L) { +#if LUA_VERSION_NUM > 501 + lua_newtable(L); + luaL_setfuncs(L, pipe_funcs, 0); + lua_pushvalue(L, -1); + lua_setglobal(L, LUA_PIPELIBNAME); +#else luaL_register(L, LUA_PIPELIBNAME, pipe_funcs); +#endif return 1; } -- cgit v0.10.2