wok-next view wvstreams/stuff/patches/package-wvstreams-add-patch-to-fix-build-with-C99-compilers.patch @ rev 20297

Up spl (0.7.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Thu Nov 09 21:37:23 2017 +0100 (2017-11-09)
parents
children
line source
1 From patchwork Fri Sep 23 21:42:27 2016
2 Content-Type: text/plain; charset="utf-8"
3 MIME-Version: 1.0
4 Content-Transfer-Encoding: 8bit
5 Subject: package/wvstreams: add patch to fix build with C99 compilers
6 X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?=
7 <joerg.krause@embedded.rocks>
8 X-Patchwork-Id: 674238
9 Message-Id: <20160923214227.12888-1-joerg.krause@embedded.rocks>
10 To: buildroot@buildroot.org
11 Date: Fri, 23 Sep 2016 23:42:27 +0200
12 From: =?UTF-8?q?J=C3=B6rg=20Krause?= <joerg.krause@embedded.rocks>
13 List-Id: Discussion and development of buildroot <buildroot.busybox.net>
15 wvstreams uses a bundled version of argp. Compiling argp fails for all
16 compilers not using the C89 standard by default:
18 """
19 In file included from argp-fmtstream.c:35:0:
20 argp-namefrob.h:62:32: error: redefinition of ‘argp_fmtstream_write’
21 #define __argp_fmtstream_write argp_fmtstream_write
22 ^
23 argp-fmtstream.c:395:1: note: in expansion of macro
24 ‘__argp_fmtstream_write’
25 __argp_fmtstream_write (argp_fmtstream_t __fs,
26 ^
27 In file included from argp-fmtstream.c:34:0:
28 argp-fmtstream.h:209:32: note: previous definition of
29 ‘argp_fmtstream_write’ was here
30 #define __argp_fmtstream_write argp_fmtstream_write
31 ^
32 argp-fmtstream.h:223:1: note: in expansion of macro
33 ‘__argp_fmtstream_write’
34 __argp_fmtstream_write (argp_fmtstream_t __fs,
35 ^
36 """
38 The issue is that C99 changed inline semantics. This patch takes these
39 changes into account and allows to build the bundled argp and therefore
40 wvstreams with non-C89-compilers.
42 Note, that wvstreams is not maintained anymore. Last activity was on
43 Github was 2011, the current version 1.6.1 dates from 2009.
45 Fetch-from: http://review.gluster.org/6034
47 Fixes:
48 http://autobuild.buildroot.net/results/f01/f0166f030875ecaf0d757790de6361339071831e/
49 http://autobuild.buildroot.net/results/32b/32b4eba8c7cbe8a3b1cde2d67f1af3f913fcc292/
50 http://autobuild.buildroot.net/results/38f/38fefa126596c6e267ffaf0f2dd9c5e3dcf09aff/
51 http://autobuild.buildroot.net/results/ea2/ea223c8a4f817541f55aa36c47b159a316031bff/
52 .. and many more.
54 Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
55 ---
56 .../0006-fix-build-with-C99-compilers.patch | 105 +++++++++++++++++++++
57 1 file changed, 105 insertions(+)
58 create mode 100644 package/wvstreams/0006-fix-build-with-C99-compilers.patch
60 diff --git a/package/wvstreams/0006-fix-build-with-C99-compilers.patch b/package/wvstreams/0006-fix-build-with-C99-compilers.patch
61 new file mode 100644
62 index 0000000..2bd34a0
63 --- /dev/null
64 +++ b/package/wvstreams/0006-fix-build-with-C99-compilers.patch
65 @@ -0,0 +1,105 @@
66 +From b2dfa011a3fdcb7d22764d143517d0fbd1c2a201 Mon Sep 17 00:00:00 2001
67 +From: Emmanuel Dreyfus <manu@netbsd.org>
68 +Date: Wed, 22 Jan 2014 14:47:23 +0100
69 +Subject: [PATCH] Fix build with C99 compilers
70 +
71 +wvstreams uses a bundled version of argp. Compiling argp fails for all compilers
72 +not using the C89 standard by default:
73 +
74 +"""
75 +In file included from argp-fmtstream.c:35:0:
76 +argp-namefrob.h:62:32: error: redefinition of ‘argp_fmtstream_write’
77 + #define __argp_fmtstream_write argp_fmtstream_write
78 + ^
79 +argp-fmtstream.c:395:1: note: in expansion of macro ‘__argp_fmtstream_write’
80 + __argp_fmtstream_write (argp_fmtstream_t __fs,
81 + ^
82 +In file included from argp-fmtstream.c:34:0:
83 +argp-fmtstream.h:209:32: note: previous definition of ‘argp_fmtstream_write’ was here
84 + #define __argp_fmtstream_write argp_fmtstream_write
85 + ^
86 +argp-fmtstream.h:223:1: note: in expansion of macro ‘__argp_fmtstream_write’
87 + __argp_fmtstream_write (argp_fmtstream_t __fs,
88 + ^
89 +"""
90 +
91 +The issue is that C99 changed inline semantics. This patch allows to build
92 +argp with non-C89-compilers.
93 +
94 +Fetch-from: http://review.gluster.org/6034
95 +
96 +Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org>
97 +Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
98 +Tested-by: Gluster Build System <jenkins@build.gluster.com>
99 +
100 +[Adapt paths for wvstreams. Add commit message.]
101 +Signed-off-by: Jörg Krause <joerg.krause@embedded.rocks>
102 +---
103 +
104 +diff --git a/argp/argp-fmtstream.c b/argp/argp-fmtstream.c
105 +index 7f79285..494b6b3 100644
106 +--- a/argp/argp-fmtstream.c
107 ++++ b/argp/argp-fmtstream.c
108 +@@ -389,6 +389,7 @@
109 + weak_alias (__argp_fmtstream_printf, argp_fmtstream_printf)
110 + #endif
111 +
112 ++#if __STDC_VERSION__ - 199900L < 1
113 + /* Duplicate the inline definitions in argp-fmtstream.h, for compilers
114 + * that don't do inlining. */
115 + size_t
116 +@@ -471,5 +472,6 @@
117 + __argp_fmtstream_update (__fs);
118 + return __fs->point_col >= 0 ? __fs->point_col : 0;
119 + }
120 ++#endif /* __STDC_VERSION__ - 199900L < 1 */
121 +
122 + #endif /* !ARGP_FMTSTREAM_USE_LINEWRAP */
123 +diff --git a/argp/argp-fmtstream.h b/argp/argp-fmtstream.h
124 +index e797b11..828f435 100644
125 +--- a/argp/argp-fmtstream.h
126 ++++ b/argp/argp-fmtstream.h
127 +@@ -153,6 +153,7 @@
128 + __const char *__fmt, ...)
129 + PRINTF_STYLE(2,3);
130 +
131 ++#if __STDC_VERSION__ - 199900L < 1
132 + extern int __argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
133 + extern int argp_fmtstream_putc (argp_fmtstream_t __fs, int __ch);
134 +
135 +@@ -163,6 +164,7 @@
136 + __const char *__str, size_t __len);
137 + extern size_t argp_fmtstream_write (argp_fmtstream_t __fs,
138 + __const char *__str, size_t __len);
139 ++#endif /* __STDC_VERSION__ - 199900L < 1 */
140 +
141 + /* Access macros for various bits of state. */
142 + #define argp_fmtstream_lmargin(__fs) ((__fs)->lmargin)
143 +@@ -172,6 +174,7 @@
144 + #define __argp_fmtstream_rmargin argp_fmtstream_rmargin
145 + #define __argp_fmtstream_wmargin argp_fmtstream_wmargin
146 +
147 ++#if __STDC_VERSION__ - 199900L < 1
148 + /* Set __FS's left margin to LMARGIN and return the old value. */
149 + extern size_t argp_fmtstream_set_lmargin (argp_fmtstream_t __fs,
150 + size_t __lmargin);
151 +@@ -193,6 +196,7 @@
152 + /* Return the column number of the current output point in __FS. */
153 + extern size_t argp_fmtstream_point (argp_fmtstream_t __fs);
154 + extern size_t __argp_fmtstream_point (argp_fmtstream_t __fs);
155 ++#endif /* __STDC_VERSION__ - 199900L < 1 */
156 +
157 + /* Internal routines. */
158 + extern void _argp_fmtstream_update (argp_fmtstream_t __fs);
159 +@@ -216,7 +220,11 @@
160 + #endif
161 +
162 + #ifndef ARGP_FS_EI
163 ++#if defined(__GNUC__) && !defined(__GNUC_STDC_INLINE__)
164 + #define ARGP_FS_EI extern inline
165 ++#else
166 ++#define ARGP_FS_EI inline
167 ++#endif
168 + #endif
169 +
170 + ARGP_FS_EI size_t