]> git.ipfire.org Git - thirdparty/apache/httpd.git/commit
mod_lua: Improve compatibility with Lua 5.1, 5.2 and 5.3.
authorRainer Jung <rjung@apache.org>
Tue, 4 Jul 2017 22:28:38 +0000 (22:28 +0000)
committerRainer Jung <rjung@apache.org>
Tue, 4 Jul 2017 22:28:38 +0000 (22:28 +0000)
commit9552c8947cd919a59d9ff2dbe45d842de5cce991
tree6dfc971b1095e3d19933470bab012b88802b4835
parentaae325c3c046891fa19bb906d970e18d27460af8
mod_lua: Improve compatibility with Lua 5.1, 5.2 and 5.3.
PR58188, PR60831, PR61245.

CTR

The following lua 5.2 and 5.3 compat change
should be checked for runtime correctness
by someone more knowledgeable about lua.

Index: modules/lua/lua_apr.c
--- modules/lua/lua_apr.c (original)
+++ modules/lua/lua_apr.c Tue Jul  4 20:48:43 2017
@@ -82,7 +82,11 @@ static const luaL_Reg lua_table_methods[
 int ap_lua_init(lua_State *L, apr_pool_t *p)
 {
     luaL_newmetatable(L, "Apr.Table");
+#if LUA_VERSION_NUM < 502
     luaL_register(L, "apr_table", lua_table_methods);
+#else
+    luaL_newlib(L, lua_table_methods);
+#endif
     lua_pushstring(L, "__index");
     lua_pushstring(L, "get");
     lua_gettable(L, 2);

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1800835 13f79535-47bb-0310-9956-ffa450edef68
CHANGES
modules/lua/README
modules/lua/config.m4
modules/lua/lua_apr.c
modules/lua/lua_config.c
modules/lua/lua_request.c
modules/lua/mod_lua.c
modules/lua/mod_lua.h