summaryrefslogtreecommitdiff
path: root/meta/recipes-devtools/gcc/gcc-5.3/0005-uclibc-locale-no__x.patch
blob: 19a86a4e1d0bf57422dcc339cfbe429f0b953d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
From 72a1a4af3c18627f59aa5ba1f753a89011b4e4f0 Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Fri, 29 Mar 2013 08:42:36 +0400
Subject: [PATCH 05/46] uclibc-locale-no__x

Signed-off-by: Khem Raj <raj.khem@gmail.com>

Upstream-Status: Pending
---
 .../config/locale/uclibc/c++locale_internal.h      | 45 ++++++++++++++++++++++
 libstdc++-v3/config/locale/uclibc/c_locale.cc      | 14 -------
 libstdc++-v3/config/locale/uclibc/c_locale.h       |  1 +
 .../config/locale/uclibc/collate_members.cc        |  7 ----
 libstdc++-v3/config/locale/uclibc/ctype_members.cc |  7 ----
 .../config/locale/uclibc/messages_members.cc       |  7 +---
 .../config/locale/uclibc/messages_members.h        | 18 ++++-----
 .../config/locale/uclibc/monetary_members.cc       |  4 --
 .../config/locale/uclibc/numeric_members.cc        |  3 --
 libstdc++-v3/config/locale/uclibc/time_members.cc  |  3 --
 10 files changed, 55 insertions(+), 54 deletions(-)

diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
index 2ae3e4a..e74fddf 100644
--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
+++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
 extern "C" __typeof(wctype_l) __wctype_l;
 #endif
 
+# define __nl_langinfo_l nl_langinfo_l
+# define __strcoll_l strcoll_l
+# define __strftime_l strftime_l
+# define __strtod_l strtod_l
+# define __strtof_l strtof_l
+# define __strtold_l strtold_l
+# define __strxfrm_l strxfrm_l
+# define __newlocale newlocale
+# define __freelocale freelocale
+# define __duplocale duplocale
+# define __uselocale uselocale
+
+# ifdef _GLIBCXX_USE_WCHAR_T
+#  define __iswctype_l iswctype_l
+#  define __towlower_l towlower_l
+#  define __towupper_l towupper_l
+#  define __wcscoll_l wcscoll_l
+#  define __wcsftime_l wcsftime_l
+#  define __wcsxfrm_l wcsxfrm_l
+#  define __wctype_l wctype_l
+# endif
+
+#else
+# define __nl_langinfo_l(N, L)       nl_langinfo((N))
+# define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
+# define __strtod_l(S, E, L)         strtod((S), (E))
+# define __strtof_l(S, E, L)         strtof((S), (E))
+# define __strtold_l(S, E, L)        strtold((S), (E))
+# define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
+# warning should dummy __newlocale check for C|POSIX ?
+# define __newlocale(a, b, c)        NULL
+# define __freelocale(a)             ((void)0)
+# define __duplocale(a)              __c_locale()
+//# define __uselocale ?
+//
+# ifdef _GLIBCXX_USE_WCHAR_T
+#  define __iswctype_l(C, M, L)       iswctype((C), (M))
+#  define __towlower_l(C, L)          towlower((C))
+#  define __towupper_l(C, L)          towupper((C))
+#  define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
+//#  define __wcsftime_l(S, M, F, T, L)  wcsftime((S), (M), (F), (T))
+#  define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
+#  define __wctype_l(S, L)            wctype((S))
+# endif
+
 #endif // GLIBC 2.3 and later
diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
index 5081dc1..21430d0 100644
--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
+++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
@@ -39,20 +39,6 @@
 #include <langinfo.h>
 #include <bits/c++locale_internal.h>
 
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __strtol_l(S, E, B, L)      strtol((S), (E), (B))
-#define __strtoul_l(S, E, B, L)     strtoul((S), (E), (B))
-#define __strtoll_l(S, E, B, L)     strtoll((S), (E), (B))
-#define __strtoull_l(S, E, B, L)    strtoull((S), (E), (B))
-#define __strtof_l(S, E, L)         strtof((S), (E))
-#define __strtod_l(S, E, L)         strtod((S), (E))
-#define __strtold_l(S, E, L)        strtold((S), (E))
-#warning should dummy __newlocale check for C|POSIX ?
-#define __newlocale(a, b, c)        NULL
-#define __freelocale(a)             ((void)0)
-#define __duplocale(a)              __c_locale()
-#endif
-
 namespace std
 {
   template<>
diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
index da07c1f..4bca5f1 100644
--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
+++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
@@ -68,6 +68,7 @@ namespace __gnu_cxx
 {
   extern "C" __typeof(uselocale) __uselocale;
 }
+#define __uselocale uselocale
 #endif
 
 namespace std
diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
index c2664a7..ec5c329 100644
--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
@@ -36,13 +36,6 @@
 #include <locale>
 #include <bits/c++locale_internal.h>
 
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __strcoll_l(S1, S2, L)      strcoll((S1), (S2))
-#define __strxfrm_l(S1, S2, N, L)   strxfrm((S1), (S2), (N))
-#define __wcscoll_l(S1, S2, L)      wcscoll((S1), (S2))
-#define __wcsxfrm_l(S1, S2, N, L)   wcsxfrm((S1), (S2), (N))
-#endif
-
 namespace std
 {
   // These are basically extensions to char_traits, and perhaps should
diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
index 7294e3a..7b12861 100644
--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
@@ -38,13 +38,6 @@
 #undef _LIBC
 #include <bits/c++locale_internal.h>
 
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __wctype_l(S, L)           wctype((S))
-#define __towupper_l(C, L)         towupper((C))
-#define __towlower_l(C, L)         towlower((C))
-#define __iswctype_l(C, M, L)      iswctype((C), (M))
-#endif
-
 namespace std
 {
   // NB: The other ctype<char> specializations are in src/locale.cc and
diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
index 13594d9..d7693b4 100644
--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
@@ -39,13 +39,10 @@
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning fix gettext stuff
 #endif
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-extern "C" char *__dcgettext(const char *domainname,
-			     const char *msgid, int category);
 #undef gettext
-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
 #else
-#undef gettext
 #define gettext(msgid) (msgid)
 #endif
 
diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
index 1424078..d89da33 100644
--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
+++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
@@ -36,15 +36,11 @@
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning fix prototypes for *textdomain funcs
 #endif
-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
-extern "C" char *__textdomain(const char *domainname);
-extern "C" char *__bindtextdomain(const char *domainname,
-				  const char *dirname);
-#else
-#undef __textdomain
-#undef __bindtextdomain
-#define __textdomain(D)           ((void)0)
-#define __bindtextdomain(D,P)     ((void)0)
+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
+#undef textdomain
+#undef bindtextdomain
+#define textdomain(D)           ((void)0)
+#define bindtextdomain(D,P)     ((void)0)
 #endif
 
   // Non-virtual member functions.
@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
     messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
 			   const char* __dir) const
     {
-      __bindtextdomain(__s.c_str(), __dir);
+      bindtextdomain(__s.c_str(), __dir);
       return this->do_open(__s, __loc);
     }
 
@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
     {
       // No error checking is done, assume the catalog exists and can
       // be used.
-      __textdomain(__s.c_str());
+      textdomain(__s.c_str());
       return 0;
     }
 
diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
index aa52731..2e6f80a 100644
--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
@@ -43,10 +43,6 @@
 #warning tailor for stub locale support
 #endif
 
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-#endif
-
 namespace std
 {
   // Construct and return valid pattern consisting of some combination of:
diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
index 883ec1a..2c70642 100644
--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
@@ -41,9 +41,6 @@
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning tailor for stub locale support
 #endif
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-#endif
 
 namespace std
 {
diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
index e0707d7..d848ed5 100644
--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
+++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
@@ -40,9 +40,6 @@
 #ifdef __UCLIBC_MJN3_ONLY__
 #warning tailor for stub locale support
 #endif
-#ifndef __UCLIBC_HAS_XLOCALE__
-#define __nl_langinfo_l(N, L)         nl_langinfo((N))
-#endif
 
 namespace std
 {
-- 
2.6.3