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
# These defines will come after DEFINES
#
XDEFINES += \
+ -DLUA_COMPAT_ALL \
$(EOLIST)
#
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}
#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
*/