From dad97bc104c331e38d7c6e13c8d4847a3b4c3dad Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Mon, 24 Jun 2013 14:29:58 +0000 Subject: [PATCH] add support for lua5.2 The default is still lua5.1 but 5.2 can be picked at compile time but setting UWSGICONFIG_LUAPC=lua5.2 --- plugins/lua/lua_plugin.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/lua/lua_plugin.c b/plugins/lua/lua_plugin.c index e2c9dcc3..ff9256e1 100644 --- a/plugins/lua/lua_plugin.c +++ b/plugins/lua/lua_plugin.c @@ -4,6 +4,11 @@ #include #include +#if LUA_VERSION_NUM < 502 +# define luaL_newlib(L,l) (lua_newtable(L), luaL_register(L,NULL,l)) +# define lua_rawlen lua_objlen +#endif + extern struct uwsgi_server uwsgi; struct uwsgi_lua { @@ -411,7 +416,7 @@ static void uwsgi_lua_app() { for(i=0;i