From: Jean Baptiste Favre Date: Fri, 25 Nov 2016 16:49:34 +0000 (+0100) Subject: Fix build against LuaJIT 2.1 X-Git-Tag: archive/raspbian/8.0.2+ds-1+rpi1~1^2^2^2^2^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=5c8e853a34b8bd74469a58610a3885b281ddb4f6;p=trafficserver.git Fix build against LuaJIT 2.1 Gbp-Pq: Name 0008-fix_build_lua.patch --- diff --git a/lib/bindings/bindings.cc b/lib/bindings/bindings.cc index a50e9512..11828577 100644 --- a/lib/bindings/bindings.cc +++ b/lib/bindings/bindings.cc @@ -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); diff --git a/lib/bindings/bindings.h b/lib/bindings/bindings.h index 7a559c86..e44cd1e2 100644 --- a/lib/bindings/bindings.h +++ b/lib/bindings/bindings.h @@ -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; diff --git a/lib/bindings/metrics.cc b/lib/bindings/metrics.cc index ae2a3a51..2154d78f 100644 --- a/lib/bindings/metrics.cc +++ b/lib/bindings/metrics.cc @@ -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}, }; diff --git a/proxy/logging/LogBindings.cc b/proxy/logging/LogBindings.cc index 2d7dbaeb..09e113ce 100644 --- a/proxy/logging/LogBindings.cc +++ b/proxy/logging/LogBindings.cc @@ -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}, };