python-werkzeug: bump to version 0.11.15
[buildroot-gz.git] / package / gcc / 4.9.4 / 850-libstdcxx-uclibc-c99.patch
blob533d01fad5bf64070bc5bc9aeab1056a568baa58
1 Allow C99-depending features of libstdc++ with uClibc
3 The libstdc++ code is fairly restrictive on how it checks for C99
4 compatibility: it requires *complete* C99 support to enable certain
5 features. For example, uClibc provides a good number of C99 features,
6 but not C99 complex number support. For this reason, libstdc++
7 completely disables many the standard C++ methods that can in fact
8 work because uClibc provides the necessary functions.
10 This patch is similar and highly inspired from
11 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58393, but implemented in
12 a way that doesn't involve changing the configure.ac script, as
13 autoreconfiguring gcc is complicated. It simply relies on the fact
14 that uClibc defines the __UCLIBC__ definition.
16 Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
17 [Gustavo: update for 4.9.3]
19 Index: b/libstdc++-v3/config/locale/generic/c_locale.h
20 ===================================================================
21 --- a/libstdc++-v3/config/locale/generic/c_locale.h
22 +++ b/libstdc++-v3/config/locale/generic/c_locale.h
23 @@ -70,7 +70,7 @@
24 __builtin_va_list __args;
25 __builtin_va_start(__args, __fmt);
27 -#ifdef _GLIBCXX_USE_C99
28 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
29 const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
30 #else
31 const int __ret = __builtin_vsprintf(__out, __fmt, __args);
32 Index: b/libstdc++-v3/config/locale/gnu/c_locale.h
33 ===================================================================
34 --- a/libstdc++-v3/config/locale/gnu/c_locale.h
35 +++ b/libstdc++-v3/config/locale/gnu/c_locale.h
36 @@ -88,7 +88,7 @@
37 __builtin_va_list __args;
38 __builtin_va_start(__args, __fmt);
40 -#ifdef _GLIBCXX_USE_C99
41 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
42 const int __ret = __builtin_vsnprintf(__out, __size, __fmt, __args);
43 #else
44 const int __ret = __builtin_vsprintf(__out, __fmt, __args);
45 Index: b/libstdc++-v3/include/bits/basic_string.h
46 ===================================================================
47 --- a/libstdc++-v3/include/bits/basic_string.h
48 +++ b/libstdc++-v3/include/bits/basic_string.h
49 @@ -2843,7 +2843,7 @@
50 _GLIBCXX_END_NAMESPACE_VERSION
51 } // namespace
53 -#if __cplusplus >= 201103L && defined(_GLIBCXX_USE_C99)
54 +#if __cplusplus >= 201103L && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__))
56 #include <ext/string_conversions.h>
58 Index: b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
59 ===================================================================
60 --- a/libstdc++-v3/include/bits/locale_facets_nonio.tcc
61 +++ b/libstdc++-v3/include/bits/locale_facets_nonio.tcc
62 @@ -572,7 +572,7 @@
64 const locale __loc = __io.getloc();
65 const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
66 -#ifdef _GLIBCXX_USE_C99
67 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
68 // First try a buffer perhaps big enough.
69 int __cs_size = 64;
70 char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
71 Index: b/libstdc++-v3/include/bits/locale_facets.tcc
72 ===================================================================
73 --- a/libstdc++-v3/include/bits/locale_facets.tcc
74 +++ b/libstdc++-v3/include/bits/locale_facets.tcc
75 @@ -987,7 +987,7 @@
76 char __fbuf[16];
77 __num_base::_S_format_float(__io, __fbuf, __mod);
79 -#ifdef _GLIBCXX_USE_C99
80 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
81 // First try a buffer perhaps big enough (most probably sufficient
82 // for non-ios_base::fixed outputs)
83 int __cs_size = __max_digits * 3;
84 Index: b/libstdc++-v3/include/c_compatibility/math.h
85 ===================================================================
86 --- a/libstdc++-v3/include/c_compatibility/math.h
87 +++ b/libstdc++-v3/include/c_compatibility/math.h
88 @@ -56,7 +56,7 @@
89 using std::floor;
90 using std::fmod;
92 -#if _GLIBCXX_USE_C99
93 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
94 using std::fpclassify;
95 using std::isfinite;
96 using std::isinf;
97 Index: b/libstdc++-v3/include/c_compatibility/wchar.h
98 ===================================================================
99 --- a/libstdc++-v3/include/c_compatibility/wchar.h
100 +++ b/libstdc++-v3/include/c_compatibility/wchar.h
101 @@ -103,7 +103,7 @@
102 using std::wmemset;
103 using std::wcsftime;
105 -#if _GLIBCXX_USE_C99
106 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
107 using std::wcstold;
108 using std::wcstoll;
109 using std::wcstoull;
110 Index: b/libstdc++-v3/include/c_global/cstdio
111 ===================================================================
112 --- a/libstdc++-v3/include/c_global/cstdio
113 +++ b/libstdc++-v3/include/c_global/cstdio
114 @@ -146,7 +146,7 @@
115 using ::vsprintf;
116 } // namespace
118 -#if _GLIBCXX_USE_C99
119 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
121 #undef snprintf
122 #undef vfscanf
123 Index: b/libstdc++-v3/include/c_global/cstdlib
124 ===================================================================
125 --- a/libstdc++-v3/include/c_global/cstdlib
126 +++ b/libstdc++-v3/include/c_global/cstdlib
127 @@ -182,7 +182,7 @@
128 _GLIBCXX_END_NAMESPACE_VERSION
129 } // namespace
131 -#if _GLIBCXX_USE_C99
132 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
134 #undef _Exit
135 #undef llabs
136 Index: b/libstdc++-v3/include/c_global/cwchar
137 ===================================================================
138 --- a/libstdc++-v3/include/c_global/cwchar
139 +++ b/libstdc++-v3/include/c_global/cwchar
140 @@ -232,7 +232,7 @@
141 _GLIBCXX_END_NAMESPACE_VERSION
142 } // namespace
144 -#if _GLIBCXX_USE_C99
145 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
147 #undef wcstold
148 #undef wcstoll
149 @@ -289,7 +289,7 @@
150 using std::vwscanf;
151 #endif
153 -#if _GLIBCXX_USE_C99
154 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
155 using std::wcstold;
156 using std::wcstoll;
157 using std::wcstoull;
158 Index: b/libstdc++-v3/include/c_std/cstdio
159 ===================================================================
160 --- a/libstdc++-v3/include/c_std/cstdio
161 +++ b/libstdc++-v3/include/c_std/cstdio
162 @@ -144,7 +144,7 @@
163 using ::vsprintf;
164 } // namespace std
166 -#if _GLIBCXX_USE_C99
167 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
169 #undef snprintf
170 #undef vfscanf
171 Index: b/libstdc++-v3/include/c_std/cstdlib
172 ===================================================================
173 --- a/libstdc++-v3/include/c_std/cstdlib
174 +++ b/libstdc++-v3/include/c_std/cstdlib
175 @@ -180,7 +180,7 @@
176 _GLIBCXX_END_NAMESPACE_VERSION
177 } // namespace
179 -#if _GLIBCXX_USE_C99
180 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
182 #undef _Exit
183 #undef llabs
184 Index: b/libstdc++-v3/include/c_std/cwchar
185 ===================================================================
186 --- a/libstdc++-v3/include/c_std/cwchar
187 +++ b/libstdc++-v3/include/c_std/cwchar
188 @@ -228,7 +228,7 @@
189 _GLIBCXX_END_NAMESPACE_VERSION
190 } // namespace
192 -#if _GLIBCXX_USE_C99
193 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
195 #undef wcstold
196 #undef wcstoll
197 Index: b/libstdc++-v3/include/ext/vstring.h
198 ===================================================================
199 --- a/libstdc++-v3/include/ext/vstring.h
200 +++ b/libstdc++-v3/include/ext/vstring.h
201 @@ -2680,7 +2680,7 @@
202 _GLIBCXX_END_NAMESPACE_VERSION
203 } // namespace
205 -#if ((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99))
206 +#if ((__cplusplus >= 201103L) && (defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)))
208 #include <ext/string_conversions.h>
210 Index: b/libstdc++-v3/include/tr1/cstdio
211 ===================================================================
212 --- a/libstdc++-v3/include/tr1/cstdio
213 +++ b/libstdc++-v3/include/tr1/cstdio
214 @@ -33,7 +33,7 @@
216 #include <cstdio>
218 -#if _GLIBCXX_USE_C99
219 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
221 namespace std _GLIBCXX_VISIBILITY(default)
223 Index: b/libstdc++-v3/include/tr1/cstdlib
224 ===================================================================
225 --- a/libstdc++-v3/include/tr1/cstdlib
226 +++ b/libstdc++-v3/include/tr1/cstdlib
227 @@ -35,7 +35,7 @@
229 #if _GLIBCXX_HOSTED
231 -#if _GLIBCXX_USE_C99
232 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
234 namespace std _GLIBCXX_VISIBILITY(default)
236 Index: b/libstdc++-v3/include/tr1/cwchar
237 ===================================================================
238 --- a/libstdc++-v3/include/tr1/cwchar
239 +++ b/libstdc++-v3/include/tr1/cwchar
240 @@ -52,7 +52,7 @@
241 using std::vwscanf;
242 #endif
244 -#if _GLIBCXX_USE_C99
245 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
246 using std::wcstold;
247 using std::wcstoll;
248 using std::wcstoull;
249 Index: b/libstdc++-v3/include/tr1/stdlib.h
250 ===================================================================
251 --- a/libstdc++-v3/include/tr1/stdlib.h
252 +++ b/libstdc++-v3/include/tr1/stdlib.h
253 @@ -33,7 +33,7 @@
255 #if _GLIBCXX_HOSTED
257 -#if _GLIBCXX_USE_C99
258 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
260 using std::tr1::atoll;
261 using std::tr1::strtoll;
262 Index: b/libstdc++-v3/src/c++11/debug.cc
263 ===================================================================
264 --- a/libstdc++-v3/src/c++11/debug.cc
265 +++ b/libstdc++-v3/src/c++11/debug.cc
266 @@ -788,7 +788,7 @@
267 int __n __attribute__ ((__unused__)),
268 const char* __fmt, _Tp __s) const throw ()
270 -#ifdef _GLIBCXX_USE_C99
271 +#if defined(_GLIBCXX_USE_C99) || defined(__UCLIBC__)
272 std::snprintf(__buf, __n, __fmt, __s);
273 #else
274 std::sprintf(__buf, __fmt, __s);