]> granicus.if.org Git - apache/commitdiff
Improve Lua 5.2.0 compatibility.
authorRainer Jung <rjung@apache.org>
Wed, 1 Feb 2012 13:17:46 +0000 (13:17 +0000)
committerRainer Jung <rjung@apache.org>
Wed, 1 Feb 2012 13:17:46 +0000 (13:17 +0000)
This is not yet complete. Building should
still work with Lua 5.1.4, but needs
-DLUA_COMPAT_ALL in CPPFLAGS when compiled
against 5.2.0. Automatically handling
this in configure is still a TODO.

Backport from trunk of the following revisions:

r1221205: Make mod_lua compile with lua 5.2.x.
MOdified patch submitted by NormW (nornw gknw net).

r1239029: luaL_reg was already deprecated in Lua 5.1.4.
It is gone in Lua 5.2.0 and was replaced by luaL_Reg
which already existed in 5.1.4. So use that one.

r1239030: Remove luaL_reg macro definition no longer needed
and simplify lua_load compatibility macro.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1239120 13f79535-47bb-0310-9956-ffa450edef68

modules/lua/NWGNUmakefile
modules/lua/lua_apr.c
modules/lua/mod_lua.h

index dcff6679c4228e6d1c488bf6ea09741b58206699..36d0a699b489416cd3f35f597a38e2f66df8c1c1 100644 (file)
@@ -44,6 +44,7 @@ XCFLAGS               += \
 # These defines will come after DEFINES
 #
 XDEFINES       += \
+                       -DLUA_COMPAT_ALL \
                        $(EOLIST)
 
 #
index ad396e66f5de554964e9d92e2321cfce0cc3198c..c93ea9b1e1f9bbed215c74d55794cfc4d8bde5b6 100644 (file)
@@ -65,7 +65,7 @@ static int lua_table_get(lua_State *L)
     return 1;
 }
 
-static const luaL_reg lua_table_methods[] = {
+static const luaL_Reg lua_table_methods[] = {
     {"set", lua_table_set},
     {"get", lua_table_get},
     {0, 0}
index 16627240eb2341d359d84f813e85a03b578793a3..5394f7a48501d621e721d78134a3c3d4f7c3aee4 100644 (file)
 #include "lauxlib.h"
 #include "lualib.h"
 
+#if LUA_VERSION_NUM > 501
+/* Load mode for lua_load() */
+#define lua_load(a,b,c,d) lua_load(a,b,c,d,NULL)
+#endif
+
 /* Create a set of AP_LUA_DECLARE(type), AP_LUA_DECLARE_NONSTD(type) and
  * AP_LUA_DECLARE_DATA with appropriate export and import tags for the platform
  */