From: Fabrice Fontaine Date: Sat, 22 Feb 2020 21:33:28 +0000 (+0100) Subject: package/luv: fix build with gcc 4.8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=62e65fd50dc64500f8aa07127ef5ac1e8cc48d6e;p=buildroot.git package/luv: fix build with gcc 4.8 Fixes: - http://autobuild.buildroot.org/results/83b34e606b128546da8a70836d039090e334a1ec Signed-off-by: Fabrice Fontaine [yann.morin.1998@free.fr: mark patch accepted upstream] Signed-off-by: Yann E. MORIN --- diff --git a/package/luv/0001-src-lreq.c-fix-build-with-gcc-4.8.patch b/package/luv/0001-src-lreq.c-fix-build-with-gcc-4.8.patch new file mode 100644 index 0000000000..7f7c480ca5 --- /dev/null +++ b/package/luv/0001-src-lreq.c-fix-build-with-gcc-4.8.patch @@ -0,0 +1,43 @@ +From d05134115ec8fcfc87188899cec336a8b4df7e62 Mon Sep 17 00:00:00 2001 +From: Fabrice Fontaine +Date: Sat, 22 Feb 2020 22:17:19 +0100 +Subject: [PATCH] src/lreq.c: fix build with gcc 4.8 + +Since commit 3e34390cc15101d7fc46ea26f5adf9ac022c2029, build fails with +gcc 4.8.3 on: + +In file included from /usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output/build/luv-1.34.1-1/src/luv.c:27:0: +/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output/build/luv-1.34.1-1/src/lreq.c: In function 'luv_cleanup_req': +/usr/lfs/hdd_v1/rc-buildroot-test/scripts/instance-0/output/build/luv-1.34.1-1/src/lreq.c:70:5: error: 'for' loop initial declarations are only allowed in C99 mode + for (int i = 0; ((int*)(data->data))[i] != LUA_NOREF; i++) { + ^ + +Fixes: + - http://autobuild.buildroot.org/results/83b34e606b128546da8a70836d039090e334a1ec + +Signed-off-by: Fabrice Fontaine +[Accepted status: https://github.com/luvit/luv/pull/456] +--- + src/lreq.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/lreq.c b/src/lreq.c +index c8e07eb..b12ec4f 100644 +--- a/src/lreq.c ++++ b/src/lreq.c +@@ -64,10 +64,11 @@ static void luv_fulfill_req(lua_State* L, luv_req_t* data, int nargs) { + } + + static void luv_cleanup_req(lua_State* L, luv_req_t* data) { ++ int i; + luaL_unref(L, LUA_REGISTRYINDEX, data->req_ref); + luaL_unref(L, LUA_REGISTRYINDEX, data->callback_ref); + if (data->data_ref == LUV_REQ_MULTIREF) { +- for (int i = 0; ((int*)(data->data))[i] != LUA_NOREF; i++) { ++ for (i = 0; ((int*)(data->data))[i] != LUA_NOREF; i++) { + luaL_unref(L, LUA_REGISTRYINDEX, ((int*)(data->data))[i]); + } + } +-- +2.25.0 +