aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-03 17:17:46 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2021-03-03 17:17:46 +0000
commit25a8f48d565a0450aed3417c88dbeeecdad11532 (patch)
tree164c75979afb9cfa21d290f36f2cfaf5fde003e8
parent185e38c9644cbc6e31933aef87ddaf0508e1f01a (diff)
downloadrspamd-25a8f48d565a0450aed3417c88dbeeecdad11532.tar.gz
rspamd-25a8f48d565a0450aed3417c88dbeeecdad11532.zip
[Minor] More Lua 5.4 compatibility
Issue: #3656
-rw-r--r--src/lua/lua_thread_pool.c4
-rw-r--r--test/rspamd_lua_pcall_vs_resume_test.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/lua/lua_thread_pool.c b/src/lua/lua_thread_pool.c
index 1fa584c51..8220bb3ff 100644
--- a/src/lua/lua_thread_pool.c
+++ b/src/lua/lua_thread_pool.c
@@ -239,7 +239,11 @@ lua_do_resume_full (lua_State *L, gint narg, const gchar *loc)
#if LUA_VERSION_NUM < 502
return lua_resume (L, narg);
#else
+ #if LUA_VERSION_NUM >= 504
+ return lua_resume (L, from, nargs, NULL);
+ #else
return lua_resume (L, NULL, narg);
+ #endif
#endif
}
diff --git a/test/rspamd_lua_pcall_vs_resume_test.c b/test/rspamd_lua_pcall_vs_resume_test.c
index eb945b92f..c06283de1 100644
--- a/test/rspamd_lua_pcall_vs_resume_test.c
+++ b/test/rspamd_lua_pcall_vs_resume_test.c
@@ -56,6 +56,8 @@ test_resume(lua_State *L, gint function_call)
lua_rawgeti (L, LUA_REGISTRYINDEX, function_call);
#if LUA_VERSION_NUM < 502
lua_resume (L, 0);
+#elif LUA_VERSION_NUM >= 504
+ lua_resume (L, NULL, 0, NULL);
#else
lua_resume (L, NULL, 0);
#endif
@@ -82,6 +84,8 @@ test_resume_get_thread(gint function_call)
lua_rawgeti (ent->lua_state, LUA_REGISTRYINDEX, function_call);
#if LUA_VERSION_NUM < 502
lua_resume (ent->lua_state, 0);
+#elif LUA_VERSION_NUM >= 504
+ lua_resume (ent->lua_state, NULL, 0, NULL);
#else
lua_resume (ent->lua_state, NULL, 0);
#endif
@@ -110,6 +114,8 @@ test_resume_get_new_thread(gint function_call)
lua_rawgeti (ent->lua_state, LUA_REGISTRYINDEX, function_call);
#if LUA_VERSION_NUM < 502
lua_resume (ent->lua_state, 0);
+#elif LUA_VERSION_NUM >= 504
+ lua_resume (ent->lua_state, NULL, 0, NULL);
#else
lua_resume (ent->lua_state, NULL, 0);
#endif