xref: /OK3568_Linux_fs/buildroot/package/python-hiredis/0001-setup.py-fix-build-with-gcc-4.8.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1From 204898e28c7650089bf664eea8adfc16a22ba4f4 Mon Sep 17 00:00:00 2001
2From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
3Date: Tue, 6 Apr 2021 10:37:49 +0200
4Subject: [PATCH] setup.py: fix build with gcc 4.8
5
6Fix the following build failure on gcc 4.8 which is raised since version
72.0.0 and
8https://github.com/redis/hiredis-py/commit/9084152f624e8e593b4e86ddf8bd13329fdfc043:
9
10vendor/hiredis/read.c: In function 'redisReaderFree':
11vendor/hiredis/read.c:646:9: error: 'for' loop initial declarations are only allowed in C99 mode
12         for (int i = 0; i < r->tasks; i++) {
13         ^
14vendor/hiredis/read.c:646:9: note: use option -std=c99 or -std=gnu99 to compile your code
15
16This build failure is raised because hiredis source code is built
17without C99:
18https://github.com/redis/hiredis/commit/13a35bdb64615e381c5e1151cdd4e78bba71a6db
19
20Fixes:
21 - http://autobuild.buildroot.org/results/04cbcddf6d83ebad8c98400754f9445375e9e489
22
23Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
24[Upstream status: https://github.com/redis/hiredis-py/pull/110]
25---
26 setup.py | 1 +
27 1 file changed, 1 insertion(+)
28
29diff --git a/setup.py b/setup.py
30index d83153b..1f623c9 100755
31--- a/setup.py
32+++ b/setup.py
33@@ -13,6 +13,7 @@ def version():
34 ext = Extension("hiredis.hiredis",
35   sources=sorted(glob.glob("src/*.c") +
36                  ["vendor/hiredis/%s.c" % src for src in ("alloc", "read", "sds")]),
37+  extra_compile_args=["-std=c99"],
38   include_dirs=["vendor"])
39
40 setup(
41--
422.30.2
43
44