Magellan Linux

Contents of /trunk/gcc/gcc-3.4.3-uclibc_locale-1.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 41 - (show annotations) (download)
Thu Oct 13 15:22:09 2005 UTC (18 years, 6 months ago) by niro
File size: 114308 byte(s)
added all old gcc patches

1 Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
2 Date: 2004-11-14
3 Initial Package Version: 3.4.3
4 Upstream Status: Not submitted - Hack
5 ORIGIN: http://www.uclibc.org/cgi-bin/cvsweb/buildroot/toolchain/\
6 gcc/3.4.2/200-uclibc-locale.patch
7 Description: This adds uclibc c++ locale definitions to GCC.
8
9 Also see:
10 http://www.linuxfromscratch.org/hlfs/
11 http://www.uclibc.org/
12
13 diff -urN gcc-3.4.2-dist/libstdc++-v3/acinclude.m4 gcc-3.4.2/libstdc++-v3/acinclude.m4
14 --- gcc-3.4.2-dist/libstdc++-v3/acinclude.m4 2004-07-15 12:42:45.000000000 -0500
15 +++ gcc-3.4.2/libstdc++-v3/acinclude.m4 2004-09-10 10:47:40.000000000 -0500
16 @@ -996,7 +996,7 @@
17 AC_MSG_CHECKING([for C locale to use])
18 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
19 [use MODEL for target locale package],
20 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
21 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
22
23 # If they didn't use this option switch, or if they specified --enable
24 # with no specific model, we'll have to look for one. If they
25 @@ -1012,6 +1012,9 @@
26 # Default to "generic".
27 if test $enable_clocale_flag = auto; then
28 case x${target_os} in
29 + x*-uclibc*)
30 + enable_clocale_flag=uclibc
31 + ;;
32 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
33 AC_EGREP_CPP([_GLIBCXX_ok], [
34 #include <features.h>
35 @@ -1138,6 +1141,41 @@
36 CTIME_CC=config/locale/generic/time_members.cc
37 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
38 ;;
39 + uclibc)
40 + AC_MSG_RESULT(uclibc)
41 +
42 + # Declare intention to use gettext, and add support for specific
43 + # languages.
44 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
45 + ALL_LINGUAS="de fr"
46 +
47 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
48 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
49 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
50 + USE_NLS=yes
51 + fi
52 + # Export the build objects.
53 + for ling in $ALL_LINGUAS; do \
54 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
55 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
56 + done
57 + AC_SUBST(glibcxx_MOFILES)
58 + AC_SUBST(glibcxx_POFILES)
59 +
60 + CLOCALE_H=config/locale/uclibc/c_locale.h
61 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
62 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
63 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
64 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
65 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
66 + CMESSAGES_H=config/locale/uclibc/messages_members.h
67 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
68 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
69 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
70 + CTIME_H=config/locale/uclibc/time_members.h
71 + CTIME_CC=config/locale/uclibc/time_members.cc
72 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
73 + ;;
74 esac
75
76 # This is where the testsuite looks for locale catalogs, using the
77 diff -urN gcc-3.4.2-dist/libstdc++-v3/aclocal.m4 gcc-3.4.2/libstdc++-v3/aclocal.m4
78 --- gcc-3.4.2-dist/libstdc++-v3/aclocal.m4 2004-08-13 15:44:03.000000000 -0500
79 +++ gcc-3.4.2/libstdc++-v3/aclocal.m4 2004-09-10 10:47:40.000000000 -0500
80 @@ -1025,6 +1025,9 @@
81 # Default to "generic".
82 if test $enable_clocale_flag = auto; then
83 case x${target_os} in
84 + x*-uclibc*)
85 + enable_clocale_flag=uclibc
86 + ;;
87 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
88 AC_EGREP_CPP([_GLIBCXX_ok], [
89 #include <features.h>
90 @@ -1151,6 +1154,41 @@
91 CTIME_CC=config/locale/generic/time_members.cc
92 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
93 ;;
94 + uclibc)
95 + AC_MSG_RESULT(uclibc)
96 +
97 + # Declare intention to use gettext, and add support for specific
98 + # languages.
99 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
100 + ALL_LINGUAS="de fr"
101 +
102 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
103 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
104 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
105 + USE_NLS=yes
106 + fi
107 + # Export the build objects.
108 + for ling in $ALL_LINGUAS; do \
109 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
110 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
111 + done
112 + AC_SUBST(glibcxx_MOFILES)
113 + AC_SUBST(glibcxx_POFILES)
114 +
115 + CLOCALE_H=config/locale/uclibc/c_locale.h
116 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
117 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
118 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
119 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
120 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
121 + CMESSAGES_H=config/locale/uclibc/messages_members.h
122 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
123 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
124 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
125 + CTIME_H=config/locale/uclibc/time_members.h
126 + CTIME_CC=config/locale/uclibc/time_members.cc
127 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
128 + ;;
129 esac
130
131 # This is where the testsuite looks for locale catalogs, using the
132 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
133 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
134 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-09-10 10:47:40.000000000 -0500
135 @@ -0,0 +1,59 @@
136 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
137 +
138 +// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
139 +//
140 +// This file is part of the GNU ISO C++ Library. This library is free
141 +// software; you can redistribute it and/or modify it under the
142 +// terms of the GNU General Public License as published by the
143 +// Free Software Foundation; either version 2, or (at your option)
144 +// any later version.
145 +
146 +// This library is distributed in the hope that it will be useful,
147 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
148 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 +// GNU General Public License for more details.
150 +
151 +// You should have received a copy of the GNU General Public License along
152 +// with this library; see the file COPYING. If not, write to the Free
153 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
154 +// USA.
155 +
156 +// As a special exception, you may use this file as part of a free software
157 +// library without restriction. Specifically, if other files instantiate
158 +// templates or use macros or inline functions from this file, or you compile
159 +// this file and link it with other files to produce an executable, this
160 +// file does not by itself cause the resulting executable to be covered by
161 +// the GNU General Public License. This exception does not however
162 +// invalidate any other reasons why the executable file might be covered by
163 +// the GNU General Public License.
164 +
165 +// Written by Jakub Jelinek <jakub@redhat.com>
166 +
167 +#include <clocale>
168 +
169 +#ifdef __UCLIBC_MJN3_ONLY__
170 +#warning clean this up
171 +#endif
172 +
173 +#ifdef __UCLIBC_HAS_XLOCALE__
174 +
175 +extern "C" __typeof(iswctype_l) __iswctype_l;
176 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
177 +extern "C" __typeof(strcoll_l) __strcoll_l;
178 +extern "C" __typeof(strftime_l) __strftime_l;
179 +extern "C" __typeof(strtod_l) __strtod_l;
180 +extern "C" __typeof(strtof_l) __strtof_l;
181 +extern "C" __typeof(strtold_l) __strtold_l;
182 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
183 +extern "C" __typeof(towlower_l) __towlower_l;
184 +extern "C" __typeof(towupper_l) __towupper_l;
185 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
186 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
187 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
188 +extern "C" __typeof(wctype_l) __wctype_l;
189 +extern "C" __typeof(newlocale) __newlocale;
190 +extern "C" __typeof(freelocale) __freelocale;
191 +extern "C" __typeof(duplocale) __duplocale;
192 +extern "C" __typeof(uselocale) __uselocale;
193 +
194 +#endif // GLIBC 2.3 and later
195 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.cc
196 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
197 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-09-10 10:47:40.000000000 -0500
198 @@ -0,0 +1,160 @@
199 +// Wrapper for underlying C-language localization -*- C++ -*-
200 +
201 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
202 +//
203 +// This file is part of the GNU ISO C++ Library. This library is free
204 +// software; you can redistribute it and/or modify it under the
205 +// terms of the GNU General Public License as published by the
206 +// Free Software Foundation; either version 2, or (at your option)
207 +// any later version.
208 +
209 +// This library is distributed in the hope that it will be useful,
210 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
211 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
212 +// GNU General Public License for more details.
213 +
214 +// You should have received a copy of the GNU General Public License along
215 +// with this library; see the file COPYING. If not, write to the Free
216 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
217 +// USA.
218 +
219 +// As a special exception, you may use this file as part of a free software
220 +// library without restriction. Specifically, if other files instantiate
221 +// templates or use macros or inline functions from this file, or you compile
222 +// this file and link it with other files to produce an executable, this
223 +// file does not by itself cause the resulting executable to be covered by
224 +// the GNU General Public License. This exception does not however
225 +// invalidate any other reasons why the executable file might be covered by
226 +// the GNU General Public License.
227 +
228 +//
229 +// ISO C++ 14882: 22.8 Standard locale categories.
230 +//
231 +
232 +// Written by Benjamin Kosnik <bkoz@redhat.com>
233 +
234 +#include <cerrno> // For errno
235 +#include <locale>
236 +#include <stdexcept>
237 +#include <langinfo.h>
238 +#include <bits/c++locale_internal.h>
239 +
240 +#ifndef __UCLIBC_HAS_XLOCALE__
241 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
242 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
243 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
244 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
245 +#define __strtof_l(S, E, L) strtof((S), (E))
246 +#define __strtod_l(S, E, L) strtod((S), (E))
247 +#define __strtold_l(S, E, L) strtold((S), (E))
248 +#warning should dummy __newlocale check for C|POSIX ?
249 +#define __newlocale(a, b, c) NULL
250 +#define __freelocale(a) ((void)0)
251 +#define __duplocale(a) __c_locale()
252 +#endif
253 +
254 +namespace std
255 +{
256 + template<>
257 + void
258 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
259 + const __c_locale& __cloc)
260 + {
261 + if (!(__err & ios_base::failbit))
262 + {
263 + char* __sanity;
264 + errno = 0;
265 + float __f = __strtof_l(__s, &__sanity, __cloc);
266 + if (__sanity != __s && errno != ERANGE)
267 + __v = __f;
268 + else
269 + __err |= ios_base::failbit;
270 + }
271 + }
272 +
273 + template<>
274 + void
275 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
276 + const __c_locale& __cloc)
277 + {
278 + if (!(__err & ios_base::failbit))
279 + {
280 + char* __sanity;
281 + errno = 0;
282 + double __d = __strtod_l(__s, &__sanity, __cloc);
283 + if (__sanity != __s && errno != ERANGE)
284 + __v = __d;
285 + else
286 + __err |= ios_base::failbit;
287 + }
288 + }
289 +
290 + template<>
291 + void
292 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
293 + const __c_locale& __cloc)
294 + {
295 + if (!(__err & ios_base::failbit))
296 + {
297 + char* __sanity;
298 + errno = 0;
299 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
300 + if (__sanity != __s && errno != ERANGE)
301 + __v = __ld;
302 + else
303 + __err |= ios_base::failbit;
304 + }
305 + }
306 +
307 + void
308 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
309 + __c_locale __old)
310 + {
311 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
312 +#ifdef __UCLIBC_HAS_XLOCALE__
313 + if (!__cloc)
314 + {
315 + // This named locale is not supported by the underlying OS.
316 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
317 + "name not valid"));
318 + }
319 +#endif
320 + }
321 +
322 + void
323 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
324 + {
325 + if (_S_get_c_locale() != __cloc)
326 + __freelocale(__cloc);
327 + }
328 +
329 + __c_locale
330 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
331 + { return __duplocale(__cloc); }
332 +} // namespace std
333 +
334 +namespace __gnu_cxx
335 +{
336 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
337 + {
338 + "LC_CTYPE",
339 + "LC_NUMERIC",
340 + "LC_TIME",
341 + "LC_COLLATE",
342 + "LC_MONETARY",
343 + "LC_MESSAGES",
344 +#if _GLIBCXX_NUM_CATEGORIES != 0
345 + "LC_PAPER",
346 + "LC_NAME",
347 + "LC_ADDRESS",
348 + "LC_TELEPHONE",
349 + "LC_MEASUREMENT",
350 + "LC_IDENTIFICATION"
351 +#endif
352 + };
353 +}
354 +
355 +namespace std
356 +{
357 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
358 +} // namespace std
359 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.h
360 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
361 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-09-10 10:48:08.000000000 -0500
362 @@ -0,0 +1,115 @@
363 +// Wrapper for underlying C-language localization -*- C++ -*-
364 +
365 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
366 +//
367 +// This file is part of the GNU ISO C++ Library. This library is free
368 +// software; you can redistribute it and/or modify it under the
369 +// terms of the GNU General Public License as published by the
370 +// Free Software Foundation; either version 2, or (at your option)
371 +// any later version.
372 +
373 +// This library is distributed in the hope that it will be useful,
374 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
375 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376 +// GNU General Public License for more details.
377 +
378 +// You should have received a copy of the GNU General Public License along
379 +// with this library; see the file COPYING. If not, write to the Free
380 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
381 +// USA.
382 +
383 +// As a special exception, you may use this file as part of a free software
384 +// library without restriction. Specifically, if other files instantiate
385 +// templates or use macros or inline functions from this file, or you compile
386 +// this file and link it with other files to produce an executable, this
387 +// file does not by itself cause the resulting executable to be covered by
388 +// the GNU General Public License. This exception does not however
389 +// invalidate any other reasons why the executable file might be covered by
390 +// the GNU General Public License.
391 +
392 +//
393 +// ISO C++ 14882: 22.8 Standard locale categories.
394 +//
395 +
396 +// Written by Benjamin Kosnik <bkoz@redhat.com>
397 +
398 +#ifndef _C_LOCALE_H
399 +#define _C_LOCALE_H 1
400 +
401 +#pragma GCC system_header
402 +
403 +#include <cstring> // get std::strlen
404 +#include <cstdio> // get std::snprintf or std::sprintf
405 +#include <clocale>
406 +#include <langinfo.h> // For codecvt
407 +#ifdef __UCLIBC_MJN3_ONLY__
408 +#warning fix this
409 +#endif
410 +#ifdef __UCLIBC_HAS_LOCALE__
411 +#include <iconv.h> // For codecvt using iconv, iconv_t
412 +#endif
413 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
414 +#include <libintl.h> // For messages
415 +#endif
416 +
417 +#ifdef __UCLIBC_MJN3_ONLY__
418 +#warning what is _GLIBCXX_C_LOCALE_GNU for
419 +#endif
420 +#define _GLIBCXX_C_LOCALE_GNU 1
421 +
422 +#ifdef __UCLIBC_MJN3_ONLY__
423 +#warning fix categories
424 +#endif
425 +// #define _GLIBCXX_NUM_CATEGORIES 6
426 +#define _GLIBCXX_NUM_CATEGORIES 0
427 +
428 +#ifdef __UCLIBC_HAS_XLOCALE__
429 +namespace __gnu_cxx
430 +{
431 + extern "C" __typeof(uselocale) __uselocale;
432 +}
433 +#endif
434 +
435 +namespace std
436 +{
437 +#ifdef __UCLIBC_HAS_XLOCALE__
438 + typedef __locale_t __c_locale;
439 +#else
440 + typedef int* __c_locale;
441 +#endif
442 +
443 + // Convert numeric value of type _Tv to string and return length of
444 + // string. If snprintf is available use it, otherwise fall back to
445 + // the unsafe sprintf which, in general, can be dangerous and should
446 + // be avoided.
447 + template<typename _Tv>
448 + int
449 + __convert_from_v(char* __out, const int __size, const char* __fmt,
450 +#ifdef __UCLIBC_HAS_XLOCALE__
451 + _Tv __v, const __c_locale& __cloc, int __prec)
452 + {
453 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
454 +#else
455 + _Tv __v, const __c_locale&, int __prec)
456 + {
457 +# ifdef __UCLIBC_HAS_LOCALE__
458 + char* __old = std::setlocale(LC_ALL, NULL);
459 + char* __sav = new char[std::strlen(__old) + 1];
460 + std::strcpy(__sav, __old);
461 + std::setlocale(LC_ALL, "C");
462 +# endif
463 +#endif
464 +
465 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
466 +
467 +#ifdef __UCLIBC_HAS_XLOCALE__
468 + __gnu_cxx::__uselocale(__old);
469 +#elif defined __UCLIBC_HAS_LOCALE__
470 + std::setlocale(LC_ALL, __sav);
471 + delete [] __sav;
472 +#endif
473 + return __ret;
474 + }
475 +}
476 +
477 +#endif
478 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
479 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
480 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-09-10 10:47:40.000000000 -0500
481 @@ -0,0 +1,306 @@
482 +// std::codecvt implementation details, GNU version -*- C++ -*-
483 +
484 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
485 +//
486 +// This file is part of the GNU ISO C++ Library. This library is free
487 +// software; you can redistribute it and/or modify it under the
488 +// terms of the GNU General Public License as published by the
489 +// Free Software Foundation; either version 2, or (at your option)
490 +// any later version.
491 +
492 +// This library is distributed in the hope that it will be useful,
493 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
494 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
495 +// GNU General Public License for more details.
496 +
497 +// You should have received a copy of the GNU General Public License along
498 +// with this library; see the file COPYING. If not, write to the Free
499 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
500 +// USA.
501 +
502 +// As a special exception, you may use this file as part of a free software
503 +// library without restriction. Specifically, if other files instantiate
504 +// templates or use macros or inline functions from this file, or you compile
505 +// this file and link it with other files to produce an executable, this
506 +// file does not by itself cause the resulting executable to be covered by
507 +// the GNU General Public License. This exception does not however
508 +// invalidate any other reasons why the executable file might be covered by
509 +// the GNU General Public License.
510 +
511 +//
512 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
513 +//
514 +
515 +// Written by Benjamin Kosnik <bkoz@redhat.com>
516 +
517 +#include <locale>
518 +#include <bits/c++locale_internal.h>
519 +
520 +namespace std
521 +{
522 + // Specializations.
523 +#ifdef _GLIBCXX_USE_WCHAR_T
524 + codecvt_base::result
525 + codecvt<wchar_t, char, mbstate_t>::
526 + do_out(state_type& __state, const intern_type* __from,
527 + const intern_type* __from_end, const intern_type*& __from_next,
528 + extern_type* __to, extern_type* __to_end,
529 + extern_type*& __to_next) const
530 + {
531 + result __ret = ok;
532 + state_type __tmp_state(__state);
533 +
534 +#ifdef __UCLIBC_HAS_XLOCALE__
535 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
536 +#endif
537 +
538 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
539 + // in case we fall back to wcrtomb and then continue, in a loop.
540 + // NB: wcsnrtombs is a GNU extension
541 + for (__from_next = __from, __to_next = __to;
542 + __from_next < __from_end && __to_next < __to_end
543 + && __ret == ok;)
544 + {
545 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
546 + __from_end - __from_next);
547 + if (!__from_chunk_end)
548 + __from_chunk_end = __from_end;
549 +
550 + __from = __from_next;
551 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
552 + __from_chunk_end - __from_next,
553 + __to_end - __to_next, &__state);
554 + if (__conv == static_cast<size_t>(-1))
555 + {
556 + // In case of error, in order to stop at the exact place we
557 + // have to start again from the beginning with a series of
558 + // wcrtomb.
559 + for (; __from < __from_next; ++__from)
560 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
561 + __state = __tmp_state;
562 + __ret = error;
563 + }
564 + else if (__from_next && __from_next < __from_chunk_end)
565 + {
566 + __to_next += __conv;
567 + __ret = partial;
568 + }
569 + else
570 + {
571 + __from_next = __from_chunk_end;
572 + __to_next += __conv;
573 + }
574 +
575 + if (__from_next < __from_end && __ret == ok)
576 + {
577 + extern_type __buf[MB_LEN_MAX];
578 + __tmp_state = __state;
579 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
580 + if (__conv > static_cast<size_t>(__to_end - __to_next))
581 + __ret = partial;
582 + else
583 + {
584 + memcpy(__to_next, __buf, __conv);
585 + __state = __tmp_state;
586 + __to_next += __conv;
587 + ++__from_next;
588 + }
589 + }
590 + }
591 +
592 +#ifdef __UCLIBC_HAS_XLOCALE__
593 + __uselocale(__old);
594 +#endif
595 +
596 + return __ret;
597 + }
598 +
599 + codecvt_base::result
600 + codecvt<wchar_t, char, mbstate_t>::
601 + do_in(state_type& __state, const extern_type* __from,
602 + const extern_type* __from_end, const extern_type*& __from_next,
603 + intern_type* __to, intern_type* __to_end,
604 + intern_type*& __to_next) const
605 + {
606 + result __ret = ok;
607 + state_type __tmp_state(__state);
608 +
609 +#ifdef __UCLIBC_HAS_XLOCALE__
610 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
611 +#endif
612 +
613 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
614 + // in case we store a L'\0' and then continue, in a loop.
615 + // NB: mbsnrtowcs is a GNU extension
616 + for (__from_next = __from, __to_next = __to;
617 + __from_next < __from_end && __to_next < __to_end
618 + && __ret == ok;)
619 + {
620 + const extern_type* __from_chunk_end;
621 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
622 + __from_end
623 + - __from_next));
624 + if (!__from_chunk_end)
625 + __from_chunk_end = __from_end;
626 +
627 + __from = __from_next;
628 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
629 + __from_chunk_end - __from_next,
630 + __to_end - __to_next, &__state);
631 + if (__conv == static_cast<size_t>(-1))
632 + {
633 + // In case of error, in order to stop at the exact place we
634 + // have to start again from the beginning with a series of
635 + // mbrtowc.
636 + for (;; ++__to_next, __from += __conv)
637 + {
638 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
639 + &__tmp_state);
640 + if (__conv == static_cast<size_t>(-1)
641 + || __conv == static_cast<size_t>(-2))
642 + break;
643 + }
644 + __from_next = __from;
645 + __state = __tmp_state;
646 + __ret = error;
647 + }
648 + else if (__from_next && __from_next < __from_chunk_end)
649 + {
650 + // It is unclear what to return in this case (see DR 382).
651 + __to_next += __conv;
652 + __ret = partial;
653 + }
654 + else
655 + {
656 + __from_next = __from_chunk_end;
657 + __to_next += __conv;
658 + }
659 +
660 + if (__from_next < __from_end && __ret == ok)
661 + {
662 + if (__to_next < __to_end)
663 + {
664 + // XXX Probably wrong for stateful encodings
665 + __tmp_state = __state;
666 + ++__from_next;
667 + *__to_next++ = L'\0';
668 + }
669 + else
670 + __ret = partial;
671 + }
672 + }
673 +
674 +#ifdef __UCLIBC_HAS_XLOCALE__
675 + __uselocale(__old);
676 +#endif
677 +
678 + return __ret;
679 + }
680 +
681 + int
682 + codecvt<wchar_t, char, mbstate_t>::
683 + do_encoding() const throw()
684 + {
685 + // XXX This implementation assumes that the encoding is
686 + // stateless and is either single-byte or variable-width.
687 + int __ret = 0;
688 +#ifdef __UCLIBC_HAS_XLOCALE__
689 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
690 +#endif
691 + if (MB_CUR_MAX == 1)
692 + __ret = 1;
693 +#ifdef __UCLIBC_HAS_XLOCALE__
694 + __uselocale(__old);
695 +#endif
696 + return __ret;
697 + }
698 +
699 + int
700 + codecvt<wchar_t, char, mbstate_t>::
701 + do_max_length() const throw()
702 + {
703 +#ifdef __UCLIBC_HAS_XLOCALE__
704 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
705 +#endif
706 + // XXX Probably wrong for stateful encodings.
707 + int __ret = MB_CUR_MAX;
708 +#ifdef __UCLIBC_HAS_XLOCALE__
709 + __uselocale(__old);
710 +#endif
711 + return __ret;
712 + }
713 +
714 + int
715 + codecvt<wchar_t, char, mbstate_t>::
716 + do_length(state_type& __state, const extern_type* __from,
717 + const extern_type* __end, size_t __max) const
718 + {
719 + int __ret = 0;
720 + state_type __tmp_state(__state);
721 +
722 +#ifdef __UCLIBC_HAS_XLOCALE__
723 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
724 +#endif
725 +
726 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
727 + // in case we advance past it and then continue, in a loop.
728 + // NB: mbsnrtowcs is a GNU extension
729 +
730 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
731 + // its fourth parameter (it wouldn't with NULL as first parameter).
732 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
733 + * __max));
734 + while (__from < __end && __max)
735 + {
736 + const extern_type* __from_chunk_end;
737 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
738 + __end
739 + - __from));
740 + if (!__from_chunk_end)
741 + __from_chunk_end = __end;
742 +
743 + const extern_type* __tmp_from = __from;
744 + size_t __conv = mbsnrtowcs(__to, &__from,
745 + __from_chunk_end - __from,
746 + __max, &__state);
747 + if (__conv == static_cast<size_t>(-1))
748 + {
749 + // In case of error, in order to stop at the exact place we
750 + // have to start again from the beginning with a series of
751 + // mbrtowc.
752 + for (__from = __tmp_from;; __from += __conv)
753 + {
754 + __conv = mbrtowc(NULL, __from, __end - __from,
755 + &__tmp_state);
756 + if (__conv == static_cast<size_t>(-1)
757 + || __conv == static_cast<size_t>(-2))
758 + break;
759 + }
760 + __state = __tmp_state;
761 + __ret += __from - __tmp_from;
762 + break;
763 + }
764 + if (!__from)
765 + __from = __from_chunk_end;
766 +
767 + __ret += __from - __tmp_from;
768 + __max -= __conv;
769 +
770 + if (__from < __end && __max)
771 + {
772 + // XXX Probably wrong for stateful encodings
773 + __tmp_state = __state;
774 + ++__from;
775 + ++__ret;
776 + --__max;
777 + }
778 + }
779 +
780 +#ifdef __UCLIBC_HAS_XLOCALE__
781 + __uselocale(__old);
782 +#endif
783 +
784 + return __ret;
785 + }
786 +#endif
787 +}
788 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/collate_members.cc
789 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
790 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-09-10 10:47:40.000000000 -0500
791 @@ -0,0 +1,80 @@
792 +// std::collate implementation details, GNU version -*- C++ -*-
793 +
794 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
795 +//
796 +// This file is part of the GNU ISO C++ Library. This library is free
797 +// software; you can redistribute it and/or modify it under the
798 +// terms of the GNU General Public License as published by the
799 +// Free Software Foundation; either version 2, or (at your option)
800 +// any later version.
801 +
802 +// This library is distributed in the hope that it will be useful,
803 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
804 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
805 +// GNU General Public License for more details.
806 +
807 +// You should have received a copy of the GNU General Public License along
808 +// with this library; see the file COPYING. If not, write to the Free
809 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
810 +// USA.
811 +
812 +// As a special exception, you may use this file as part of a free software
813 +// library without restriction. Specifically, if other files instantiate
814 +// templates or use macros or inline functions from this file, or you compile
815 +// this file and link it with other files to produce an executable, this
816 +// file does not by itself cause the resulting executable to be covered by
817 +// the GNU General Public License. This exception does not however
818 +// invalidate any other reasons why the executable file might be covered by
819 +// the GNU General Public License.
820 +
821 +//
822 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
823 +//
824 +
825 +// Written by Benjamin Kosnik <bkoz@redhat.com>
826 +
827 +#include <locale>
828 +#include <bits/c++locale_internal.h>
829 +
830 +#ifndef __UCLIBC_HAS_XLOCALE__
831 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
832 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
833 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
834 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
835 +#endif
836 +
837 +namespace std
838 +{
839 + // These are basically extensions to char_traits, and perhaps should
840 + // be put there instead of here.
841 + template<>
842 + int
843 + collate<char>::_M_compare(const char* __one, const char* __two) const
844 + {
845 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
846 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
847 + }
848 +
849 + template<>
850 + size_t
851 + collate<char>::_M_transform(char* __to, const char* __from,
852 + size_t __n) const
853 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
854 +
855 +#ifdef _GLIBCXX_USE_WCHAR_T
856 + template<>
857 + int
858 + collate<wchar_t>::_M_compare(const wchar_t* __one,
859 + const wchar_t* __two) const
860 + {
861 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
862 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
863 + }
864 +
865 + template<>
866 + size_t
867 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
868 + size_t __n) const
869 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
870 +#endif
871 +}
872 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc
873 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
874 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-09-10 10:47:40.000000000 -0500
875 @@ -0,0 +1,300 @@
876 +// std::ctype implementation details, GNU version -*- C++ -*-
877 +
878 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
879 +//
880 +// This file is part of the GNU ISO C++ Library. This library is free
881 +// software; you can redistribute it and/or modify it under the
882 +// terms of the GNU General Public License as published by the
883 +// Free Software Foundation; either version 2, or (at your option)
884 +// any later version.
885 +
886 +// This library is distributed in the hope that it will be useful,
887 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
888 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
889 +// GNU General Public License for more details.
890 +
891 +// You should have received a copy of the GNU General Public License along
892 +// with this library; see the file COPYING. If not, write to the Free
893 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
894 +// USA.
895 +
896 +// As a special exception, you may use this file as part of a free software
897 +// library without restriction. Specifically, if other files instantiate
898 +// templates or use macros or inline functions from this file, or you compile
899 +// this file and link it with other files to produce an executable, this
900 +// file does not by itself cause the resulting executable to be covered by
901 +// the GNU General Public License. This exception does not however
902 +// invalidate any other reasons why the executable file might be covered by
903 +// the GNU General Public License.
904 +
905 +//
906 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
907 +//
908 +
909 +// Written by Benjamin Kosnik <bkoz@redhat.com>
910 +
911 +#define _LIBC
912 +#include <locale>
913 +#undef _LIBC
914 +#include <bits/c++locale_internal.h>
915 +
916 +#ifndef __UCLIBC_HAS_XLOCALE__
917 +#define __wctype_l(S, L) wctype((S))
918 +#define __towupper_l(C, L) towupper((C))
919 +#define __towlower_l(C, L) towlower((C))
920 +#define __iswctype_l(C, M, L) iswctype((C), (M))
921 +#endif
922 +
923 +namespace std
924 +{
925 + // NB: The other ctype<char> specializations are in src/locale.cc and
926 + // various /config/os/* files.
927 + template<>
928 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
929 + : ctype<char>(0, false, __refs)
930 + {
931 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
932 + {
933 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
934 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
935 +#ifdef __UCLIBC_HAS_XLOCALE__
936 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
937 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
938 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
939 +#endif
940 + }
941 + }
942 +
943 +#ifdef _GLIBCXX_USE_WCHAR_T
944 + ctype<wchar_t>::__wmask_type
945 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
946 + {
947 + __wmask_type __ret;
948 + switch (__m)
949 + {
950 + case space:
951 + __ret = __wctype_l("space", _M_c_locale_ctype);
952 + break;
953 + case print:
954 + __ret = __wctype_l("print", _M_c_locale_ctype);
955 + break;
956 + case cntrl:
957 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
958 + break;
959 + case upper:
960 + __ret = __wctype_l("upper", _M_c_locale_ctype);
961 + break;
962 + case lower:
963 + __ret = __wctype_l("lower", _M_c_locale_ctype);
964 + break;
965 + case alpha:
966 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
967 + break;
968 + case digit:
969 + __ret = __wctype_l("digit", _M_c_locale_ctype);
970 + break;
971 + case punct:
972 + __ret = __wctype_l("punct", _M_c_locale_ctype);
973 + break;
974 + case xdigit:
975 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
976 + break;
977 + case alnum:
978 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
979 + break;
980 + case graph:
981 + __ret = __wctype_l("graph", _M_c_locale_ctype);
982 + break;
983 + default:
984 + __ret = 0;
985 + }
986 + return __ret;
987 + }
988 +
989 + wchar_t
990 + ctype<wchar_t>::do_toupper(wchar_t __c) const
991 + { return __towupper_l(__c, _M_c_locale_ctype); }
992 +
993 + const wchar_t*
994 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
995 + {
996 + while (__lo < __hi)
997 + {
998 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
999 + ++__lo;
1000 + }
1001 + return __hi;
1002 + }
1003 +
1004 + wchar_t
1005 + ctype<wchar_t>::do_tolower(wchar_t __c) const
1006 + { return __towlower_l(__c, _M_c_locale_ctype); }
1007 +
1008 + const wchar_t*
1009 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
1010 + {
1011 + while (__lo < __hi)
1012 + {
1013 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
1014 + ++__lo;
1015 + }
1016 + return __hi;
1017 + }
1018 +
1019 + bool
1020 + ctype<wchar_t>::
1021 + do_is(mask __m, wchar_t __c) const
1022 + {
1023 + // Highest bitmask in ctype_base == 10, but extra in "C"
1024 + // library for blank.
1025 + bool __ret = false;
1026 + const size_t __bitmasksize = 11;
1027 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1028 + if (__m & _M_bit[__bitcur]
1029 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
1030 + {
1031 + __ret = true;
1032 + break;
1033 + }
1034 + return __ret;
1035 + }
1036 +
1037 + const wchar_t*
1038 + ctype<wchar_t>::
1039 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
1040 + {
1041 + for (; __lo < __hi; ++__vec, ++__lo)
1042 + {
1043 + // Highest bitmask in ctype_base == 10, but extra in "C"
1044 + // library for blank.
1045 + const size_t __bitmasksize = 11;
1046 + mask __m = 0;
1047 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1048 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
1049 + __m |= _M_bit[__bitcur];
1050 + *__vec = __m;
1051 + }
1052 + return __hi;
1053 + }
1054 +
1055 + const wchar_t*
1056 + ctype<wchar_t>::
1057 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1058 + {
1059 + while (__lo < __hi && !this->do_is(__m, *__lo))
1060 + ++__lo;
1061 + return __lo;
1062 + }
1063 +
1064 + const wchar_t*
1065 + ctype<wchar_t>::
1066 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1067 + {
1068 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1069 + ++__lo;
1070 + return __lo;
1071 + }
1072 +
1073 + wchar_t
1074 + ctype<wchar_t>::
1075 + do_widen(char __c) const
1076 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1077 +
1078 + const char*
1079 + ctype<wchar_t>::
1080 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1081 + {
1082 + while (__lo < __hi)
1083 + {
1084 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1085 + ++__lo;
1086 + ++__dest;
1087 + }
1088 + return __hi;
1089 + }
1090 +
1091 + char
1092 + ctype<wchar_t>::
1093 + do_narrow(wchar_t __wc, char __dfault) const
1094 + {
1095 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1096 + return _M_narrow[__wc];
1097 +#ifdef __UCLIBC_HAS_XLOCALE__
1098 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1099 +#endif
1100 + const int __c = wctob(__wc);
1101 +#ifdef __UCLIBC_HAS_XLOCALE__
1102 + __uselocale(__old);
1103 +#endif
1104 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1105 + }
1106 +
1107 + const wchar_t*
1108 + ctype<wchar_t>::
1109 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1110 + char* __dest) const
1111 + {
1112 +#ifdef __UCLIBC_HAS_XLOCALE__
1113 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1114 +#endif
1115 + if (_M_narrow_ok)
1116 + while (__lo < __hi)
1117 + {
1118 + if (*__lo >= 0 && *__lo < 128)
1119 + *__dest = _M_narrow[*__lo];
1120 + else
1121 + {
1122 + const int __c = wctob(*__lo);
1123 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1124 + }
1125 + ++__lo;
1126 + ++__dest;
1127 + }
1128 + else
1129 + while (__lo < __hi)
1130 + {
1131 + const int __c = wctob(*__lo);
1132 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1133 + ++__lo;
1134 + ++__dest;
1135 + }
1136 +#ifdef __UCLIBC_HAS_XLOCALE__
1137 + __uselocale(__old);
1138 +#endif
1139 + return __hi;
1140 + }
1141 +
1142 + void
1143 + ctype<wchar_t>::_M_initialize_ctype()
1144 + {
1145 +#ifdef __UCLIBC_HAS_XLOCALE__
1146 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1147 +#endif
1148 + wint_t __i;
1149 + for (__i = 0; __i < 128; ++__i)
1150 + {
1151 + const int __c = wctob(__i);
1152 + if (__c == EOF)
1153 + break;
1154 + else
1155 + _M_narrow[__i] = static_cast<char>(__c);
1156 + }
1157 + if (__i == 128)
1158 + _M_narrow_ok = true;
1159 + else
1160 + _M_narrow_ok = false;
1161 + for (size_t __j = 0;
1162 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1163 + _M_widen[__j] = btowc(__j);
1164 +
1165 + for (size_t __k = 0; __k <= 11; ++__k)
1166 + {
1167 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1168 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1169 + }
1170 +#ifdef __UCLIBC_HAS_XLOCALE__
1171 + __uselocale(__old);
1172 +#endif
1173 + }
1174 +#endif // _GLIBCXX_USE_WCHAR_T
1175 +}
1176 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.cc
1177 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
1178 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-09-10 10:47:40.000000000 -0500
1179 @@ -0,0 +1,100 @@
1180 +// std::messages implementation details, GNU version -*- C++ -*-
1181 +
1182 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1183 +//
1184 +// This file is part of the GNU ISO C++ Library. This library is free
1185 +// software; you can redistribute it and/or modify it under the
1186 +// terms of the GNU General Public License as published by the
1187 +// Free Software Foundation; either version 2, or (at your option)
1188 +// any later version.
1189 +
1190 +// This library is distributed in the hope that it will be useful,
1191 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1192 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1193 +// GNU General Public License for more details.
1194 +
1195 +// You should have received a copy of the GNU General Public License along
1196 +// with this library; see the file COPYING. If not, write to the Free
1197 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1198 +// USA.
1199 +
1200 +// As a special exception, you may use this file as part of a free software
1201 +// library without restriction. Specifically, if other files instantiate
1202 +// templates or use macros or inline functions from this file, or you compile
1203 +// this file and link it with other files to produce an executable, this
1204 +// file does not by itself cause the resulting executable to be covered by
1205 +// the GNU General Public License. This exception does not however
1206 +// invalidate any other reasons why the executable file might be covered by
1207 +// the GNU General Public License.
1208 +
1209 +//
1210 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1211 +//
1212 +
1213 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1214 +
1215 +#include <locale>
1216 +#include <bits/c++locale_internal.h>
1217 +
1218 +#ifdef __UCLIBC_MJN3_ONLY__
1219 +#warning fix gettext stuff
1220 +#endif
1221 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1222 +extern "C" char *__dcgettext(const char *domainname,
1223 + const char *msgid, int category);
1224 +#undef gettext
1225 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1226 +#else
1227 +#undef gettext
1228 +#define gettext(msgid) (msgid)
1229 +#endif
1230 +
1231 +namespace std
1232 +{
1233 + // Specializations.
1234 + template<>
1235 + string
1236 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1237 + {
1238 +#ifdef __UCLIBC_HAS_XLOCALE__
1239 + __c_locale __old = __uselocale(_M_c_locale_messages);
1240 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1241 + __uselocale(__old);
1242 + return string(__msg);
1243 +#elif defined __UCLIBC_HAS_LOCALE__
1244 + char* __old = strdup(setlocale(LC_ALL, NULL));
1245 + setlocale(LC_ALL, _M_name_messages);
1246 + const char* __msg = gettext(__dfault.c_str());
1247 + setlocale(LC_ALL, __old);
1248 + free(__old);
1249 + return string(__msg);
1250 +#else
1251 + const char* __msg = gettext(__dfault.c_str());
1252 + return string(__msg);
1253 +#endif
1254 + }
1255 +
1256 +#ifdef _GLIBCXX_USE_WCHAR_T
1257 + template<>
1258 + wstring
1259 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1260 + {
1261 +# ifdef __UCLIBC_HAS_XLOCALE__
1262 + __c_locale __old = __uselocale(_M_c_locale_messages);
1263 + char* __msg = gettext(_M_convert_to_char(__dfault));
1264 + __uselocale(__old);
1265 + return _M_convert_from_char(__msg);
1266 +# elif defined __UCLIBC_HAS_LOCALE__
1267 + char* __old = strdup(setlocale(LC_ALL, NULL));
1268 + setlocale(LC_ALL, _M_name_messages);
1269 + char* __msg = gettext(_M_convert_to_char(__dfault));
1270 + setlocale(LC_ALL, __old);
1271 + free(__old);
1272 + return _M_convert_from_char(__msg);
1273 +# else
1274 + char* __msg = gettext(_M_convert_to_char(__dfault));
1275 + return _M_convert_from_char(__msg);
1276 +# endif
1277 + }
1278 +#endif
1279 +}
1280 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
1281 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
1282 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-09-10 10:47:40.000000000 -0500
1283 @@ -0,0 +1,118 @@
1284 +// std::messages implementation details, GNU version -*- C++ -*-
1285 +
1286 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1287 +//
1288 +// This file is part of the GNU ISO C++ Library. This library is free
1289 +// software; you can redistribute it and/or modify it under the
1290 +// terms of the GNU General Public License as published by the
1291 +// Free Software Foundation; either version 2, or (at your option)
1292 +// any later version.
1293 +
1294 +// This library is distributed in the hope that it will be useful,
1295 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1296 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1297 +// GNU General Public License for more details.
1298 +
1299 +// You should have received a copy of the GNU General Public License along
1300 +// with this library; see the file COPYING. If not, write to the Free
1301 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1302 +// USA.
1303 +
1304 +// As a special exception, you may use this file as part of a free software
1305 +// library without restriction. Specifically, if other files instantiate
1306 +// templates or use macros or inline functions from this file, or you compile
1307 +// this file and link it with other files to produce an executable, this
1308 +// file does not by itself cause the resulting executable to be covered by
1309 +// the GNU General Public License. This exception does not however
1310 +// invalidate any other reasons why the executable file might be covered by
1311 +// the GNU General Public License.
1312 +
1313 +//
1314 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1315 +//
1316 +
1317 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1318 +
1319 +#ifdef __UCLIBC_MJN3_ONLY__
1320 +#warning fix prototypes for *textdomain funcs
1321 +#endif
1322 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1323 +extern "C" char *__textdomain(const char *domainname);
1324 +extern "C" char *__bindtextdomain(const char *domainname,
1325 + const char *dirname);
1326 +#else
1327 +#undef __textdomain
1328 +#undef __bindtextdomain
1329 +#define __textdomain(D) ((void)0)
1330 +#define __bindtextdomain(D,P) ((void)0)
1331 +#endif
1332 +
1333 + // Non-virtual member functions.
1334 + template<typename _CharT>
1335 + messages<_CharT>::messages(size_t __refs)
1336 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1337 + _M_name_messages(_S_get_c_name())
1338 + { }
1339 +
1340 + template<typename _CharT>
1341 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1342 + size_t __refs)
1343 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1344 + _M_name_messages(__s)
1345 + {
1346 + char* __tmp = new char[std::strlen(__s) + 1];
1347 + std::strcpy(__tmp, __s);
1348 + _M_name_messages = __tmp;
1349 + }
1350 +
1351 + template<typename _CharT>
1352 + typename messages<_CharT>::catalog
1353 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1354 + const char* __dir) const
1355 + {
1356 + __bindtextdomain(__s.c_str(), __dir);
1357 + return this->do_open(__s, __loc);
1358 + }
1359 +
1360 + // Virtual member functions.
1361 + template<typename _CharT>
1362 + messages<_CharT>::~messages()
1363 + {
1364 + if (_M_name_messages != _S_get_c_name())
1365 + delete [] _M_name_messages;
1366 + _S_destroy_c_locale(_M_c_locale_messages);
1367 + }
1368 +
1369 + template<typename _CharT>
1370 + typename messages<_CharT>::catalog
1371 + messages<_CharT>::do_open(const basic_string<char>& __s,
1372 + const locale&) const
1373 + {
1374 + // No error checking is done, assume the catalog exists and can
1375 + // be used.
1376 + __textdomain(__s.c_str());
1377 + return 0;
1378 + }
1379 +
1380 + template<typename _CharT>
1381 + void
1382 + messages<_CharT>::do_close(catalog) const
1383 + { }
1384 +
1385 + // messages_byname
1386 + template<typename _CharT>
1387 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1388 + : messages<_CharT>(__refs)
1389 + {
1390 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1391 + delete [] this->_M_name_messages;
1392 + char* __tmp = new char[std::strlen(__s) + 1];
1393 + std::strcpy(__tmp, __s);
1394 + this->_M_name_messages = __tmp;
1395 +
1396 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1397 + {
1398 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1399 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1400 + }
1401 + }
1402 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1403 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
1404 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-09-10 10:47:40.000000000 -0500
1405 @@ -0,0 +1,698 @@
1406 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1407 +
1408 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1409 +//
1410 +// This file is part of the GNU ISO C++ Library. This library is free
1411 +// software; you can redistribute it and/or modify it under the
1412 +// terms of the GNU General Public License as published by the
1413 +// Free Software Foundation; either version 2, or (at your option)
1414 +// any later version.
1415 +
1416 +// This library is distributed in the hope that it will be useful,
1417 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1418 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1419 +// GNU General Public License for more details.
1420 +
1421 +// You should have received a copy of the GNU General Public License along
1422 +// with this library; see the file COPYING. If not, write to the Free
1423 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1424 +// USA.
1425 +
1426 +// As a special exception, you may use this file as part of a free software
1427 +// library without restriction. Specifically, if other files instantiate
1428 +// templates or use macros or inline functions from this file, or you compile
1429 +// this file and link it with other files to produce an executable, this
1430 +// file does not by itself cause the resulting executable to be covered by
1431 +// the GNU General Public License. This exception does not however
1432 +// invalidate any other reasons why the executable file might be covered by
1433 +// the GNU General Public License.
1434 +
1435 +//
1436 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1437 +//
1438 +
1439 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1440 +
1441 +#define _LIBC
1442 +#include <locale>
1443 +#undef _LIBC
1444 +#include <bits/c++locale_internal.h>
1445 +
1446 +#ifdef __UCLIBC_MJN3_ONLY__
1447 +#warning optimize this for uclibc
1448 +#warning tailor for stub locale support
1449 +#endif
1450 +
1451 +#ifndef __UCLIBC_HAS_XLOCALE__
1452 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1453 +#endif
1454 +
1455 +namespace std
1456 +{
1457 + // Construct and return valid pattern consisting of some combination of:
1458 + // space none symbol sign value
1459 + money_base::pattern
1460 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1461 + {
1462 + pattern __ret;
1463 +
1464 + // This insanely complicated routine attempts to construct a valid
1465 + // pattern for use with monyepunct. A couple of invariants:
1466 +
1467 + // if (__precedes) symbol -> value
1468 + // else value -> symbol
1469 +
1470 + // if (__space) space
1471 + // else none
1472 +
1473 + // none == never first
1474 + // space never first or last
1475 +
1476 + // Any elegant implementations of this are welcome.
1477 + switch (__posn)
1478 + {
1479 + case 0:
1480 + case 1:
1481 + // 1 The sign precedes the value and symbol.
1482 + __ret.field[0] = sign;
1483 + if (__space)
1484 + {
1485 + // Pattern starts with sign.
1486 + if (__precedes)
1487 + {
1488 + __ret.field[1] = symbol;
1489 + __ret.field[3] = value;
1490 + }
1491 + else
1492 + {
1493 + __ret.field[1] = value;
1494 + __ret.field[3] = symbol;
1495 + }
1496 + __ret.field[2] = space;
1497 + }
1498 + else
1499 + {
1500 + // Pattern starts with sign and ends with none.
1501 + if (__precedes)
1502 + {
1503 + __ret.field[1] = symbol;
1504 + __ret.field[2] = value;
1505 + }
1506 + else
1507 + {
1508 + __ret.field[1] = value;
1509 + __ret.field[2] = symbol;
1510 + }
1511 + __ret.field[3] = none;
1512 + }
1513 + break;
1514 + case 2:
1515 + // 2 The sign follows the value and symbol.
1516 + if (__space)
1517 + {
1518 + // Pattern either ends with sign.
1519 + if (__precedes)
1520 + {
1521 + __ret.field[0] = symbol;
1522 + __ret.field[2] = value;
1523 + }
1524 + else
1525 + {
1526 + __ret.field[0] = value;
1527 + __ret.field[2] = symbol;
1528 + }
1529 + __ret.field[1] = space;
1530 + __ret.field[3] = sign;
1531 + }
1532 + else
1533 + {
1534 + // Pattern ends with sign then none.
1535 + if (__precedes)
1536 + {
1537 + __ret.field[0] = symbol;
1538 + __ret.field[1] = value;
1539 + }
1540 + else
1541 + {
1542 + __ret.field[0] = value;
1543 + __ret.field[1] = symbol;
1544 + }
1545 + __ret.field[2] = sign;
1546 + __ret.field[3] = none;
1547 + }
1548 + break;
1549 + case 3:
1550 + // 3 The sign immediately precedes the symbol.
1551 + if (__precedes)
1552 + {
1553 + __ret.field[0] = sign;
1554 + __ret.field[1] = symbol;
1555 + if (__space)
1556 + {
1557 + __ret.field[2] = space;
1558 + __ret.field[3] = value;
1559 + }
1560 + else
1561 + {
1562 + __ret.field[2] = value;
1563 + __ret.field[3] = none;
1564 + }
1565 + }
1566 + else
1567 + {
1568 + __ret.field[0] = value;
1569 + if (__space)
1570 + {
1571 + __ret.field[1] = space;
1572 + __ret.field[2] = sign;
1573 + __ret.field[3] = symbol;
1574 + }
1575 + else
1576 + {
1577 + __ret.field[1] = sign;
1578 + __ret.field[2] = symbol;
1579 + __ret.field[3] = none;
1580 + }
1581 + }
1582 + break;
1583 + case 4:
1584 + // 4 The sign immediately follows the symbol.
1585 + if (__precedes)
1586 + {
1587 + __ret.field[0] = symbol;
1588 + __ret.field[1] = sign;
1589 + if (__space)
1590 + {
1591 + __ret.field[2] = space;
1592 + __ret.field[3] = value;
1593 + }
1594 + else
1595 + {
1596 + __ret.field[2] = value;
1597 + __ret.field[3] = none;
1598 + }
1599 + }
1600 + else
1601 + {
1602 + __ret.field[0] = value;
1603 + if (__space)
1604 + {
1605 + __ret.field[1] = space;
1606 + __ret.field[2] = symbol;
1607 + __ret.field[3] = sign;
1608 + }
1609 + else
1610 + {
1611 + __ret.field[1] = symbol;
1612 + __ret.field[2] = sign;
1613 + __ret.field[3] = none;
1614 + }
1615 + }
1616 + break;
1617 + default:
1618 + ;
1619 + }
1620 + return __ret;
1621 + }
1622 +
1623 + template<>
1624 + void
1625 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1626 + const char*)
1627 + {
1628 + if (!_M_data)
1629 + _M_data = new __moneypunct_cache<char, true>;
1630 +
1631 + if (!__cloc)
1632 + {
1633 + // "C" locale
1634 + _M_data->_M_decimal_point = '.';
1635 + _M_data->_M_thousands_sep = ',';
1636 + _M_data->_M_grouping = "";
1637 + _M_data->_M_grouping_size = 0;
1638 + _M_data->_M_curr_symbol = "";
1639 + _M_data->_M_curr_symbol_size = 0;
1640 + _M_data->_M_positive_sign = "";
1641 + _M_data->_M_positive_sign_size = 0;
1642 + _M_data->_M_negative_sign = "";
1643 + _M_data->_M_negative_sign_size = 0;
1644 + _M_data->_M_frac_digits = 0;
1645 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1646 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1647 +
1648 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1649 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1650 + }
1651 + else
1652 + {
1653 + // Named locale.
1654 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1655 + __cloc));
1656 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1657 + __cloc));
1658 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1659 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1660 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1661 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1662 +
1663 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1664 + if (!__nposn)
1665 + _M_data->_M_negative_sign = "()";
1666 + else
1667 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1668 + __cloc);
1669 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1670 +
1671 + // _Intl == true
1672 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1673 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1674 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1675 + __cloc));
1676 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1677 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1678 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1679 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1680 + __pposn);
1681 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1682 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1683 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1684 + __nposn);
1685 + }
1686 + }
1687 +
1688 + template<>
1689 + void
1690 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1691 + const char*)
1692 + {
1693 + if (!_M_data)
1694 + _M_data = new __moneypunct_cache<char, false>;
1695 +
1696 + if (!__cloc)
1697 + {
1698 + // "C" locale
1699 + _M_data->_M_decimal_point = '.';
1700 + _M_data->_M_thousands_sep = ',';
1701 + _M_data->_M_grouping = "";
1702 + _M_data->_M_grouping_size = 0;
1703 + _M_data->_M_curr_symbol = "";
1704 + _M_data->_M_curr_symbol_size = 0;
1705 + _M_data->_M_positive_sign = "";
1706 + _M_data->_M_positive_sign_size = 0;
1707 + _M_data->_M_negative_sign = "";
1708 + _M_data->_M_negative_sign_size = 0;
1709 + _M_data->_M_frac_digits = 0;
1710 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1711 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1712 +
1713 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1714 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1715 + }
1716 + else
1717 + {
1718 + // Named locale.
1719 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1720 + __cloc));
1721 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1722 + __cloc));
1723 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1724 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1725 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1726 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1727 +
1728 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1729 + if (!__nposn)
1730 + _M_data->_M_negative_sign = "()";
1731 + else
1732 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1733 + __cloc);
1734 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1735 +
1736 + // _Intl == false
1737 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1738 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1739 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1740 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1741 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1742 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1743 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1744 + __pposn);
1745 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1746 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1747 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1748 + __nposn);
1749 + }
1750 + }
1751 +
1752 + template<>
1753 + moneypunct<char, true>::~moneypunct()
1754 + { delete _M_data; }
1755 +
1756 + template<>
1757 + moneypunct<char, false>::~moneypunct()
1758 + { delete _M_data; }
1759 +
1760 +#ifdef _GLIBCXX_USE_WCHAR_T
1761 + template<>
1762 + void
1763 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1764 +#ifdef __UCLIBC_HAS_XLOCALE__
1765 + const char*)
1766 +#else
1767 + const char* __name)
1768 +#endif
1769 + {
1770 + if (!_M_data)
1771 + _M_data = new __moneypunct_cache<wchar_t, true>;
1772 +
1773 + if (!__cloc)
1774 + {
1775 + // "C" locale
1776 + _M_data->_M_decimal_point = L'.';
1777 + _M_data->_M_thousands_sep = L',';
1778 + _M_data->_M_grouping = "";
1779 + _M_data->_M_grouping_size = 0;
1780 + _M_data->_M_curr_symbol = L"";
1781 + _M_data->_M_curr_symbol_size = 0;
1782 + _M_data->_M_positive_sign = L"";
1783 + _M_data->_M_positive_sign_size = 0;
1784 + _M_data->_M_negative_sign = L"";
1785 + _M_data->_M_negative_sign_size = 0;
1786 + _M_data->_M_frac_digits = 0;
1787 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1788 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1789 +
1790 + // Use ctype::widen code without the facet...
1791 + unsigned char uc;
1792 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1793 + {
1794 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1795 + _M_data->_M_atoms[__i] = btowc(uc);
1796 + }
1797 + }
1798 + else
1799 + {
1800 + // Named locale.
1801 +#ifdef __UCLIBC_HAS_XLOCALE__
1802 + __c_locale __old = __uselocale(__cloc);
1803 +#else
1804 + // Switch to named locale so that mbsrtowcs will work.
1805 + char* __old = strdup(setlocale(LC_ALL, NULL));
1806 + setlocale(LC_ALL, __name);
1807 +#endif
1808 +
1809 +#ifdef __UCLIBC_MJN3_ONLY__
1810 +#warning fix this... should be monetary
1811 +#endif
1812 +#ifdef __UCLIBC__
1813 +# ifdef __UCLIBC_HAS_XLOCALE__
1814 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1815 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1816 +# else
1817 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1818 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1819 +# endif
1820 +#else
1821 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1822 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1823 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1824 +
1825 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1826 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1827 +#endif
1828 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1829 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1830 +
1831 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1832 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1833 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1834 +
1835 + wchar_t* __wcs_ps = 0;
1836 + wchar_t* __wcs_ns = 0;
1837 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1838 + try
1839 + {
1840 + mbstate_t __state;
1841 + size_t __len = strlen(__cpossign);
1842 + if (__len)
1843 + {
1844 + ++__len;
1845 + memset(&__state, 0, sizeof(mbstate_t));
1846 + __wcs_ps = new wchar_t[__len];
1847 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1848 + _M_data->_M_positive_sign = __wcs_ps;
1849 + }
1850 + else
1851 + _M_data->_M_positive_sign = L"";
1852 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1853 +
1854 + __len = strlen(__cnegsign);
1855 + if (!__nposn)
1856 + _M_data->_M_negative_sign = L"()";
1857 + else if (__len)
1858 + {
1859 + ++__len;
1860 + memset(&__state, 0, sizeof(mbstate_t));
1861 + __wcs_ns = new wchar_t[__len];
1862 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1863 + _M_data->_M_negative_sign = __wcs_ns;
1864 + }
1865 + else
1866 + _M_data->_M_negative_sign = L"";
1867 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1868 +
1869 + // _Intl == true.
1870 + __len = strlen(__ccurr);
1871 + if (__len)
1872 + {
1873 + ++__len;
1874 + memset(&__state, 0, sizeof(mbstate_t));
1875 + wchar_t* __wcs = new wchar_t[__len];
1876 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1877 + _M_data->_M_curr_symbol = __wcs;
1878 + }
1879 + else
1880 + _M_data->_M_curr_symbol = L"";
1881 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1882 + }
1883 + catch (...)
1884 + {
1885 + delete _M_data;
1886 + _M_data = 0;
1887 + delete __wcs_ps;
1888 + delete __wcs_ns;
1889 +#ifdef __UCLIBC_HAS_XLOCALE__
1890 + __uselocale(__old);
1891 +#else
1892 + setlocale(LC_ALL, __old);
1893 + free(__old);
1894 +#endif
1895 + __throw_exception_again;
1896 + }
1897 +
1898 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1899 + __cloc));
1900 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1901 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1902 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1903 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1904 + __pposn);
1905 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1906 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1907 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1908 + __nposn);
1909 +
1910 +#ifdef __UCLIBC_HAS_XLOCALE__
1911 + __uselocale(__old);
1912 +#else
1913 + setlocale(LC_ALL, __old);
1914 + free(__old);
1915 +#endif
1916 + }
1917 + }
1918 +
1919 + template<>
1920 + void
1921 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1922 +#ifdef __UCLIBC_HAS_XLOCALE__
1923 + const char*)
1924 +#else
1925 + const char* __name)
1926 +#endif
1927 + {
1928 + if (!_M_data)
1929 + _M_data = new __moneypunct_cache<wchar_t, false>;
1930 +
1931 + if (!__cloc)
1932 + {
1933 + // "C" locale
1934 + _M_data->_M_decimal_point = L'.';
1935 + _M_data->_M_thousands_sep = L',';
1936 + _M_data->_M_grouping = "";
1937 + _M_data->_M_grouping_size = 0;
1938 + _M_data->_M_curr_symbol = L"";
1939 + _M_data->_M_curr_symbol_size = 0;
1940 + _M_data->_M_positive_sign = L"";
1941 + _M_data->_M_positive_sign_size = 0;
1942 + _M_data->_M_negative_sign = L"";
1943 + _M_data->_M_negative_sign_size = 0;
1944 + _M_data->_M_frac_digits = 0;
1945 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1946 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1947 +
1948 + // Use ctype::widen code without the facet...
1949 + unsigned char uc;
1950 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1951 + {
1952 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1953 + _M_data->_M_atoms[__i] = btowc(uc);
1954 + }
1955 + }
1956 + else
1957 + {
1958 + // Named locale.
1959 +#ifdef __UCLIBC_HAS_XLOCALE__
1960 + __c_locale __old = __uselocale(__cloc);
1961 +#else
1962 + // Switch to named locale so that mbsrtowcs will work.
1963 + char* __old = strdup(setlocale(LC_ALL, NULL));
1964 + setlocale(LC_ALL, __name);
1965 +#endif
1966 +
1967 +#ifdef __UCLIBC_MJN3_ONLY__
1968 +#warning fix this... should be monetary
1969 +#endif
1970 +#ifdef __UCLIBC__
1971 +# ifdef __UCLIBC_HAS_XLOCALE__
1972 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1973 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1974 +# else
1975 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1976 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1977 +# endif
1978 +#else
1979 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1980 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1981 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1982 +
1983 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1984 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1985 +#endif
1986 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1987 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1988 +
1989 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1990 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1991 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1992 +
1993 + wchar_t* __wcs_ps = 0;
1994 + wchar_t* __wcs_ns = 0;
1995 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1996 + try
1997 + {
1998 + mbstate_t __state;
1999 + size_t __len;
2000 + __len = strlen(__cpossign);
2001 + if (__len)
2002 + {
2003 + ++__len;
2004 + memset(&__state, 0, sizeof(mbstate_t));
2005 + __wcs_ps = new wchar_t[__len];
2006 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
2007 + _M_data->_M_positive_sign = __wcs_ps;
2008 + }
2009 + else
2010 + _M_data->_M_positive_sign = L"";
2011 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
2012 +
2013 + __len = strlen(__cnegsign);
2014 + if (!__nposn)
2015 + _M_data->_M_negative_sign = L"()";
2016 + else if (__len)
2017 + {
2018 + ++__len;
2019 + memset(&__state, 0, sizeof(mbstate_t));
2020 + __wcs_ns = new wchar_t[__len];
2021 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
2022 + _M_data->_M_negative_sign = __wcs_ns;
2023 + }
2024 + else
2025 + _M_data->_M_negative_sign = L"";
2026 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
2027 +
2028 + // _Intl == true.
2029 + __len = strlen(__ccurr);
2030 + if (__len)
2031 + {
2032 + ++__len;
2033 + memset(&__state, 0, sizeof(mbstate_t));
2034 + wchar_t* __wcs = new wchar_t[__len];
2035 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2036 + _M_data->_M_curr_symbol = __wcs;
2037 + }
2038 + else
2039 + _M_data->_M_curr_symbol = L"";
2040 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
2041 + }
2042 + catch (...)
2043 + {
2044 + delete _M_data;
2045 + _M_data = 0;
2046 + delete __wcs_ps;
2047 + delete __wcs_ns;
2048 +#ifdef __UCLIBC_HAS_XLOCALE__
2049 + __uselocale(__old);
2050 +#else
2051 + setlocale(LC_ALL, __old);
2052 + free(__old);
2053 +#endif
2054 + __throw_exception_again;
2055 + }
2056 +
2057 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2058 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2059 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2060 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2061 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2062 + __pposn);
2063 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2064 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2065 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2066 + __nposn);
2067 +
2068 +#ifdef __UCLIBC_HAS_XLOCALE__
2069 + __uselocale(__old);
2070 +#else
2071 + setlocale(LC_ALL, __old);
2072 + free(__old);
2073 +#endif
2074 + }
2075 + }
2076 +
2077 + template<>
2078 + moneypunct<wchar_t, true>::~moneypunct()
2079 + {
2080 + if (_M_data->_M_positive_sign_size)
2081 + delete [] _M_data->_M_positive_sign;
2082 + if (_M_data->_M_negative_sign_size
2083 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2084 + delete [] _M_data->_M_negative_sign;
2085 + if (_M_data->_M_curr_symbol_size)
2086 + delete [] _M_data->_M_curr_symbol;
2087 + delete _M_data;
2088 + }
2089 +
2090 + template<>
2091 + moneypunct<wchar_t, false>::~moneypunct()
2092 + {
2093 + if (_M_data->_M_positive_sign_size)
2094 + delete [] _M_data->_M_positive_sign;
2095 + if (_M_data->_M_negative_sign_size
2096 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2097 + delete [] _M_data->_M_negative_sign;
2098 + if (_M_data->_M_curr_symbol_size)
2099 + delete [] _M_data->_M_curr_symbol;
2100 + delete _M_data;
2101 + }
2102 +#endif
2103 +}
2104 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2105 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
2106 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-09-10 10:47:40.000000000 -0500
2107 @@ -0,0 +1,183 @@
2108 +// std::numpunct implementation details, GNU version -*- C++ -*-
2109 +
2110 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2111 +//
2112 +// This file is part of the GNU ISO C++ Library. This library is free
2113 +// software; you can redistribute it and/or modify it under the
2114 +// terms of the GNU General Public License as published by the
2115 +// Free Software Foundation; either version 2, or (at your option)
2116 +// any later version.
2117 +
2118 +// This library is distributed in the hope that it will be useful,
2119 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2120 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2121 +// GNU General Public License for more details.
2122 +
2123 +// You should have received a copy of the GNU General Public License along
2124 +// with this library; see the file COPYING. If not, write to the Free
2125 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2126 +// USA.
2127 +
2128 +// As a special exception, you may use this file as part of a free software
2129 +// library without restriction. Specifically, if other files instantiate
2130 +// templates or use macros or inline functions from this file, or you compile
2131 +// this file and link it with other files to produce an executable, this
2132 +// file does not by itself cause the resulting executable to be covered by
2133 +// the GNU General Public License. This exception does not however
2134 +// invalidate any other reasons why the executable file might be covered by
2135 +// the GNU General Public License.
2136 +
2137 +//
2138 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2139 +//
2140 +
2141 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2142 +
2143 +#define _LIBC
2144 +#include <locale>
2145 +#undef _LIBC
2146 +#include <bits/c++locale_internal.h>
2147 +
2148 +#ifdef __UCLIBC_MJN3_ONLY__
2149 +#warning tailor for stub locale support
2150 +#endif
2151 +#ifndef __UCLIBC_HAS_XLOCALE__
2152 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2153 +#endif
2154 +
2155 +namespace std
2156 +{
2157 + template<>
2158 + void
2159 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2160 + {
2161 + if (!_M_data)
2162 + _M_data = new __numpunct_cache<char>;
2163 +
2164 + if (!__cloc)
2165 + {
2166 + // "C" locale
2167 + _M_data->_M_grouping = "";
2168 + _M_data->_M_grouping_size = 0;
2169 + _M_data->_M_use_grouping = false;
2170 +
2171 + _M_data->_M_decimal_point = '.';
2172 + _M_data->_M_thousands_sep = ',';
2173 +
2174 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2175 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2176 +
2177 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2178 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2179 + }
2180 + else
2181 + {
2182 + // Named locale.
2183 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2184 + __cloc));
2185 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2186 + __cloc));
2187 +
2188 + // Check for NULL, which implies no grouping.
2189 + if (_M_data->_M_thousands_sep == '\0')
2190 + _M_data->_M_grouping = "";
2191 + else
2192 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2193 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2194 + }
2195 +
2196 + // NB: There is no way to extact this info from posix locales.
2197 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2198 + _M_data->_M_truename = "true";
2199 + _M_data->_M_truename_size = strlen(_M_data->_M_truename);
2200 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2201 + _M_data->_M_falsename = "false";
2202 + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
2203 + }
2204 +
2205 + template<>
2206 + numpunct<char>::~numpunct()
2207 + { delete _M_data; }
2208 +
2209 +#ifdef _GLIBCXX_USE_WCHAR_T
2210 + template<>
2211 + void
2212 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2213 + {
2214 + if (!_M_data)
2215 + _M_data = new __numpunct_cache<wchar_t>;
2216 +
2217 + if (!__cloc)
2218 + {
2219 + // "C" locale
2220 + _M_data->_M_grouping = "";
2221 + _M_data->_M_grouping_size = 0;
2222 + _M_data->_M_use_grouping = false;
2223 +
2224 + _M_data->_M_decimal_point = L'.';
2225 + _M_data->_M_thousands_sep = L',';
2226 +
2227 +#ifdef __UCLIBC_HAS_XLOCALE__
2228 + __c_locale __old = __uselocale(_S_get_c_locale());
2229 +#endif
2230 + // Use ctype::widen code without the facet...
2231 + unsigned char uc;
2232 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2233 + {
2234 + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
2235 + _M_data->_M_atoms_out[__i] = btowc(uc);
2236 + }
2237 +
2238 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2239 + {
2240 + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
2241 + _M_data->_M_atoms_in[__j] = btowc(uc);
2242 + }
2243 +#ifdef __UCLIBC_HAS_XLOCALE__
2244 + __uselocale(__old);
2245 +#endif
2246 + }
2247 + else
2248 + {
2249 + // Named locale.
2250 +#ifdef __UCLIBC_MJN3_ONLY__
2251 +#warning fix this
2252 +#endif
2253 +#ifdef __UCLIBC__
2254 +# ifdef __UCLIBC_HAS_XLOCALE__
2255 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2256 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2257 +# else
2258 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2259 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2260 +# endif
2261 +#else
2262 + union __s_and_w { const char *__s; unsigned int __w; } __u;
2263 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2264 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
2265 +
2266 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2267 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
2268 +#endif
2269 +
2270 + if (_M_data->_M_thousands_sep == L'\0')
2271 + _M_data->_M_grouping = "";
2272 + else
2273 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2274 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2275 + }
2276 +
2277 + // NB: There is no way to extact this info from posix locales.
2278 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2279 + _M_data->_M_truename = L"true";
2280 + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
2281 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2282 + _M_data->_M_falsename = L"false";
2283 + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
2284 + }
2285 +
2286 + template<>
2287 + numpunct<wchar_t>::~numpunct()
2288 + { delete _M_data; }
2289 + #endif
2290 +}
2291 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.cc
2292 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
2293 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-09-10 10:48:00.000000000 -0500
2294 @@ -0,0 +1,356 @@
2295 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2296 +
2297 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2298 +//
2299 +// This file is part of the GNU ISO C++ Library. This library is free
2300 +// software; you can redistribute it and/or modify it under the
2301 +// terms of the GNU General Public License as published by the
2302 +// Free Software Foundation; either version 2, or (at your option)
2303 +// any later version.
2304 +
2305 +// This library is distributed in the hope that it will be useful,
2306 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2307 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2308 +// GNU General Public License for more details.
2309 +
2310 +// You should have received a copy of the GNU General Public License along
2311 +// with this library; see the file COPYING. If not, write to the Free
2312 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2313 +// USA.
2314 +
2315 +// As a special exception, you may use this file as part of a free software
2316 +// library without restriction. Specifically, if other files instantiate
2317 +// templates or use macros or inline functions from this file, or you compile
2318 +// this file and link it with other files to produce an executable, this
2319 +// file does not by itself cause the resulting executable to be covered by
2320 +// the GNU General Public License. This exception does not however
2321 +// invalidate any other reasons why the executable file might be covered by
2322 +// the GNU General Public License.
2323 +
2324 +//
2325 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2326 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2327 +//
2328 +
2329 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2330 +
2331 +#include <locale>
2332 +#include <bits/c++locale_internal.h>
2333 +
2334 +#ifdef __UCLIBC_MJN3_ONLY__
2335 +#warning tailor for stub locale support
2336 +#endif
2337 +#ifndef __UCLIBC_HAS_XLOCALE__
2338 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2339 +#endif
2340 +
2341 +namespace std
2342 +{
2343 + template<>
2344 + void
2345 + __timepunct<char>::
2346 + _M_put(char* __s, size_t __maxlen, const char* __format,
2347 + const tm* __tm) const
2348 + {
2349 +#ifdef __UCLIBC_HAS_XLOCALE__
2350 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2351 + _M_c_locale_timepunct);
2352 +#else
2353 + char* __old = strdup(setlocale(LC_ALL, NULL));
2354 + setlocale(LC_ALL, _M_name_timepunct);
2355 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2356 + setlocale(LC_ALL, __old);
2357 + free(__old);
2358 +#endif
2359 + // Make sure __s is null terminated.
2360 + if (__len == 0)
2361 + __s[0] = '\0';
2362 + }
2363 +
2364 + template<>
2365 + void
2366 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2367 + {
2368 + if (!_M_data)
2369 + _M_data = new __timepunct_cache<char>;
2370 +
2371 + if (!__cloc)
2372 + {
2373 + // "C" locale
2374 + _M_c_locale_timepunct = _S_get_c_locale();
2375 +
2376 + _M_data->_M_date_format = "%m/%d/%y";
2377 + _M_data->_M_date_era_format = "%m/%d/%y";
2378 + _M_data->_M_time_format = "%H:%M:%S";
2379 + _M_data->_M_time_era_format = "%H:%M:%S";
2380 + _M_data->_M_date_time_format = "";
2381 + _M_data->_M_date_time_era_format = "";
2382 + _M_data->_M_am = "AM";
2383 + _M_data->_M_pm = "PM";
2384 + _M_data->_M_am_pm_format = "";
2385 +
2386 + // Day names, starting with "C"'s Sunday.
2387 + _M_data->_M_day1 = "Sunday";
2388 + _M_data->_M_day2 = "Monday";
2389 + _M_data->_M_day3 = "Tuesday";
2390 + _M_data->_M_day4 = "Wednesday";
2391 + _M_data->_M_day5 = "Thursday";
2392 + _M_data->_M_day6 = "Friday";
2393 + _M_data->_M_day7 = "Saturday";
2394 +
2395 + // Abbreviated day names, starting with "C"'s Sun.
2396 + _M_data->_M_aday1 = "Sun";
2397 + _M_data->_M_aday2 = "Mon";
2398 + _M_data->_M_aday3 = "Tue";
2399 + _M_data->_M_aday4 = "Wed";
2400 + _M_data->_M_aday5 = "Thu";
2401 + _M_data->_M_aday6 = "Fri";
2402 + _M_data->_M_aday7 = "Sat";
2403 +
2404 + // Month names, starting with "C"'s January.
2405 + _M_data->_M_month01 = "January";
2406 + _M_data->_M_month02 = "February";
2407 + _M_data->_M_month03 = "March";
2408 + _M_data->_M_month04 = "April";
2409 + _M_data->_M_month05 = "May";
2410 + _M_data->_M_month06 = "June";
2411 + _M_data->_M_month07 = "July";
2412 + _M_data->_M_month08 = "August";
2413 + _M_data->_M_month09 = "September";
2414 + _M_data->_M_month10 = "October";
2415 + _M_data->_M_month11 = "November";
2416 + _M_data->_M_month12 = "December";
2417 +
2418 + // Abbreviated month names, starting with "C"'s Jan.
2419 + _M_data->_M_amonth01 = "Jan";
2420 + _M_data->_M_amonth02 = "Feb";
2421 + _M_data->_M_amonth03 = "Mar";
2422 + _M_data->_M_amonth04 = "Apr";
2423 + _M_data->_M_amonth05 = "May";
2424 + _M_data->_M_amonth06 = "Jun";
2425 + _M_data->_M_amonth07 = "Jul";
2426 + _M_data->_M_amonth08 = "Aug";
2427 + _M_data->_M_amonth09 = "Sep";
2428 + _M_data->_M_amonth10 = "Oct";
2429 + _M_data->_M_amonth11 = "Nov";
2430 + _M_data->_M_amonth12 = "Dec";
2431 + }
2432 + else
2433 + {
2434 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2435 +
2436 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2437 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2438 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2439 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2440 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2441 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
2442 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2443 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2444 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2445 +
2446 + // Day names, starting with "C"'s Sunday.
2447 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2448 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2449 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2450 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2451 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2452 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2453 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2454 +
2455 + // Abbreviated day names, starting with "C"'s Sun.
2456 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2457 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2458 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2459 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2460 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2461 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2462 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2463 +
2464 + // Month names, starting with "C"'s January.
2465 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2466 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2467 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2468 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2469 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2470 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2471 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2472 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2473 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2474 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2475 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2476 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2477 +
2478 + // Abbreviated month names, starting with "C"'s Jan.
2479 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2480 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2481 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2482 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2483 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2484 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2485 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2486 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2487 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2488 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2489 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2490 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2491 + }
2492 + }
2493 +
2494 +#ifdef _GLIBCXX_USE_WCHAR_T
2495 + template<>
2496 + void
2497 + __timepunct<wchar_t>::
2498 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2499 + const tm* __tm) const
2500 + {
2501 +#ifdef __UCLIBC_HAS_XLOCALE__
2502 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2503 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2504 + _M_c_locale_timepunct);
2505 +#else
2506 + char* __old = strdup(setlocale(LC_ALL, NULL));
2507 + setlocale(LC_ALL, _M_name_timepunct);
2508 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2509 + setlocale(LC_ALL, __old);
2510 + free(__old);
2511 +#endif
2512 + // Make sure __s is null terminated.
2513 + if (__len == 0)
2514 + __s[0] = L'\0';
2515 + }
2516 +
2517 + template<>
2518 + void
2519 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2520 + {
2521 + if (!_M_data)
2522 + _M_data = new __timepunct_cache<wchar_t>;
2523 +
2524 +#warning wide time stuff
2525 +// if (!__cloc)
2526 + {
2527 + // "C" locale
2528 + _M_c_locale_timepunct = _S_get_c_locale();
2529 +
2530 + _M_data->_M_date_format = L"%m/%d/%y";
2531 + _M_data->_M_date_era_format = L"%m/%d/%y";
2532 + _M_data->_M_time_format = L"%H:%M:%S";
2533 + _M_data->_M_time_era_format = L"%H:%M:%S";
2534 + _M_data->_M_date_time_format = L"";
2535 + _M_data->_M_date_time_era_format = L"";
2536 + _M_data->_M_am = L"AM";
2537 + _M_data->_M_pm = L"PM";
2538 + _M_data->_M_am_pm_format = L"";
2539 +
2540 + // Day names, starting with "C"'s Sunday.
2541 + _M_data->_M_day1 = L"Sunday";
2542 + _M_data->_M_day2 = L"Monday";
2543 + _M_data->_M_day3 = L"Tuesday";
2544 + _M_data->_M_day4 = L"Wednesday";
2545 + _M_data->_M_day5 = L"Thursday";
2546 + _M_data->_M_day6 = L"Friday";
2547 + _M_data->_M_day7 = L"Saturday";
2548 +
2549 + // Abbreviated day names, starting with "C"'s Sun.
2550 + _M_data->_M_aday1 = L"Sun";
2551 + _M_data->_M_aday2 = L"Mon";
2552 + _M_data->_M_aday3 = L"Tue";
2553 + _M_data->_M_aday4 = L"Wed";
2554 + _M_data->_M_aday5 = L"Thu";
2555 + _M_data->_M_aday6 = L"Fri";
2556 + _M_data->_M_aday7 = L"Sat";
2557 +
2558 + // Month names, starting with "C"'s January.
2559 + _M_data->_M_month01 = L"January";
2560 + _M_data->_M_month02 = L"February";
2561 + _M_data->_M_month03 = L"March";
2562 + _M_data->_M_month04 = L"April";
2563 + _M_data->_M_month05 = L"May";
2564 + _M_data->_M_month06 = L"June";
2565 + _M_data->_M_month07 = L"July";
2566 + _M_data->_M_month08 = L"August";
2567 + _M_data->_M_month09 = L"September";
2568 + _M_data->_M_month10 = L"October";
2569 + _M_data->_M_month11 = L"November";
2570 + _M_data->_M_month12 = L"December";
2571 +
2572 + // Abbreviated month names, starting with "C"'s Jan.
2573 + _M_data->_M_amonth01 = L"Jan";
2574 + _M_data->_M_amonth02 = L"Feb";
2575 + _M_data->_M_amonth03 = L"Mar";
2576 + _M_data->_M_amonth04 = L"Apr";
2577 + _M_data->_M_amonth05 = L"May";
2578 + _M_data->_M_amonth06 = L"Jun";
2579 + _M_data->_M_amonth07 = L"Jul";
2580 + _M_data->_M_amonth08 = L"Aug";
2581 + _M_data->_M_amonth09 = L"Sep";
2582 + _M_data->_M_amonth10 = L"Oct";
2583 + _M_data->_M_amonth11 = L"Nov";
2584 + _M_data->_M_amonth12 = L"Dec";
2585 + }
2586 +#if 0
2587 + else
2588 + {
2589 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2590 +
2591 + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
2592 + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
2593 + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
2594 + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
2595 + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
2596 + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
2597 + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
2598 + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
2599 + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
2600 +
2601 + // Day names, starting with "C"'s Sunday.
2602 + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
2603 + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
2604 + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
2605 + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
2606 + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
2607 + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
2608 + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
2609 +
2610 + // Abbreviated day names, starting with "C"'s Sun.
2611 + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
2612 + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
2613 + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
2614 + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
2615 + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
2616 + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
2617 + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
2618 +
2619 + // Month names, starting with "C"'s January.
2620 + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
2621 + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
2622 + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
2623 + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
2624 + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
2625 + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
2626 + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
2627 + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
2628 + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
2629 + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
2630 + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
2631 + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
2632 +
2633 + // Abbreviated month names, starting with "C"'s Jan.
2634 + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
2635 + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
2636 + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
2637 + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
2638 + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
2639 + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
2640 + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
2641 + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
2642 + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
2643 + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
2644 + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
2645 + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
2646 + }
2647 +#endif // 0
2648 + }
2649 +#endif
2650 +}
2651 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.h
2652 --- gcc-3.4.2-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
2653 +++ gcc-3.4.2/libstdc++-v3/config/locale/uclibc/time_members.h 2004-09-10 10:47:40.000000000 -0500
2654 @@ -0,0 +1,68 @@
2655 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2656 +
2657 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2658 +//
2659 +// This file is part of the GNU ISO C++ Library. This library is free
2660 +// software; you can redistribute it and/or modify it under the
2661 +// terms of the GNU General Public License as published by the
2662 +// Free Software Foundation; either version 2, or (at your option)
2663 +// any later version.
2664 +
2665 +// This library is distributed in the hope that it will be useful,
2666 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2667 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2668 +// GNU General Public License for more details.
2669 +
2670 +// You should have received a copy of the GNU General Public License along
2671 +// with this library; see the file COPYING. If not, write to the Free
2672 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2673 +// USA.
2674 +
2675 +// As a special exception, you may use this file as part of a free software
2676 +// library without restriction. Specifically, if other files instantiate
2677 +// templates or use macros or inline functions from this file, or you compile
2678 +// this file and link it with other files to produce an executable, this
2679 +// file does not by itself cause the resulting executable to be covered by
2680 +// the GNU General Public License. This exception does not however
2681 +// invalidate any other reasons why the executable file might be covered by
2682 +// the GNU General Public License.
2683 +
2684 +//
2685 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2686 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2687 +//
2688 +
2689 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2690 +
2691 + template<typename _CharT>
2692 + __timepunct<_CharT>::__timepunct(size_t __refs)
2693 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2694 + _M_name_timepunct(_S_get_c_name())
2695 + { _M_initialize_timepunct(); }
2696 +
2697 + template<typename _CharT>
2698 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2699 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2700 + _M_name_timepunct(_S_get_c_name())
2701 + { _M_initialize_timepunct(); }
2702 +
2703 + template<typename _CharT>
2704 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2705 + size_t __refs)
2706 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2707 + _M_name_timepunct(__s)
2708 + {
2709 + char* __tmp = new char[std::strlen(__s) + 1];
2710 + std::strcpy(__tmp, __s);
2711 + _M_name_timepunct = __tmp;
2712 + _M_initialize_timepunct(__cloc);
2713 + }
2714 +
2715 + template<typename _CharT>
2716 + __timepunct<_CharT>::~__timepunct()
2717 + {
2718 + if (_M_name_timepunct != _S_get_c_name())
2719 + delete [] _M_name_timepunct;
2720 + delete _M_data;
2721 + _S_destroy_c_locale(_M_c_locale_timepunct);
2722 + }
2723 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_base.h
2724 --- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
2725 +++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-09-10 10:47:40.000000000 -0500
2726 @@ -0,0 +1,58 @@
2727 +// Locale support -*- C++ -*-
2728 +
2729 +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
2730 +// Free Software Foundation, Inc.
2731 +//
2732 +// This file is part of the GNU ISO C++ Library. This library is free
2733 +// software; you can redistribute it and/or modify it under the
2734 +// terms of the GNU General Public License as published by the
2735 +// Free Software Foundation; either version 2, or (at your option)
2736 +// any later version.
2737 +
2738 +// This library is distributed in the hope that it will be useful,
2739 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2740 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2741 +// GNU General Public License for more details.
2742 +
2743 +// You should have received a copy of the GNU General Public License along
2744 +// with this library; see the file COPYING. If not, write to the Free
2745 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2746 +// USA.
2747 +
2748 +// As a special exception, you may use this file as part of a free software
2749 +// library without restriction. Specifically, if other files instantiate
2750 +// templates or use macros or inline functions from this file, or you compile
2751 +// this file and link it with other files to produce an executable, this
2752 +// file does not by itself cause the resulting executable to be covered by
2753 +// the GNU General Public License. This exception does not however
2754 +// invalidate any other reasons why the executable file might be covered by
2755 +// the GNU General Public License.
2756 +
2757 +//
2758 +// ISO C++ 14882: 22.1 Locales
2759 +//
2760 +
2761 +// Information as gleaned from /usr/include/ctype.h
2762 +
2763 + struct ctype_base
2764 + {
2765 + // Note: In uClibc, the following two types depend on configuration.
2766 +
2767 + // Non-standard typedefs.
2768 + typedef const __ctype_touplow_t* __to_type;
2769 +
2770 + // NB: Offsets into ctype<char>::_M_table force a particular size
2771 + // on the mask type. Because of this, we don't use an enum.
2772 + typedef __ctype_mask_t mask;
2773 + static const mask upper = _ISupper;
2774 + static const mask lower = _ISlower;
2775 + static const mask alpha = _ISalpha;
2776 + static const mask digit = _ISdigit;
2777 + static const mask xdigit = _ISxdigit;
2778 + static const mask space = _ISspace;
2779 + static const mask print = _ISprint;
2780 + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2781 + static const mask cntrl = _IScntrl;
2782 + static const mask punct = _ISpunct;
2783 + static const mask alnum = _ISalpha | _ISdigit;
2784 + };
2785 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_inline.h
2786 --- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
2787 +++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-09-10 10:47:40.000000000 -0500
2788 @@ -0,0 +1,69 @@
2789 +// Locale support -*- C++ -*-
2790 +
2791 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2792 +//
2793 +// This file is part of the GNU ISO C++ Library. This library is free
2794 +// software; you can redistribute it and/or modify it under the
2795 +// terms of the GNU General Public License as published by the
2796 +// Free Software Foundation; either version 2, or (at your option)
2797 +// any later version.
2798 +
2799 +// This library is distributed in the hope that it will be useful,
2800 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2801 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2802 +// GNU General Public License for more details.
2803 +
2804 +// You should have received a copy of the GNU General Public License along
2805 +// with this library; see the file COPYING. If not, write to the Free
2806 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2807 +// USA.
2808 +
2809 +// As a special exception, you may use this file as part of a free software
2810 +// library without restriction. Specifically, if other files instantiate
2811 +// templates or use macros or inline functions from this file, or you compile
2812 +// this file and link it with other files to produce an executable, this
2813 +// file does not by itself cause the resulting executable to be covered by
2814 +// the GNU General Public License. This exception does not however
2815 +// invalidate any other reasons why the executable file might be covered by
2816 +// the GNU General Public License.
2817 +
2818 +//
2819 +// ISO C++ 14882: 22.1 Locales
2820 +//
2821 +
2822 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2823 +// functions go in ctype.cc
2824 +
2825 + bool
2826 + ctype<char>::
2827 + is(mask __m, char __c) const
2828 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2829 +
2830 + const char*
2831 + ctype<char>::
2832 + is(const char* __low, const char* __high, mask* __vec) const
2833 + {
2834 + while (__low < __high)
2835 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2836 + return __high;
2837 + }
2838 +
2839 + const char*
2840 + ctype<char>::
2841 + scan_is(mask __m, const char* __low, const char* __high) const
2842 + {
2843 + while (__low < __high
2844 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2845 + ++__low;
2846 + return __low;
2847 + }
2848 +
2849 + const char*
2850 + ctype<char>::
2851 + scan_not(mask __m, const char* __low, const char* __high) const
2852 + {
2853 + while (__low < __high
2854 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2855 + ++__low;
2856 + return __low;
2857 + }
2858 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2859 --- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
2860 +++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-09-10 10:47:40.000000000 -0500
2861 @@ -0,0 +1,92 @@
2862 +// Locale support -*- C++ -*-
2863 +
2864 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
2865 +// Free Software Foundation, Inc.
2866 +//
2867 +// This file is part of the GNU ISO C++ Library. This library is free
2868 +// software; you can redistribute it and/or modify it under the
2869 +// terms of the GNU General Public License as published by the
2870 +// Free Software Foundation; either version 2, or (at your option)
2871 +// any later version.
2872 +
2873 +// This library is distributed in the hope that it will be useful,
2874 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2875 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2876 +// GNU General Public License for more details.
2877 +
2878 +// You should have received a copy of the GNU General Public License along
2879 +// with this library; see the file COPYING. If not, write to the Free
2880 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2881 +// USA.
2882 +
2883 +// As a special exception, you may use this file as part of a free software
2884 +// library without restriction. Specifically, if other files instantiate
2885 +// templates or use macros or inline functions from this file, or you compile
2886 +// this file and link it with other files to produce an executable, this
2887 +// file does not by itself cause the resulting executable to be covered by
2888 +// the GNU General Public License. This exception does not however
2889 +// invalidate any other reasons why the executable file might be covered by
2890 +// the GNU General Public License.
2891 +
2892 +//
2893 +// ISO C++ 14882: 22.1 Locales
2894 +//
2895 +
2896 +// Information as gleaned from /usr/include/ctype.h
2897 +
2898 + const ctype_base::mask*
2899 + ctype<char>::classic_table() throw()
2900 + { return __C_ctype_b; }
2901 +
2902 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2903 + size_t __refs)
2904 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2905 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2906 + {
2907 + _M_toupper = __C_ctype_toupper;
2908 + _M_tolower = __C_ctype_tolower;
2909 + _M_table = __table ? __table : __C_ctype_b;
2910 + memset(_M_widen, 0, sizeof(_M_widen));
2911 + memset(_M_narrow, 0, sizeof(_M_narrow));
2912 + }
2913 +
2914 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2915 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2916 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2917 + {
2918 + _M_toupper = __C_ctype_toupper;
2919 + _M_tolower = __C_ctype_tolower;
2920 + _M_table = __table ? __table : __C_ctype_b;
2921 + memset(_M_widen, 0, sizeof(_M_widen));
2922 + memset(_M_narrow, 0, sizeof(_M_narrow));
2923 + }
2924 +
2925 + char
2926 + ctype<char>::do_toupper(char __c) const
2927 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2928 +
2929 + const char*
2930 + ctype<char>::do_toupper(char* __low, const char* __high) const
2931 + {
2932 + while (__low < __high)
2933 + {
2934 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2935 + ++__low;
2936 + }
2937 + return __high;
2938 + }
2939 +
2940 + char
2941 + ctype<char>::do_tolower(char __c) const
2942 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2943 +
2944 + const char*
2945 + ctype<char>::do_tolower(char* __low, const char* __high) const
2946 + {
2947 + while (__low < __high)
2948 + {
2949 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2950 + ++__low;
2951 + }
2952 + return __high;
2953 + }
2954 diff -urN gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.2/libstdc++-v3/config/os/uclibc/os_defines.h
2955 --- gcc-3.4.2-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
2956 +++ gcc-3.4.2/libstdc++-v3/config/os/uclibc/os_defines.h 2004-09-10 10:47:40.000000000 -0500
2957 @@ -0,0 +1,44 @@
2958 +// Specific definitions for GNU/Linux -*- C++ -*-
2959 +
2960 +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2961 +//
2962 +// This file is part of the GNU ISO C++ Library. This library is free
2963 +// software; you can redistribute it and/or modify it under the
2964 +// terms of the GNU General Public License as published by the
2965 +// Free Software Foundation; either version 2, or (at your option)
2966 +// any later version.
2967 +
2968 +// This library is distributed in the hope that it will be useful,
2969 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2970 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2971 +// GNU General Public License for more details.
2972 +
2973 +// You should have received a copy of the GNU General Public License along
2974 +// with this library; see the file COPYING. If not, write to the Free
2975 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2976 +// USA.
2977 +
2978 +// As a special exception, you may use this file as part of a free software
2979 +// library without restriction. Specifically, if other files instantiate
2980 +// templates or use macros or inline functions from this file, or you compile
2981 +// this file and link it with other files to produce an executable, this
2982 +// file does not by itself cause the resulting executable to be covered by
2983 +// the GNU General Public License. This exception does not however
2984 +// invalidate any other reasons why the executable file might be covered by
2985 +// the GNU General Public License.
2986 +
2987 +#ifndef _GLIBCXX_OS_DEFINES
2988 +#define _GLIBCXX_OS_DEFINES 1
2989 +
2990 +// System-specific #define, typedefs, corrections, etc, go here. This
2991 +// file will come before all others.
2992 +
2993 +// This keeps isanum, et al from being propagated as macros.
2994 +#define __NO_CTYPE 1
2995 +
2996 +#include <features.h>
2997 +
2998 +// We must not see the optimized string functions GNU libc defines.
2999 +#define __NO_STRING_INLINES
3000 +
3001 +#endif
3002 diff -urN gcc-3.4.2-dist/libstdc++-v3/configure gcc-3.4.2/libstdc++-v3/configure
3003 --- gcc-3.4.2-dist/libstdc++-v3/configure 2004-08-13 15:44:04.000000000 -0500
3004 +++ gcc-3.4.2/libstdc++-v3/configure 2004-09-10 10:47:40.000000000 -0500
3005 @@ -3878,6 +3878,11 @@
3006 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
3007 ;;
3008
3009 +linux-uclibc*)
3010 + lt_cv_deplibs_check_method=pass_all
3011 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
3012 + ;;
3013 +
3014 netbsd*)
3015 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3016 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3017 @@ -5545,6 +5550,9 @@
3018 # Default to "generic".
3019 if test $enable_clocale_flag = auto; then
3020 case x${target_os} in
3021 + xlinux-uclibc*)
3022 + enable_clocale_flag=uclibc
3023 + ;;
3024 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
3025 cat >conftest.$ac_ext <<_ACEOF
3026 #line $LINENO "configure"
3027 @@ -5759,6 +5767,77 @@
3028 CTIME_CC=config/locale/generic/time_members.cc
3029 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
3030 ;;
3031 + uclibc)
3032 + echo "$as_me:$LINENO: result: uclibc" >&5
3033 +echo "${ECHO_T}uclibc" >&6
3034 +
3035 + # Declare intention to use gettext, and add support for specific
3036 + # languages.
3037 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
3038 + ALL_LINGUAS="de fr"
3039 +
3040 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
3041 + # Extract the first word of "msgfmt", so it can be a program name with args.
3042 +set dummy msgfmt; ac_word=$2
3043 +echo "$as_me:$LINENO: checking for $ac_word" >&5
3044 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3045 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
3046 + echo $ECHO_N "(cached) $ECHO_C" >&6
3047 +else
3048 + if test -n "$check_msgfmt"; then
3049 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
3050 +else
3051 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3052 +for as_dir in $PATH
3053 +do
3054 + IFS=$as_save_IFS
3055 + test -z "$as_dir" && as_dir=.
3056 + for ac_exec_ext in '' $ac_executable_extensions; do
3057 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3058 + ac_cv_prog_check_msgfmt="yes"
3059 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
3060 + break 2
3061 + fi
3062 +done
3063 +done
3064 +
3065 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3066 +fi
3067 +fi
3068 +check_msgfmt=$ac_cv_prog_check_msgfmt
3069 +if test -n "$check_msgfmt"; then
3070 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3071 +echo "${ECHO_T}$check_msgfmt" >&6
3072 +else
3073 + echo "$as_me:$LINENO: result: no" >&5
3074 +echo "${ECHO_T}no" >&6
3075 +fi
3076 +
3077 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3078 + USE_NLS=yes
3079 + fi
3080 + # Export the build objects.
3081 + for ling in $ALL_LINGUAS; do \
3082 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3083 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3084 + done
3085 +
3086 +
3087 +
3088 + CLOCALE_H=config/locale/uclibc/c_locale.h
3089 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
3090 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
3091 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3092 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3093 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3094 + CMESSAGES_H=config/locale/uclibc/messages_members.h
3095 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3096 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
3097 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3098 + CTIME_H=config/locale/uclibc/time_members.h
3099 + CTIME_CC=config/locale/uclibc/time_members.cc
3100 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3101 + ;;
3102 esac
3103
3104 # This is where the testsuite looks for locale catalogs, using the
3105 diff -urN gcc-3.4.2-dist/libstdc++-v3/configure.host gcc-3.4.2/libstdc++-v3/configure.host
3106 --- gcc-3.4.2-dist/libstdc++-v3/configure.host 2004-08-27 14:52:30.000000000 -0500
3107 +++ gcc-3.4.2/libstdc++-v3/configure.host 2004-09-10 10:47:40.000000000 -0500
3108 @@ -217,6 +217,12 @@
3109 ;;
3110 esac
3111
3112 +# Override for uClibc since linux-uclibc gets mishandled above.
3113 +case "${host_os}" in
3114 + *-uclibc*)
3115 + os_include_dir="os/uclibc"
3116 + ;;
3117 +esac
3118
3119 # Set any OS-dependent and CPU-dependent bits.
3120 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3121 diff -urN gcc-3.4.2-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.2/libstdc++-v3/crossconfig.m4
3122 --- gcc-3.4.2-dist/libstdc++-v3/crossconfig.m4 2004-07-06 20:23:49.000000000 -0500
3123 +++ gcc-3.4.2/libstdc++-v3/crossconfig.m4 2004-09-10 10:47:40.000000000 -0500
3124 @@ -138,6 +138,99 @@
3125 ;;
3126 esac
3127 ;;
3128 + *-uclibc*)
3129 +# Temporary hack until we implement the float versions of the libm funcs
3130 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3131 + machine/endian.h machine/param.h sys/machine.h sys/types.h \
3132 + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3133 + SECTION_FLAGS='-ffunction-sections -fdata-sections'
3134 + AC_SUBST(SECTION_FLAGS)
3135 + GLIBCXX_CHECK_LINKER_FEATURES
3136 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3137 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
3138 +
3139 + # For LFS.
3140 + AC_DEFINE(HAVE_INT64_T)
3141 + case "$target" in
3142 + *-uclinux*)
3143 + # Don't enable LFS with uClinux
3144 + ;;
3145 + *)
3146 + AC_DEFINE(_GLIBCXX_USE_LFS)
3147 + esac
3148 +
3149 + # For showmanyc_helper().
3150 + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3151 + GLIBCXX_CHECK_POLL
3152 + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3153 +
3154 + # For xsputn_2().
3155 + AC_CHECK_HEADERS(sys/uio.h)
3156 + GLIBCXX_CHECK_WRITEV
3157 +
3158 +# AC_DEFINE(HAVE_ACOSF)
3159 +# AC_DEFINE(HAVE_ASINF)
3160 +# AC_DEFINE(HAVE_ATANF)
3161 +# AC_DEFINE(HAVE_ATAN2F)
3162 + AC_DEFINE(HAVE_CEILF)
3163 + AC_DEFINE(HAVE_COPYSIGN)
3164 +# AC_DEFINE(HAVE_COPYSIGNF)
3165 +# AC_DEFINE(HAVE_COSF)
3166 +# AC_DEFINE(HAVE_COSHF)
3167 +# AC_DEFINE(HAVE_EXPF)
3168 +# AC_DEFINE(HAVE_FABSF)
3169 + AC_DEFINE(HAVE_FINITE)
3170 + AC_DEFINE(HAVE_FINITEF)
3171 + AC_DEFINE(HAVE_FLOORF)
3172 +# AC_DEFINE(HAVE_FMODF)
3173 +# AC_DEFINE(HAVE_FREXPF)
3174 + AC_DEFINE(HAVE_HYPOT)
3175 +# AC_DEFINE(HAVE_HYPOTF)
3176 + AC_DEFINE(HAVE_ISINF)
3177 + AC_DEFINE(HAVE_ISINFF)
3178 + AC_DEFINE(HAVE_ISNAN)
3179 + AC_DEFINE(HAVE_ISNANF)
3180 +# AC_DEFINE(HAVE_LOGF)
3181 +# AC_DEFINE(HAVE_LOG10F)
3182 +# AC_DEFINE(HAVE_MODFF)
3183 +# AC_DEFINE(HAVE_SINF)
3184 +# AC_DEFINE(HAVE_SINHF)
3185 +# AC_DEFINE(HAVE_SINCOS)
3186 +# AC_DEFINE(HAVE_SINCOSF)
3187 + AC_DEFINE(HAVE_SQRTF)
3188 +# AC_DEFINE(HAVE_TANF)
3189 +# AC_DEFINE(HAVE_TANHF)
3190 + if test x"long_double_math_on_this_cpu" = x"yes"; then
3191 + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3192 +# AC_DEFINE(HAVE_ACOSL)
3193 +# AC_DEFINE(HAVE_ASINL)
3194 +# AC_DEFINE(HAVE_ATANL)
3195 +# AC_DEFINE(HAVE_ATAN2L)
3196 +# AC_DEFINE(HAVE_CEILL)
3197 +# AC_DEFINE(HAVE_COPYSIGNL)
3198 +# AC_DEFINE(HAVE_COSL)
3199 +# AC_DEFINE(HAVE_COSHL)
3200 +# AC_DEFINE(HAVE_EXPL)
3201 +# AC_DEFINE(HAVE_FABSL)
3202 +# AC_DEFINE(HAVE_FINITEL)
3203 +# AC_DEFINE(HAVE_FLOORL)
3204 +# AC_DEFINE(HAVE_FMODL)
3205 +# AC_DEFINE(HAVE_FREXPL)
3206 +# AC_DEFINE(HAVE_HYPOTL)
3207 +# AC_DEFINE(HAVE_ISINFL)
3208 +# AC_DEFINE(HAVE_ISNANL)
3209 +# AC_DEFINE(HAVE_LOGL)
3210 +# AC_DEFINE(HAVE_LOG10L)
3211 +# AC_DEFINE(HAVE_MODFL)
3212 +# AC_DEFINE(HAVE_POWL)
3213 +# AC_DEFINE(HAVE_SINL)
3214 +# AC_DEFINE(HAVE_SINHL)
3215 +# AC_DEFINE(HAVE_SINCOSL)
3216 +# AC_DEFINE(HAVE_SQRTL)
3217 +# AC_DEFINE(HAVE_TANL)
3218 +# AC_DEFINE(HAVE_TANHL)
3219 + fi
3220 + ;;
3221 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3222 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3223 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3224 @@ -152,7 +245,7 @@
3225 AC_DEFINE(HAVE_INT64_T)
3226 case "$target" in
3227 *-uclinux*)
3228 - # Don't enable LFS with uClibc
3229 + # Don't enable LFS with uClinux
3230 ;;
3231 *)
3232 AC_DEFINE(_GLIBCXX_USE_LFS)
3233 diff -urN gcc-3.4.2-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.2/libstdc++-v3/include/c_compatibility/wchar.h
3234 --- gcc-3.4.2-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
3235 +++ gcc-3.4.2/libstdc++-v3/include/c_compatibility/wchar.h 2004-09-10 10:47:40.000000000 -0500
3236 @@ -101,7 +101,9 @@
3237 using std::wmemcpy;
3238 using std::wmemmove;
3239 using std::wmemset;
3240 +#if _GLIBCXX_HAVE_WCSFTIME
3241 using std::wcsftime;
3242 +#endif
3243
3244 #if _GLIBCXX_USE_C99
3245 using std::wcstold;
3246 diff -urN gcc-3.4.2-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.2/libstdc++-v3/include/c_std/std_cwchar.h
3247 --- gcc-3.4.2-dist/libstdc++-v3/include/c_std/std_cwchar.h 2004-07-20 03:52:12.000000000 -0500
3248 +++ gcc-3.4.2/libstdc++-v3/include/c_std/std_cwchar.h 2004-09-10 10:47:40.000000000 -0500
3249 @@ -179,7 +179,9 @@
3250 using ::wcscoll;
3251 using ::wcscpy;
3252 using ::wcscspn;
3253 +#if _GLIBCXX_HAVE_WCSFTIME
3254 using ::wcsftime;
3255 +#endif
3256 using ::wcslen;
3257 using ::wcsncat;
3258 using ::wcsncmp;

Properties

Name Value
svn:executable *