]> git.ipfire.org Git - thirdparty/rrdtool-1.x.git/commitdiff
Restore lua 5.0 & 5.1 compatibility 660/head
authorJean-Michel Vourgère <nirgal@debian.org>
Wed, 12 Aug 2015 12:00:23 +0000 (14:00 +0200)
committerJean-Michel Vourgère <nirgal@debian.org>
Wed, 12 Aug 2015 12:00:23 +0000 (14:00 +0200)
bindings/lua/rrdlua.c

index baac444d35962bfd69f4c3770851277206d04cca..ce484cb96130d4b6b55897dd6f970c7678e425ef 100644 (file)
@@ -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;