blob: dcbbfe454543d3f2588ebf7b60f66c4768e83c2a [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001From 6a3e8506a12c12728d8b29901defd738be43757f Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 Mar 2013 08:42:36 +0400
4Subject: [PATCH 05/35] uclibc-locale-no__x
5
6Signed-off-by: Khem Raj <raj.khem@gmail.com>
7
8Upstream-Status: Pending
9---
10 .../config/locale/uclibc/c++locale_internal.h | 45 ++++++++++++++++++++
11 libstdc++-v3/config/locale/uclibc/c_locale.cc | 14 ------
12 libstdc++-v3/config/locale/uclibc/c_locale.h | 1 +
13 .../config/locale/uclibc/collate_members.cc | 7 ---
14 libstdc++-v3/config/locale/uclibc/ctype_members.cc | 7 ---
15 .../config/locale/uclibc/messages_members.cc | 7 +--
16 .../config/locale/uclibc/messages_members.h | 18 +++-----
17 .../config/locale/uclibc/monetary_members.cc | 4 --
18 .../config/locale/uclibc/numeric_members.cc | 3 --
19 libstdc++-v3/config/locale/uclibc/time_members.cc | 3 --
20 10 files changed, 55 insertions(+), 54 deletions(-)
21
22diff --git a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
23index 2ae3e4a..e74fddf 100644
24--- a/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
25+++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
26@@ -60,4 +60,49 @@ extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
27 extern "C" __typeof(wctype_l) __wctype_l;
28 #endif
29
30+# define __nl_langinfo_l nl_langinfo_l
31+# define __strcoll_l strcoll_l
32+# define __strftime_l strftime_l
33+# define __strtod_l strtod_l
34+# define __strtof_l strtof_l
35+# define __strtold_l strtold_l
36+# define __strxfrm_l strxfrm_l
37+# define __newlocale newlocale
38+# define __freelocale freelocale
39+# define __duplocale duplocale
40+# define __uselocale uselocale
41+
42+# ifdef _GLIBCXX_USE_WCHAR_T
43+# define __iswctype_l iswctype_l
44+# define __towlower_l towlower_l
45+# define __towupper_l towupper_l
46+# define __wcscoll_l wcscoll_l
47+# define __wcsftime_l wcsftime_l
48+# define __wcsxfrm_l wcsxfrm_l
49+# define __wctype_l wctype_l
50+# endif
51+
52+#else
53+# define __nl_langinfo_l(N, L) nl_langinfo((N))
54+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
55+# define __strtod_l(S, E, L) strtod((S), (E))
56+# define __strtof_l(S, E, L) strtof((S), (E))
57+# define __strtold_l(S, E, L) strtold((S), (E))
58+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
59+# warning should dummy __newlocale check for C|POSIX ?
60+# define __newlocale(a, b, c) NULL
61+# define __freelocale(a) ((void)0)
62+# define __duplocale(a) __c_locale()
63+//# define __uselocale ?
64+//
65+# ifdef _GLIBCXX_USE_WCHAR_T
66+# define __iswctype_l(C, M, L) iswctype((C), (M))
67+# define __towlower_l(C, L) towlower((C))
68+# define __towupper_l(C, L) towupper((C))
69+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
70+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
71+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
72+# define __wctype_l(S, L) wctype((S))
73+# endif
74+
75 #endif // GLIBC 2.3 and later
76diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.cc b/libstdc++-v3/config/locale/uclibc/c_locale.cc
77index 5081dc1..21430d0 100644
78--- a/libstdc++-v3/config/locale/uclibc/c_locale.cc
79+++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
80@@ -39,20 +39,6 @@
81 #include <langinfo.h>
82 #include <bits/c++locale_internal.h>
83
84-#ifndef __UCLIBC_HAS_XLOCALE__
85-#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
86-#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
87-#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
88-#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
89-#define __strtof_l(S, E, L) strtof((S), (E))
90-#define __strtod_l(S, E, L) strtod((S), (E))
91-#define __strtold_l(S, E, L) strtold((S), (E))
92-#warning should dummy __newlocale check for C|POSIX ?
93-#define __newlocale(a, b, c) NULL
94-#define __freelocale(a) ((void)0)
95-#define __duplocale(a) __c_locale()
96-#endif
97-
98 namespace std
99 {
100 template<>
101diff --git a/libstdc++-v3/config/locale/uclibc/c_locale.h b/libstdc++-v3/config/locale/uclibc/c_locale.h
102index da07c1f..4bca5f1 100644
103--- a/libstdc++-v3/config/locale/uclibc/c_locale.h
104+++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
105@@ -68,6 +68,7 @@ namespace __gnu_cxx
106 {
107 extern "C" __typeof(uselocale) __uselocale;
108 }
109+#define __uselocale uselocale
110 #endif
111
112 namespace std
113diff --git a/libstdc++-v3/config/locale/uclibc/collate_members.cc b/libstdc++-v3/config/locale/uclibc/collate_members.cc
114index c2664a7..ec5c329 100644
115--- a/libstdc++-v3/config/locale/uclibc/collate_members.cc
116+++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
117@@ -36,13 +36,6 @@
118 #include <locale>
119 #include <bits/c++locale_internal.h>
120
121-#ifndef __UCLIBC_HAS_XLOCALE__
122-#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
123-#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
124-#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
125-#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
126-#endif
127-
128 namespace std
129 {
130 // These are basically extensions to char_traits, and perhaps should
131diff --git a/libstdc++-v3/config/locale/uclibc/ctype_members.cc b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
132index 7294e3a..7b12861 100644
133--- a/libstdc++-v3/config/locale/uclibc/ctype_members.cc
134+++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
135@@ -38,13 +38,6 @@
136 #undef _LIBC
137 #include <bits/c++locale_internal.h>
138
139-#ifndef __UCLIBC_HAS_XLOCALE__
140-#define __wctype_l(S, L) wctype((S))
141-#define __towupper_l(C, L) towupper((C))
142-#define __towlower_l(C, L) towlower((C))
143-#define __iswctype_l(C, M, L) iswctype((C), (M))
144-#endif
145-
146 namespace std
147 {
148 // NB: The other ctype<char> specializations are in src/locale.cc and
149diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.cc b/libstdc++-v3/config/locale/uclibc/messages_members.cc
150index 13594d9..d7693b4 100644
151--- a/libstdc++-v3/config/locale/uclibc/messages_members.cc
152+++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
153@@ -39,13 +39,10 @@
154 #ifdef __UCLIBC_MJN3_ONLY__
155 #warning fix gettext stuff
156 #endif
157-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
158-extern "C" char *__dcgettext(const char *domainname,
159- const char *msgid, int category);
160 #undef gettext
161-#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
162+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
163+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
164 #else
165-#undef gettext
166 #define gettext(msgid) (msgid)
167 #endif
168
169diff --git a/libstdc++-v3/config/locale/uclibc/messages_members.h b/libstdc++-v3/config/locale/uclibc/messages_members.h
170index 1424078..d89da33 100644
171--- a/libstdc++-v3/config/locale/uclibc/messages_members.h
172+++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
173@@ -36,15 +36,11 @@
174 #ifdef __UCLIBC_MJN3_ONLY__
175 #warning fix prototypes for *textdomain funcs
176 #endif
177-#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
178-extern "C" char *__textdomain(const char *domainname);
179-extern "C" char *__bindtextdomain(const char *domainname,
180- const char *dirname);
181-#else
182-#undef __textdomain
183-#undef __bindtextdomain
184-#define __textdomain(D) ((void)0)
185-#define __bindtextdomain(D,P) ((void)0)
186+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
187+#undef textdomain
188+#undef bindtextdomain
189+#define textdomain(D) ((void)0)
190+#define bindtextdomain(D,P) ((void)0)
191 #endif
192
193 // Non-virtual member functions.
194@@ -70,7 +66,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
195 messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
196 const char* __dir) const
197 {
198- __bindtextdomain(__s.c_str(), __dir);
199+ bindtextdomain(__s.c_str(), __dir);
200 return this->do_open(__s, __loc);
201 }
202
203@@ -90,7 +86,7 @@ extern "C" char *__bindtextdomain(const char *domainname,
204 {
205 // No error checking is done, assume the catalog exists and can
206 // be used.
207- __textdomain(__s.c_str());
208+ textdomain(__s.c_str());
209 return 0;
210 }
211
212diff --git a/libstdc++-v3/config/locale/uclibc/monetary_members.cc b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
213index aa52731..2e6f80a 100644
214--- a/libstdc++-v3/config/locale/uclibc/monetary_members.cc
215+++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
216@@ -43,10 +43,6 @@
217 #warning tailor for stub locale support
218 #endif
219
220-#ifndef __UCLIBC_HAS_XLOCALE__
221-#define __nl_langinfo_l(N, L) nl_langinfo((N))
222-#endif
223-
224 namespace std
225 {
226 // Construct and return valid pattern consisting of some combination of:
227diff --git a/libstdc++-v3/config/locale/uclibc/numeric_members.cc b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
228index 883ec1a..2c70642 100644
229--- a/libstdc++-v3/config/locale/uclibc/numeric_members.cc
230+++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
231@@ -41,9 +41,6 @@
232 #ifdef __UCLIBC_MJN3_ONLY__
233 #warning tailor for stub locale support
234 #endif
235-#ifndef __UCLIBC_HAS_XLOCALE__
236-#define __nl_langinfo_l(N, L) nl_langinfo((N))
237-#endif
238
239 namespace std
240 {
241diff --git a/libstdc++-v3/config/locale/uclibc/time_members.cc b/libstdc++-v3/config/locale/uclibc/time_members.cc
242index e0707d7..d848ed5 100644
243--- a/libstdc++-v3/config/locale/uclibc/time_members.cc
244+++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
245@@ -40,9 +40,6 @@
246 #ifdef __UCLIBC_MJN3_ONLY__
247 #warning tailor for stub locale support
248 #endif
249-#ifndef __UCLIBC_HAS_XLOCALE__
250-#define __nl_langinfo_l(N, L) nl_langinfo((N))
251-#endif
252
253 namespace std
254 {
255--
2561.7.10.4
257