summaryrefslogtreecommitdiff
path: root/degesch.c
diff options
context:
space:
mode:
authorPřemysl Eric Janouch <p@janouch.name>2020-09-02 19:05:20 +0200
committerPřemysl Eric Janouch <p@janouch.name>2020-09-02 20:00:09 +0200
commitba1c2357af62a61e8084d77783868a10815b8556 (patch)
tree8ea980d4af7736007a9b9c78ccfed76f1892ff2d /degesch.c
parenta48023553ec7a0133e0a7bed20e0271ceb1acfbd (diff)
downloadxK-ba1c2357af62a61e8084d77783868a10815b8556.tar.gz
xK-ba1c2357af62a61e8084d77783868a10815b8556.tar.xz
xK-ba1c2357af62a61e8084d77783868a10815b8556.zip
degesch: fix Lua 5.4 build
Not sure about how well it works yet. Lua 5.3 is still made preferential by the order of pkgconfig lookup.
Diffstat (limited to 'degesch.c')
-rw-r--r--degesch.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/degesch.c b/degesch.c
index 5afd49c..5ba7a42 100644
--- a/degesch.c
+++ b/degesch.c
@@ -9646,12 +9646,19 @@ lua_task_resume (struct lua_task *self, int index)
n = 2;
}
+#if LUA_VERSION_NUM >= 504
+ int nresults = 0;
+ int res = lua_resume (L, NULL, n, &nresults);
+#else
int res = lua_resume (L, NULL, n);
+ int nresults = lua_gettop (L);
+#endif
+
struct error *error = NULL;
if (res == LUA_YIELD)
{
// AFAIK we don't get any good error context information from here
- if (lua_task_schedule (self, lua_gettop (L), &error))
+ if (lua_task_schedule (self, nresults, &error))
return;
}
// For simplicity ignore any results from successful returns