From f51d730955e5d88be0e8db191407687b8a0321d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jean-Michel=20Vourg=C3=A8re?= Date: Wed, 12 Aug 2015 14:00:23 +0200 Subject: [PATCH] Restore lua 5.0 & 5.1 compatibility --- bindings/lua/rrdlua.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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; -- 2.47.2