* move libffi to base/ Category
[t2sde.git] / package / lua / lgi / hotfix-lua54.patch
blob2acffc5b792fe09b7a75d5b6392b664995fdf616
1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # T2 SDE: package/*/lgi/hotfix-lua54.patch
3 # Copyright (C) 2024 The T2 SDE Project
4 #
5 # This Copyright note is generated by scripts/Create-CopyPatch,
6 # more information can be found in the files COPYING and README.
7 #
8 # This patch file is dual-licensed. It is available under the license the
9 # patched project is licensed under, as long as it is an OpenSource license
10 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
11 # of the GNU General Public License version 2 as used by the T2 SDE.
12 # --- T2-COPYRIGHT-NOTE-END ---
14 From 5cfd42c386d3adae6d211fbb4011179c3c141b04 Mon Sep 17 00:00:00 2001
15 From: Uli Schlachter <psychon@znc.in>
16 Date: Sun, 2 Aug 2020 16:14:27 +0200
17 Subject: [PATCH] Fix the build with Lua 5.4
19 Lua 5.4 changed the API to lua_resume(). This commit changes the code to
20 cope with that.
22 Signed-off-by: Uli Schlachter <psychon@znc.in>
23 ---
24 lgi/callable.c | 5 ++++-
25 1 file changed, 4 insertions(+), 1 deletion(-)
27 diff --git a/lgi/callable.c b/lgi/callable.c
28 index e96d3af4..3234b64f 100644
29 --- a/lgi/callable.c
30 +++ b/lgi/callable.c
31 @@ -1355,7 +1355,10 @@ closure_callback (ffi_cif *cif, void *ret, void **args, void *closure_arg)
33 else
35 -#if LUA_VERSION_NUM >= 502
36 +#if LUA_VERSION_NUM >= 504
37 + int nresults;
38 + res = lua_resume (L, NULL, npos, &nresults);
39 +#elif LUA_VERSION_NUM >= 502
40 res = lua_resume (L, NULL, npos);
41 #else
42 res = lua_resume (L, npos);