From: Jean-Michel Vourgère Date: Wed, 12 Aug 2015 12:00:23 +0000 (+0200) Subject: Restore lua 5.0 & 5.1 compatibility X-Git-Tag: v1.6.0~25^2~18^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F660%2Fhead;p=thirdparty%2Frrdtool-1.x.git Restore lua 5.0 & 5.1 compatibility --- diff --git a/bindings/lua/rrdlua.c b/bindings/lua/rrdlua.c index baac444d..ce484cb9 100644 --- a/bindings/lua/rrdlua.c +++ b/bindings/lua/rrdlua.c @@ -350,7 +350,13 @@ set_info (lua_State * L) /**********************************************************/ +#if defined LUA50 +static const struct luaL_reg rrd[] = { +#elif LUA_VERSION_NUM == 501 +static const struct luaL_Reg rrd[] = { +#else static const struct luaL_Reg rrd[] = { +#endif {"create", lua_rrd_create}, {"dump", lua_rrd_dump}, {"fetch", lua_rrd_fetch}, @@ -382,8 +388,11 @@ luaopen_rrd (lua_State * L) #if defined LUA50 /* luaL_module is defined in compat-5.1.c */ luaL_module (L, "rrd", rrd, 0); +#elif LUA_VERSION_NUM == 501 + /* version 5.1 */ + luaL_register (L, "rrd", rrd); #else - luaL_newlib (L, rrd); + luaL_newlib(L, rrd); #endif set_info (L); return 1;