1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
2 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
3 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
4 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
6 extern "C" __typeof(wctype_l) __wctype_l;
9 +# define __nl_langinfo_l nl_langinfo_l
10 +# define __strcoll_l strcoll_l
11 +# define __strftime_l strftime_l
12 +# define __strtod_l strtod_l
13 +# define __strtof_l strtof_l
14 +# define __strtold_l strtold_l
15 +# define __strxfrm_l strxfrm_l
16 +# define __newlocale newlocale
17 +# define __freelocale freelocale
18 +# define __duplocale duplocale
19 +# define __uselocale uselocale
21 +# ifdef _GLIBCXX_USE_WCHAR_T
22 +# define __iswctype_l iswctype_l
23 +# define __towlower_l towlower_l
24 +# define __towupper_l towupper_l
25 +# define __wcscoll_l wcscoll_l
26 +# define __wcsftime_l wcsftime_l
27 +# define __wcsxfrm_l wcsxfrm_l
28 +# define __wctype_l wctype_l
32 +# define __nl_langinfo_l(N, L) nl_langinfo((N))
33 +# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
34 +# define __strtod_l(S, E, L) strtod((S), (E))
35 +# define __strtof_l(S, E, L) strtof((S), (E))
36 +# define __strtold_l(S, E, L) strtold((S), (E))
37 +# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
38 +# warning should dummy __newlocale check for C|POSIX ?
39 +# define __newlocale(a, b, c) NULL
40 +# define __freelocale(a) ((void)0)
41 +# define __duplocale(a) __c_locale()
42 +//# define __uselocale ?
44 +# ifdef _GLIBCXX_USE_WCHAR_T
45 +# define __iswctype_l(C, M, L) iswctype((C), (M))
46 +# define __towlower_l(C, L) towlower((C))
47 +# define __towupper_l(C, L) towupper((C))
48 +# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
49 +//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
50 +# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
51 +# define __wctype_l(S, L) wctype((S))
54 #endif // GLIBC 2.3 and later
55 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
56 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
57 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
60 #include <bits/c++locale_internal.h>
62 -#ifndef __UCLIBC_HAS_XLOCALE__
63 -#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
64 -#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
65 -#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
66 -#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
67 -#define __strtof_l(S, E, L) strtof((S), (E))
68 -#define __strtod_l(S, E, L) strtod((S), (E))
69 -#define __strtold_l(S, E, L) strtold((S), (E))
70 -#warning should dummy __newlocale check for C|POSIX ?
71 -#define __newlocale(a, b, c) NULL
72 -#define __freelocale(a) ((void)0)
73 -#define __duplocale(a) __c_locale()
79 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
80 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
81 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
84 extern "C" __typeof(uselocale) __uselocale;
86 +#define __uselocale uselocale
90 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
91 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
92 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
95 #include <bits/c++locale_internal.h>
97 -#ifndef __UCLIBC_HAS_XLOCALE__
98 -#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
99 -#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
100 -#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
101 -#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
106 // These are basically extensions to char_traits, and perhaps should
107 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
108 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
109 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
112 #include <bits/c++locale_internal.h>
114 -#ifndef __UCLIBC_HAS_XLOCALE__
115 -#define __wctype_l(S, L) wctype((S))
116 -#define __towupper_l(C, L) towupper((C))
117 -#define __towlower_l(C, L) towlower((C))
118 -#define __iswctype_l(C, M, L) iswctype((C), (M))
123 // NB: The other ctype<char> specializations are in src/locale.cc and
124 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
125 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
126 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
128 #ifdef __UCLIBC_MJN3_ONLY__
129 #warning fix gettext stuff
131 -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
132 -extern "C" char *__dcgettext(const char *domainname,
133 - const char *msgid, int category);
135 -#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
136 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
137 +#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
140 #define gettext(msgid) (msgid)
143 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
144 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
145 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
147 #ifdef __UCLIBC_MJN3_ONLY__
148 #warning fix prototypes for *textdomain funcs
150 -#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
151 -extern "C" char *__textdomain(const char *domainname);
152 -extern "C" char *__bindtextdomain(const char *domainname,
153 - const char *dirname);
156 -#undef __bindtextdomain
157 -#define __textdomain(D) ((void)0)
158 -#define __bindtextdomain(D,P) ((void)0)
159 +#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
161 +#undef bindtextdomain
162 +#define textdomain(D) ((void)0)
163 +#define bindtextdomain(D,P) ((void)0)
166 // Non-virtual member functions.
168 messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
169 const char* __dir) const
171 - __bindtextdomain(__s.c_str(), __dir);
172 + bindtextdomain(__s.c_str(), __dir);
173 return this->do_open(__s, __loc);
178 // No error checking is done, assume the catalog exists and can
180 - __textdomain(__s.c_str());
181 + textdomain(__s.c_str());
185 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
186 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
187 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
189 #warning tailor for stub locale support
192 -#ifndef __UCLIBC_HAS_XLOCALE__
193 -#define __nl_langinfo_l(N, L) nl_langinfo((N))
198 // Construct and return valid pattern consisting of some combination of:
199 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
200 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
201 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
203 #ifdef __UCLIBC_MJN3_ONLY__
204 #warning tailor for stub locale support
206 -#ifndef __UCLIBC_HAS_XLOCALE__
207 -#define __nl_langinfo_l(N, L) nl_langinfo((N))
212 diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
213 --- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
214 +++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
216 #ifdef __UCLIBC_MJN3_ONLY__
217 #warning tailor for stub locale support
219 -#ifndef __UCLIBC_HAS_XLOCALE__
220 -#define __nl_langinfo_l(N, L) nl_langinfo((N))