Fix build against LuaJIT 2.1
authorJean Baptiste Favre <debian@jbfavre.org>
Fri, 25 Nov 2016 16:49:34 +0000 (17:49 +0100)
committerJean Baptiste Favre <debian@jbfavre.org>
Mon, 6 Aug 2018 08:56:14 +0000 (09:56 +0100)
Gbp-Pq: Name 0008-fix_build_lua.patch

lib/bindings/bindings.cc
lib/bindings/bindings.h
lib/bindings/metrics.cc
proxy/logging/LogBindings.cc

index a50e9512e5b73ea6132dd287dee2234aa52511ba..1182857729c2796129d31db944edd0bfb4be5d4a 100644 (file)
@@ -327,7 +327,7 @@ BindingInstance::typecheck(lua_State *lua, const char *name, ...)
 }
 
 void
-BindingInstance::register_metatable(lua_State *lua, const char *name, const luaL_reg *metatable)
+BindingInstance::register_metatable(lua_State *lua, const char *name, const luaL_Reg *metatable)
 {
   // Create a metatable, adding it to the Lua registry.
   luaL_newmetatable(lua, name);
index 7a559c865c3f3ae712f87ea8627c297405130d30..e44cd1e24401cc07c814cc62183c9d9da85e1260 100644 (file)
@@ -61,7 +61,7 @@ struct BindingInstance {
   static BindingInstance *self(lua_State *);
 
   // Register a Lua metatable for a custom type.
-  static void register_metatable(lua_State *, const char *, const luaL_reg *);
+  static void register_metatable(lua_State *, const char *, const luaL_Reg *);
 
   lua_State *lua;
 
index ae2a3a5194f5f26852e94d235099821c67c3c1ef..2154d78fa2a670a3455535d75d1f009254dbf5c0 100644 (file)
@@ -196,7 +196,7 @@ lua_metrics_new(const char *prefix, lua_State *L)
 void
 lua_metrics_register(lua_State *L)
 {
-  static const luaL_reg metatable[] = {
+  static const luaL_Reg metatable[] = {
     {"__gc", metrics_gc}, {"__index", metrics_index}, {"__newindex", metrics_newindex}, {nullptr, nullptr},
   };
 
index 2d7dbaebd898638f25cb4e7b2c36eca742faf1eb..09e113ce9f4b2814d9754a1a2bd49d8d242fbe01 100644 (file)
@@ -179,7 +179,7 @@ log_object_add_hosts(lua_State *L, LogObject *log, int value, bool top)
   if (lua_istable(L, value)) {
     lua_scoped_stack saved(L);
 
-    int count   = luaL_getn(L, value);
+    int count   = lua_objlen(L, value);
     LogHost *lh = nullptr;
 
     saved.push_value(value); // Push the table to -1.
@@ -257,7 +257,7 @@ log_object_add_filters(lua_State *L, LogObject *log, int value)
   if (lua_istable(L, value)) {
     lua_scoped_stack saved(L);
     LogFilter *filter;
-    int count = luaL_getn(L, value);
+    int count = lua_objlen(L, value);
 
     saved.push_value(value); // Push the table to -1.
 
@@ -391,7 +391,7 @@ create_pipe_log_object(lua_State *L)
 bool
 MakeLogBindings(BindingInstance &binding, LogConfig *conf)
 {
-  static const luaL_reg metatable[] = {
+  static const luaL_Reg metatable[] = {
     {"__gc", refcount_object_gc}, {nullptr, nullptr},
   };