Some makeinfo versions are a pain in [somewhere very painful].
Work this around with a wrapper that always succeeds, and leave incomplete files in place.
/trunk/scripts/crosstool.sh | 7 7 0 0 +++++++
1 file changed, 7 insertions(+)
1 Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
2 diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
3 --- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 2008-02-29 01:00:39.000000000 +0100
4 +++ gcc-4.3.0/libstdc++-v3/acinclude.m4 2008-06-10 14:45:35.000000000 +0200
6 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
7 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
8 [use MODEL for target locale package],
9 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
10 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
12 # Deal with gettext issues. Default to not using it (=no) until we detect
13 # support for it later. Let the user turn it off via --e/d, but let that
15 # Default to "generic".
16 if test $enable_clocale_flag = auto; then
19 + enable_clocale_flag=uclibc
21 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
22 enable_clocale_flag=gnu
24 @@ -1541,6 +1544,40 @@
25 CTIME_CC=config/locale/generic/time_members.cc
26 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
29 + AC_MSG_RESULT(uclibc)
31 + # Declare intention to use gettext, and add support for specific
33 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
36 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
37 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
38 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
41 + # Export the build objects.
42 + for ling in $ALL_LINGUAS; do \
43 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
44 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
46 + AC_SUBST(glibcxx_MOFILES)
47 + AC_SUBST(glibcxx_POFILES)
49 + CLOCALE_H=config/locale/uclibc/c_locale.h
50 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
51 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
52 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
53 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
54 + CMESSAGES_H=config/locale/uclibc/messages_members.h
55 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
56 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
57 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
58 + CTIME_H=config/locale/uclibc/time_members.h
59 + CTIME_CC=config/locale/uclibc/time_members.cc
60 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
64 # This is where the testsuite looks for locale catalogs, using the
65 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
66 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
67 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:35.000000000 +0200
69 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
71 +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
73 +// This file is part of the GNU ISO C++ Library. This library is free
74 +// software; you can redistribute it and/or modify it under the
75 +// terms of the GNU General Public License as published by the
76 +// Free Software Foundation; either version 2, or (at your option)
77 +// any later version.
79 +// This library is distributed in the hope that it will be useful,
80 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
81 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
82 +// GNU General Public License for more details.
84 +// You should have received a copy of the GNU General Public License along
85 +// with this library; see the file COPYING. If not, write to the Free
86 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
89 +// As a special exception, you may use this file as part of a free software
90 +// library without restriction. Specifically, if other files instantiate
91 +// templates or use macros or inline functions from this file, or you compile
92 +// this file and link it with other files to produce an executable, this
93 +// file does not by itself cause the resulting executable to be covered by
94 +// the GNU General Public License. This exception does not however
95 +// invalidate any other reasons why the executable file might be covered by
96 +// the GNU General Public License.
98 +// Written by Jakub Jelinek <jakub@redhat.com>
100 +#include <bits/c++config.h>
103 +#ifdef __UCLIBC_MJN3_ONLY__
104 +#warning clean this up
107 +#ifdef __UCLIBC_HAS_XLOCALE__
109 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
110 +extern "C" __typeof(strcoll_l) __strcoll_l;
111 +extern "C" __typeof(strftime_l) __strftime_l;
112 +extern "C" __typeof(strtod_l) __strtod_l;
113 +extern "C" __typeof(strtof_l) __strtof_l;
114 +extern "C" __typeof(strtold_l) __strtold_l;
115 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
116 +extern "C" __typeof(newlocale) __newlocale;
117 +extern "C" __typeof(freelocale) __freelocale;
118 +extern "C" __typeof(duplocale) __duplocale;
119 +extern "C" __typeof(uselocale) __uselocale;
121 +#ifdef _GLIBCXX_USE_WCHAR_T
122 +extern "C" __typeof(iswctype_l) __iswctype_l;
123 +extern "C" __typeof(towlower_l) __towlower_l;
124 +extern "C" __typeof(towupper_l) __towupper_l;
125 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
126 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
127 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
128 +extern "C" __typeof(wctype_l) __wctype_l;
131 +#endif // GLIBC 2.3 and later
132 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
133 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
134 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:35.000000000 +0200
136 +// Wrapper for underlying C-language localization -*- C++ -*-
138 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
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.
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.
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,
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.
166 +// ISO C++ 14882: 22.8 Standard locale categories.
169 +// Written by Benjamin Kosnik <bkoz@redhat.com>
171 +#include <cerrno> // For errno
173 +#include <stdexcept>
174 +#include <langinfo.h>
175 +#include <bits/c++locale_internal.h>
177 +#ifndef __UCLIBC_HAS_XLOCALE__
178 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
179 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
180 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
181 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
182 +#define __strtof_l(S, E, L) strtof((S), (E))
183 +#define __strtod_l(S, E, L) strtod((S), (E))
184 +#define __strtold_l(S, E, L) strtold((S), (E))
185 +#warning should dummy __newlocale check for C|POSIX ?
186 +#define __newlocale(a, b, c) NULL
187 +#define __freelocale(a) ((void)0)
188 +#define __duplocale(a) __c_locale()
195 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
196 + const __c_locale& __cloc)
198 + if (!(__err & ios_base::failbit))
202 + float __f = __strtof_l(__s, &__sanity, __cloc);
203 + if (__sanity != __s && errno != ERANGE)
206 + __err |= ios_base::failbit;
212 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
213 + const __c_locale& __cloc)
215 + if (!(__err & ios_base::failbit))
219 + double __d = __strtod_l(__s, &__sanity, __cloc);
220 + if (__sanity != __s && errno != ERANGE)
223 + __err |= ios_base::failbit;
229 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
230 + const __c_locale& __cloc)
232 + if (!(__err & ios_base::failbit))
236 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
237 + if (__sanity != __s && errno != ERANGE)
240 + __err |= ios_base::failbit;
245 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
248 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
249 +#ifdef __UCLIBC_HAS_XLOCALE__
252 + // This named locale is not supported by the underlying OS.
253 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
254 + "name not valid"));
260 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
262 + if (_S_get_c_locale() != __cloc)
263 + __freelocale(__cloc);
267 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
268 + { return __duplocale(__cloc); }
273 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
281 +#if _GLIBCXX_NUM_CATEGORIES != 0
287 + "LC_IDENTIFICATION"
294 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
296 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
297 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
298 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:35.000000000 +0200
300 +// Wrapper for underlying C-language localization -*- C++ -*-
302 +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
304 +// This file is part of the GNU ISO C++ Library. This library is free
305 +// software; you can redistribute it and/or modify it under the
306 +// terms of the GNU General Public License as published by the
307 +// Free Software Foundation; either version 2, or (at your option)
308 +// any later version.
310 +// This library is distributed in the hope that it will be useful,
311 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
312 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
313 +// GNU General Public License for more details.
315 +// You should have received a copy of the GNU General Public License along
316 +// with this library; see the file COPYING. If not, write to the Free
317 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
320 +// As a special exception, you may use this file as part of a free software
321 +// library without restriction. Specifically, if other files instantiate
322 +// templates or use macros or inline functions from this file, or you compile
323 +// this file and link it with other files to produce an executable, this
324 +// file does not by itself cause the resulting executable to be covered by
325 +// the GNU General Public License. This exception does not however
326 +// invalidate any other reasons why the executable file might be covered by
327 +// the GNU General Public License.
330 +// ISO C++ 14882: 22.8 Standard locale categories.
333 +// Written by Benjamin Kosnik <bkoz@redhat.com>
336 +#define _C_LOCALE_H 1
338 +#pragma GCC system_header
340 +#include <cstring> // get std::strlen
341 +#include <cstdio> // get std::snprintf or std::sprintf
343 +#include <langinfo.h> // For codecvt
344 +#ifdef __UCLIBC_MJN3_ONLY__
347 +#ifdef __UCLIBC_HAS_LOCALE__
348 +#include <iconv.h> // For codecvt using iconv, iconv_t
350 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
351 +#include <libintl.h> // For messages
354 +#ifdef __UCLIBC_MJN3_ONLY__
355 +#warning what is _GLIBCXX_C_LOCALE_GNU for
357 +#define _GLIBCXX_C_LOCALE_GNU 1
359 +#ifdef __UCLIBC_MJN3_ONLY__
360 +#warning fix categories
362 +// #define _GLIBCXX_NUM_CATEGORIES 6
363 +#define _GLIBCXX_NUM_CATEGORIES 0
365 +#ifdef __UCLIBC_HAS_XLOCALE__
368 + extern "C" __typeof(uselocale) __uselocale;
374 +#ifdef __UCLIBC_HAS_XLOCALE__
375 + typedef __locale_t __c_locale;
377 + typedef int* __c_locale;
380 + // Convert numeric value of type _Tv to string and return length of
381 + // string. If snprintf is available use it, otherwise fall back to
382 + // the unsafe sprintf which, in general, can be dangerous and should
384 + template<typename _Tv>
386 + __convert_from_v(char* __out,
387 + const int __size __attribute__ ((__unused__)),
389 +#ifdef __UCLIBC_HAS_XCLOCALE__
390 + _Tv __v, const __c_locale& __cloc, int __prec)
392 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
394 + _Tv __v, const __c_locale&, int __prec)
396 +# ifdef __UCLIBC_HAS_LOCALE__
397 + char* __old = std::setlocale(LC_ALL, NULL);
398 + char* __sav = new char[std::strlen(__old) + 1];
399 + std::strcpy(__sav, __old);
400 + std::setlocale(LC_ALL, "C");
404 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
406 +#ifdef __UCLIBC_HAS_XCLOCALE__
407 + __gnu_cxx::__uselocale(__old);
408 +#elif defined __UCLIBC_HAS_LOCALE__
409 + std::setlocale(LC_ALL, __sav);
417 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
418 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
419 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:45:35.000000000 +0200
421 +// std::codecvt implementation details, GNU version -*- C++ -*-
423 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
425 +// This file is part of the GNU ISO C++ Library. This library is free
426 +// software; you can redistribute it and/or modify it under the
427 +// terms of the GNU General Public License as published by the
428 +// Free Software Foundation; either version 2, or (at your option)
429 +// any later version.
431 +// This library is distributed in the hope that it will be useful,
432 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
433 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
434 +// GNU General Public License for more details.
436 +// You should have received a copy of the GNU General Public License along
437 +// with this library; see the file COPYING. If not, write to the Free
438 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
441 +// As a special exception, you may use this file as part of a free software
442 +// library without restriction. Specifically, if other files instantiate
443 +// templates or use macros or inline functions from this file, or you compile
444 +// this file and link it with other files to produce an executable, this
445 +// file does not by itself cause the resulting executable to be covered by
446 +// the GNU General Public License. This exception does not however
447 +// invalidate any other reasons why the executable file might be covered by
448 +// the GNU General Public License.
451 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
454 +// Written by Benjamin Kosnik <bkoz@redhat.com>
457 +#include <bits/c++locale_internal.h>
461 + // Specializations.
462 +#ifdef _GLIBCXX_USE_WCHAR_T
463 + codecvt_base::result
464 + codecvt<wchar_t, char, mbstate_t>::
465 + do_out(state_type& __state, const intern_type* __from,
466 + const intern_type* __from_end, const intern_type*& __from_next,
467 + extern_type* __to, extern_type* __to_end,
468 + extern_type*& __to_next) const
471 + state_type __tmp_state(__state);
473 +#ifdef __UCLIBC_HAS_XLOCALE__
474 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
477 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
478 + // in case we fall back to wcrtomb and then continue, in a loop.
479 + // NB: wcsnrtombs is a GNU extension
480 + for (__from_next = __from, __to_next = __to;
481 + __from_next < __from_end && __to_next < __to_end
484 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
485 + __from_end - __from_next);
486 + if (!__from_chunk_end)
487 + __from_chunk_end = __from_end;
489 + __from = __from_next;
490 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
491 + __from_chunk_end - __from_next,
492 + __to_end - __to_next, &__state);
493 + if (__conv == static_cast<size_t>(-1))
495 + // In case of error, in order to stop at the exact place we
496 + // have to start again from the beginning with a series of
498 + for (; __from < __from_next; ++__from)
499 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
500 + __state = __tmp_state;
503 + else if (__from_next && __from_next < __from_chunk_end)
505 + __to_next += __conv;
510 + __from_next = __from_chunk_end;
511 + __to_next += __conv;
514 + if (__from_next < __from_end && __ret == ok)
516 + extern_type __buf[MB_LEN_MAX];
517 + __tmp_state = __state;
518 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
519 + if (__conv > static_cast<size_t>(__to_end - __to_next))
523 + memcpy(__to_next, __buf, __conv);
524 + __state = __tmp_state;
525 + __to_next += __conv;
531 +#ifdef __UCLIBC_HAS_XLOCALE__
532 + __uselocale(__old);
538 + codecvt_base::result
539 + codecvt<wchar_t, char, mbstate_t>::
540 + do_in(state_type& __state, const extern_type* __from,
541 + const extern_type* __from_end, const extern_type*& __from_next,
542 + intern_type* __to, intern_type* __to_end,
543 + intern_type*& __to_next) const
546 + state_type __tmp_state(__state);
548 +#ifdef __UCLIBC_HAS_XLOCALE__
549 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
552 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
553 + // in case we store a L'\0' and then continue, in a loop.
554 + // NB: mbsnrtowcs is a GNU extension
555 + for (__from_next = __from, __to_next = __to;
556 + __from_next < __from_end && __to_next < __to_end
559 + const extern_type* __from_chunk_end;
560 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
563 + if (!__from_chunk_end)
564 + __from_chunk_end = __from_end;
566 + __from = __from_next;
567 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
568 + __from_chunk_end - __from_next,
569 + __to_end - __to_next, &__state);
570 + if (__conv == static_cast<size_t>(-1))
572 + // In case of error, in order to stop at the exact place we
573 + // have to start again from the beginning with a series of
575 + for (;; ++__to_next, __from += __conv)
577 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
579 + if (__conv == static_cast<size_t>(-1)
580 + || __conv == static_cast<size_t>(-2))
583 + __from_next = __from;
584 + __state = __tmp_state;
587 + else if (__from_next && __from_next < __from_chunk_end)
589 + // It is unclear what to return in this case (see DR 382).
590 + __to_next += __conv;
595 + __from_next = __from_chunk_end;
596 + __to_next += __conv;
599 + if (__from_next < __from_end && __ret == ok)
601 + if (__to_next < __to_end)
603 + // XXX Probably wrong for stateful encodings
604 + __tmp_state = __state;
606 + *__to_next++ = L'\0';
613 +#ifdef __UCLIBC_HAS_XLOCALE__
614 + __uselocale(__old);
621 + codecvt<wchar_t, char, mbstate_t>::
622 + do_encoding() const throw()
624 + // XXX This implementation assumes that the encoding is
625 + // stateless and is either single-byte or variable-width.
627 +#ifdef __UCLIBC_HAS_XLOCALE__
628 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
630 + if (MB_CUR_MAX == 1)
632 +#ifdef __UCLIBC_HAS_XLOCALE__
633 + __uselocale(__old);
639 + codecvt<wchar_t, char, mbstate_t>::
640 + do_max_length() const throw()
642 +#ifdef __UCLIBC_HAS_XLOCALE__
643 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
645 + // XXX Probably wrong for stateful encodings.
646 + int __ret = MB_CUR_MAX;
647 +#ifdef __UCLIBC_HAS_XLOCALE__
648 + __uselocale(__old);
654 + codecvt<wchar_t, char, mbstate_t>::
655 + do_length(state_type& __state, const extern_type* __from,
656 + const extern_type* __end, size_t __max) const
659 + state_type __tmp_state(__state);
661 +#ifdef __UCLIBC_HAS_XLOCALE__
662 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
665 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
666 + // in case we advance past it and then continue, in a loop.
667 + // NB: mbsnrtowcs is a GNU extension
669 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
670 + // its fourth parameter (it wouldn't with NULL as first parameter).
671 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
673 + while (__from < __end && __max)
675 + const extern_type* __from_chunk_end;
676 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
679 + if (!__from_chunk_end)
680 + __from_chunk_end = __end;
682 + const extern_type* __tmp_from = __from;
683 + size_t __conv = mbsnrtowcs(__to, &__from,
684 + __from_chunk_end - __from,
686 + if (__conv == static_cast<size_t>(-1))
688 + // In case of error, in order to stop at the exact place we
689 + // have to start again from the beginning with a series of
691 + for (__from = __tmp_from;; __from += __conv)
693 + __conv = mbrtowc(NULL, __from, __end - __from,
695 + if (__conv == static_cast<size_t>(-1)
696 + || __conv == static_cast<size_t>(-2))
699 + __state = __tmp_state;
700 + __ret += __from - __tmp_from;
704 + __from = __from_chunk_end;
706 + __ret += __from - __tmp_from;
709 + if (__from < __end && __max)
711 + // XXX Probably wrong for stateful encodings
712 + __tmp_state = __state;
719 +#ifdef __UCLIBC_HAS_XLOCALE__
720 + __uselocale(__old);
727 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
728 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
729 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:35.000000000 +0200
731 +// std::collate implementation details, GNU version -*- C++ -*-
733 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
735 +// This file is part of the GNU ISO C++ Library. This library is free
736 +// software; you can redistribute it and/or modify it under the
737 +// terms of the GNU General Public License as published by the
738 +// Free Software Foundation; either version 2, or (at your option)
739 +// any later version.
741 +// This library is distributed in the hope that it will be useful,
742 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
743 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
744 +// GNU General Public License for more details.
746 +// You should have received a copy of the GNU General Public License along
747 +// with this library; see the file COPYING. If not, write to the Free
748 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
751 +// As a special exception, you may use this file as part of a free software
752 +// library without restriction. Specifically, if other files instantiate
753 +// templates or use macros or inline functions from this file, or you compile
754 +// this file and link it with other files to produce an executable, this
755 +// file does not by itself cause the resulting executable to be covered by
756 +// the GNU General Public License. This exception does not however
757 +// invalidate any other reasons why the executable file might be covered by
758 +// the GNU General Public License.
761 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
764 +// Written by Benjamin Kosnik <bkoz@redhat.com>
767 +#include <bits/c++locale_internal.h>
769 +#ifndef __UCLIBC_HAS_XLOCALE__
770 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
771 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
772 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
773 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
778 + // These are basically extensions to char_traits, and perhaps should
779 + // be put there instead of here.
782 + collate<char>::_M_compare(const char* __one, const char* __two) const
784 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
785 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
790 + collate<char>::_M_transform(char* __to, const char* __from,
792 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
794 +#ifdef _GLIBCXX_USE_WCHAR_T
797 + collate<wchar_t>::_M_compare(const wchar_t* __one,
798 + const wchar_t* __two) const
800 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
801 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
806 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
808 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
811 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
812 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
813 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:35.000000000 +0200
815 +// std::ctype implementation details, GNU version -*- C++ -*-
817 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
819 +// This file is part of the GNU ISO C++ Library. This library is free
820 +// software; you can redistribute it and/or modify it under the
821 +// terms of the GNU General Public License as published by the
822 +// Free Software Foundation; either version 2, or (at your option)
823 +// any later version.
825 +// This library is distributed in the hope that it will be useful,
826 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
827 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
828 +// GNU General Public License for more details.
830 +// You should have received a copy of the GNU General Public License along
831 +// with this library; see the file COPYING. If not, write to the Free
832 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
835 +// As a special exception, you may use this file as part of a free software
836 +// library without restriction. Specifically, if other files instantiate
837 +// templates or use macros or inline functions from this file, or you compile
838 +// this file and link it with other files to produce an executable, this
839 +// file does not by itself cause the resulting executable to be covered by
840 +// the GNU General Public License. This exception does not however
841 +// invalidate any other reasons why the executable file might be covered by
842 +// the GNU General Public License.
845 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
848 +// Written by Benjamin Kosnik <bkoz@redhat.com>
853 +#include <bits/c++locale_internal.h>
855 +#ifndef __UCLIBC_HAS_XLOCALE__
856 +#define __wctype_l(S, L) wctype((S))
857 +#define __towupper_l(C, L) towupper((C))
858 +#define __towlower_l(C, L) towlower((C))
859 +#define __iswctype_l(C, M, L) iswctype((C), (M))
864 + // NB: The other ctype<char> specializations are in src/locale.cc and
865 + // various /config/os/* files.
867 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
868 + : ctype<char>(0, false, __refs)
870 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
872 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
873 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
874 +#ifdef __UCLIBC_HAS_XLOCALE__
875 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
876 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
877 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
882 +#ifdef _GLIBCXX_USE_WCHAR_T
883 + ctype<wchar_t>::__wmask_type
884 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
886 + __wmask_type __ret;
890 + __ret = __wctype_l("space", _M_c_locale_ctype);
893 + __ret = __wctype_l("print", _M_c_locale_ctype);
896 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
899 + __ret = __wctype_l("upper", _M_c_locale_ctype);
902 + __ret = __wctype_l("lower", _M_c_locale_ctype);
905 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
908 + __ret = __wctype_l("digit", _M_c_locale_ctype);
911 + __ret = __wctype_l("punct", _M_c_locale_ctype);
914 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
917 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
920 + __ret = __wctype_l("graph", _M_c_locale_ctype);
923 + __ret = __wmask_type();
929 + ctype<wchar_t>::do_toupper(wchar_t __c) const
930 + { return __towupper_l(__c, _M_c_locale_ctype); }
933 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
935 + while (__lo < __hi)
937 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
944 + ctype<wchar_t>::do_tolower(wchar_t __c) const
945 + { return __towlower_l(__c, _M_c_locale_ctype); }
948 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
950 + while (__lo < __hi)
952 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
960 + do_is(mask __m, wchar_t __c) const
962 + // Highest bitmask in ctype_base == 10, but extra in "C"
963 + // library for blank.
964 + bool __ret = false;
965 + const size_t __bitmasksize = 11;
966 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
967 + if (__m & _M_bit[__bitcur]
968 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
978 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
980 + for (; __lo < __hi; ++__vec, ++__lo)
982 + // Highest bitmask in ctype_base == 10, but extra in "C"
983 + // library for blank.
984 + const size_t __bitmasksize = 11;
986 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
987 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
988 + __m |= _M_bit[__bitcur];
996 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
998 + while (__lo < __hi && !this->do_is(__m, *__lo))
1005 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1007 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1014 + do_widen(char __c) const
1015 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1019 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1021 + while (__lo < __hi)
1023 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1032 + do_narrow(wchar_t __wc, char __dfault) const
1034 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1035 + return _M_narrow[__wc];
1036 +#ifdef __UCLIBC_HAS_XLOCALE__
1037 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1039 + const int __c = wctob(__wc);
1040 +#ifdef __UCLIBC_HAS_XLOCALE__
1041 + __uselocale(__old);
1043 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1048 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1049 + char* __dest) const
1051 +#ifdef __UCLIBC_HAS_XLOCALE__
1052 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1055 + while (__lo < __hi)
1057 + if (*__lo >= 0 && *__lo < 128)
1058 + *__dest = _M_narrow[*__lo];
1061 + const int __c = wctob(*__lo);
1062 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1068 + while (__lo < __hi)
1070 + const int __c = wctob(*__lo);
1071 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1075 +#ifdef __UCLIBC_HAS_XLOCALE__
1076 + __uselocale(__old);
1082 + ctype<wchar_t>::_M_initialize_ctype()
1084 +#ifdef __UCLIBC_HAS_XLOCALE__
1085 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1088 + for (__i = 0; __i < 128; ++__i)
1090 + const int __c = wctob(__i);
1094 + _M_narrow[__i] = static_cast<char>(__c);
1097 + _M_narrow_ok = true;
1099 + _M_narrow_ok = false;
1100 + for (size_t __j = 0;
1101 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1102 + _M_widen[__j] = btowc(__j);
1104 + for (size_t __k = 0; __k <= 11; ++__k)
1106 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1107 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1109 +#ifdef __UCLIBC_HAS_XLOCALE__
1110 + __uselocale(__old);
1113 +#endif // _GLIBCXX_USE_WCHAR_T
1115 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1116 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
1117 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:35.000000000 +0200
1119 +// std::messages implementation details, GNU version -*- C++ -*-
1121 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1123 +// This file is part of the GNU ISO C++ Library. This library is free
1124 +// software; you can redistribute it and/or modify it under the
1125 +// terms of the GNU General Public License as published by the
1126 +// Free Software Foundation; either version 2, or (at your option)
1127 +// any later version.
1129 +// This library is distributed in the hope that it will be useful,
1130 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1131 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1132 +// GNU General Public License for more details.
1134 +// You should have received a copy of the GNU General Public License along
1135 +// with this library; see the file COPYING. If not, write to the Free
1136 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1139 +// As a special exception, you may use this file as part of a free software
1140 +// library without restriction. Specifically, if other files instantiate
1141 +// templates or use macros or inline functions from this file, or you compile
1142 +// this file and link it with other files to produce an executable, this
1143 +// file does not by itself cause the resulting executable to be covered by
1144 +// the GNU General Public License. This exception does not however
1145 +// invalidate any other reasons why the executable file might be covered by
1146 +// the GNU General Public License.
1149 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1152 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1155 +#include <bits/c++locale_internal.h>
1157 +#ifdef __UCLIBC_MJN3_ONLY__
1158 +#warning fix gettext stuff
1160 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1161 +extern "C" char *__dcgettext(const char *domainname,
1162 + const char *msgid, int category);
1164 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1167 +#define gettext(msgid) (msgid)
1172 + // Specializations.
1175 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1177 +#ifdef __UCLIBC_HAS_XLOCALE__
1178 + __c_locale __old = __uselocale(_M_c_locale_messages);
1179 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1180 + __uselocale(__old);
1181 + return string(__msg);
1182 +#elif defined __UCLIBC_HAS_LOCALE__
1183 + char* __old = strdup(setlocale(LC_ALL, NULL));
1184 + setlocale(LC_ALL, _M_name_messages);
1185 + const char* __msg = gettext(__dfault.c_str());
1186 + setlocale(LC_ALL, __old);
1188 + return string(__msg);
1190 + const char* __msg = gettext(__dfault.c_str());
1191 + return string(__msg);
1195 +#ifdef _GLIBCXX_USE_WCHAR_T
1198 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1200 +# ifdef __UCLIBC_HAS_XLOCALE__
1201 + __c_locale __old = __uselocale(_M_c_locale_messages);
1202 + char* __msg = gettext(_M_convert_to_char(__dfault));
1203 + __uselocale(__old);
1204 + return _M_convert_from_char(__msg);
1205 +# elif defined __UCLIBC_HAS_LOCALE__
1206 + char* __old = strdup(setlocale(LC_ALL, NULL));
1207 + setlocale(LC_ALL, _M_name_messages);
1208 + char* __msg = gettext(_M_convert_to_char(__dfault));
1209 + setlocale(LC_ALL, __old);
1211 + return _M_convert_from_char(__msg);
1213 + char* __msg = gettext(_M_convert_to_char(__dfault));
1214 + return _M_convert_from_char(__msg);
1219 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1220 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
1221 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:35.000000000 +0200
1223 +// std::messages implementation details, GNU version -*- C++ -*-
1225 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1227 +// This file is part of the GNU ISO C++ Library. This library is free
1228 +// software; you can redistribute it and/or modify it under the
1229 +// terms of the GNU General Public License as published by the
1230 +// Free Software Foundation; either version 2, or (at your option)
1231 +// any later version.
1233 +// This library is distributed in the hope that it will be useful,
1234 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1235 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1236 +// GNU General Public License for more details.
1238 +// You should have received a copy of the GNU General Public License along
1239 +// with this library; see the file COPYING. If not, write to the Free
1240 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1243 +// As a special exception, you may use this file as part of a free software
1244 +// library without restriction. Specifically, if other files instantiate
1245 +// templates or use macros or inline functions from this file, or you compile
1246 +// this file and link it with other files to produce an executable, this
1247 +// file does not by itself cause the resulting executable to be covered by
1248 +// the GNU General Public License. This exception does not however
1249 +// invalidate any other reasons why the executable file might be covered by
1250 +// the GNU General Public License.
1253 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1256 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1258 +#ifdef __UCLIBC_MJN3_ONLY__
1259 +#warning fix prototypes for *textdomain funcs
1261 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1262 +extern "C" char *__textdomain(const char *domainname);
1263 +extern "C" char *__bindtextdomain(const char *domainname,
1264 + const char *dirname);
1266 +#undef __textdomain
1267 +#undef __bindtextdomain
1268 +#define __textdomain(D) ((void)0)
1269 +#define __bindtextdomain(D,P) ((void)0)
1272 + // Non-virtual member functions.
1273 + template<typename _CharT>
1274 + messages<_CharT>::messages(size_t __refs)
1275 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1276 + _M_name_messages(_S_get_c_name())
1279 + template<typename _CharT>
1280 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1282 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1283 + _M_name_messages(__s)
1285 + char* __tmp = new char[std::strlen(__s) + 1];
1286 + std::strcpy(__tmp, __s);
1287 + _M_name_messages = __tmp;
1290 + template<typename _CharT>
1291 + typename messages<_CharT>::catalog
1292 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1293 + const char* __dir) const
1295 + __bindtextdomain(__s.c_str(), __dir);
1296 + return this->do_open(__s, __loc);
1299 + // Virtual member functions.
1300 + template<typename _CharT>
1301 + messages<_CharT>::~messages()
1303 + if (_M_name_messages != _S_get_c_name())
1304 + delete [] _M_name_messages;
1305 + _S_destroy_c_locale(_M_c_locale_messages);
1308 + template<typename _CharT>
1309 + typename messages<_CharT>::catalog
1310 + messages<_CharT>::do_open(const basic_string<char>& __s,
1311 + const locale&) const
1313 + // No error checking is done, assume the catalog exists and can
1315 + __textdomain(__s.c_str());
1319 + template<typename _CharT>
1321 + messages<_CharT>::do_close(catalog) const
1324 + // messages_byname
1325 + template<typename _CharT>
1326 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1327 + : messages<_CharT>(__refs)
1329 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1330 + delete [] this->_M_name_messages;
1331 + char* __tmp = new char[std::strlen(__s) + 1];
1332 + std::strcpy(__tmp, __s);
1333 + this->_M_name_messages = __tmp;
1335 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1337 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1338 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1341 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1342 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
1343 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:35.000000000 +0200
1345 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1347 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1349 +// This file is part of the GNU ISO C++ Library. This library is free
1350 +// software; you can redistribute it and/or modify it under the
1351 +// terms of the GNU General Public License as published by the
1352 +// Free Software Foundation; either version 2, or (at your option)
1353 +// any later version.
1355 +// This library is distributed in the hope that it will be useful,
1356 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1357 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1358 +// GNU General Public License for more details.
1360 +// You should have received a copy of the GNU General Public License along
1361 +// with this library; see the file COPYING. If not, write to the Free
1362 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1365 +// As a special exception, you may use this file as part of a free software
1366 +// library without restriction. Specifically, if other files instantiate
1367 +// templates or use macros or inline functions from this file, or you compile
1368 +// this file and link it with other files to produce an executable, this
1369 +// file does not by itself cause the resulting executable to be covered by
1370 +// the GNU General Public License. This exception does not however
1371 +// invalidate any other reasons why the executable file might be covered by
1372 +// the GNU General Public License.
1375 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1378 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1383 +#include <bits/c++locale_internal.h>
1385 +#ifdef __UCLIBC_MJN3_ONLY__
1386 +#warning optimize this for uclibc
1387 +#warning tailor for stub locale support
1390 +#ifndef __UCLIBC_HAS_XLOCALE__
1391 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1396 + // Construct and return valid pattern consisting of some combination of:
1397 + // space none symbol sign value
1398 + money_base::pattern
1399 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1403 + // This insanely complicated routine attempts to construct a valid
1404 + // pattern for use with monyepunct. A couple of invariants:
1406 + // if (__precedes) symbol -> value
1407 + // else value -> symbol
1409 + // if (__space) space
1412 + // none == never first
1413 + // space never first or last
1415 + // Any elegant implementations of this are welcome.
1420 + // 1 The sign precedes the value and symbol.
1421 + __ret.field[0] = sign;
1424 + // Pattern starts with sign.
1427 + __ret.field[1] = symbol;
1428 + __ret.field[3] = value;
1432 + __ret.field[1] = value;
1433 + __ret.field[3] = symbol;
1435 + __ret.field[2] = space;
1439 + // Pattern starts with sign and ends with none.
1442 + __ret.field[1] = symbol;
1443 + __ret.field[2] = value;
1447 + __ret.field[1] = value;
1448 + __ret.field[2] = symbol;
1450 + __ret.field[3] = none;
1454 + // 2 The sign follows the value and symbol.
1457 + // Pattern either ends with sign.
1460 + __ret.field[0] = symbol;
1461 + __ret.field[2] = value;
1465 + __ret.field[0] = value;
1466 + __ret.field[2] = symbol;
1468 + __ret.field[1] = space;
1469 + __ret.field[3] = sign;
1473 + // Pattern ends with sign then none.
1476 + __ret.field[0] = symbol;
1477 + __ret.field[1] = value;
1481 + __ret.field[0] = value;
1482 + __ret.field[1] = symbol;
1484 + __ret.field[2] = sign;
1485 + __ret.field[3] = none;
1489 + // 3 The sign immediately precedes the symbol.
1492 + __ret.field[0] = sign;
1493 + __ret.field[1] = symbol;
1496 + __ret.field[2] = space;
1497 + __ret.field[3] = value;
1501 + __ret.field[2] = value;
1502 + __ret.field[3] = none;
1507 + __ret.field[0] = value;
1510 + __ret.field[1] = space;
1511 + __ret.field[2] = sign;
1512 + __ret.field[3] = symbol;
1516 + __ret.field[1] = sign;
1517 + __ret.field[2] = symbol;
1518 + __ret.field[3] = none;
1523 + // 4 The sign immediately follows the symbol.
1526 + __ret.field[0] = symbol;
1527 + __ret.field[1] = sign;
1530 + __ret.field[2] = space;
1531 + __ret.field[3] = value;
1535 + __ret.field[2] = value;
1536 + __ret.field[3] = none;
1541 + __ret.field[0] = value;
1544 + __ret.field[1] = space;
1545 + __ret.field[2] = symbol;
1546 + __ret.field[3] = sign;
1550 + __ret.field[1] = symbol;
1551 + __ret.field[2] = sign;
1552 + __ret.field[3] = none;
1564 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1568 + _M_data = new __moneypunct_cache<char, true>;
1573 + _M_data->_M_decimal_point = '.';
1574 + _M_data->_M_thousands_sep = ',';
1575 + _M_data->_M_grouping = "";
1576 + _M_data->_M_grouping_size = 0;
1577 + _M_data->_M_curr_symbol = "";
1578 + _M_data->_M_curr_symbol_size = 0;
1579 + _M_data->_M_positive_sign = "";
1580 + _M_data->_M_positive_sign_size = 0;
1581 + _M_data->_M_negative_sign = "";
1582 + _M_data->_M_negative_sign_size = 0;
1583 + _M_data->_M_frac_digits = 0;
1584 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1585 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1587 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1588 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1593 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1595 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1597 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1598 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1599 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1600 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1602 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1604 + _M_data->_M_negative_sign = "()";
1606 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1608 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1611 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1612 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1613 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1615 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1616 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1617 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1618 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1620 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1621 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1622 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1629 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1633 + _M_data = new __moneypunct_cache<char, false>;
1638 + _M_data->_M_decimal_point = '.';
1639 + _M_data->_M_thousands_sep = ',';
1640 + _M_data->_M_grouping = "";
1641 + _M_data->_M_grouping_size = 0;
1642 + _M_data->_M_curr_symbol = "";
1643 + _M_data->_M_curr_symbol_size = 0;
1644 + _M_data->_M_positive_sign = "";
1645 + _M_data->_M_positive_sign_size = 0;
1646 + _M_data->_M_negative_sign = "";
1647 + _M_data->_M_negative_sign_size = 0;
1648 + _M_data->_M_frac_digits = 0;
1649 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1650 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1652 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1653 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1658 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1660 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1662 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1663 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1664 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1665 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1667 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1669 + _M_data->_M_negative_sign = "()";
1671 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1673 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1676 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1677 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1678 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1679 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1680 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1681 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1682 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1684 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1685 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1686 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1692 + moneypunct<char, true>::~moneypunct()
1693 + { delete _M_data; }
1696 + moneypunct<char, false>::~moneypunct()
1697 + { delete _M_data; }
1699 +#ifdef _GLIBCXX_USE_WCHAR_T
1702 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1703 +#ifdef __UCLIBC_HAS_XLOCALE__
1706 + const char* __name)
1710 + _M_data = new __moneypunct_cache<wchar_t, true>;
1715 + _M_data->_M_decimal_point = L'.';
1716 + _M_data->_M_thousands_sep = L',';
1717 + _M_data->_M_grouping = "";
1718 + _M_data->_M_grouping_size = 0;
1719 + _M_data->_M_curr_symbol = L"";
1720 + _M_data->_M_curr_symbol_size = 0;
1721 + _M_data->_M_positive_sign = L"";
1722 + _M_data->_M_positive_sign_size = 0;
1723 + _M_data->_M_negative_sign = L"";
1724 + _M_data->_M_negative_sign_size = 0;
1725 + _M_data->_M_frac_digits = 0;
1726 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1727 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1729 + // Use ctype::widen code without the facet...
1730 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1731 + _M_data->_M_atoms[__i] =
1732 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1737 +#ifdef __UCLIBC_HAS_XLOCALE__
1738 + __c_locale __old = __uselocale(__cloc);
1740 + // Switch to named locale so that mbsrtowcs will work.
1741 + char* __old = strdup(setlocale(LC_ALL, NULL));
1742 + setlocale(LC_ALL, __name);
1745 +#ifdef __UCLIBC_MJN3_ONLY__
1746 +#warning fix this... should be monetary
1749 +# ifdef __UCLIBC_HAS_XLOCALE__
1750 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1751 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1753 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1754 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1757 + union { char *__s; wchar_t __w; } __u;
1758 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1759 + _M_data->_M_decimal_point = __u.__w;
1761 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1762 + _M_data->_M_thousands_sep = __u.__w;
1764 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1765 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1767 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1768 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1769 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1771 + wchar_t* __wcs_ps = 0;
1772 + wchar_t* __wcs_ns = 0;
1773 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1776 + mbstate_t __state;
1777 + size_t __len = strlen(__cpossign);
1781 + memset(&__state, 0, sizeof(mbstate_t));
1782 + __wcs_ps = new wchar_t[__len];
1783 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1784 + _M_data->_M_positive_sign = __wcs_ps;
1787 + _M_data->_M_positive_sign = L"";
1788 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1790 + __len = strlen(__cnegsign);
1792 + _M_data->_M_negative_sign = L"()";
1796 + memset(&__state, 0, sizeof(mbstate_t));
1797 + __wcs_ns = new wchar_t[__len];
1798 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1799 + _M_data->_M_negative_sign = __wcs_ns;
1802 + _M_data->_M_negative_sign = L"";
1803 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1806 + __len = strlen(__ccurr);
1810 + memset(&__state, 0, sizeof(mbstate_t));
1811 + wchar_t* __wcs = new wchar_t[__len];
1812 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1813 + _M_data->_M_curr_symbol = __wcs;
1816 + _M_data->_M_curr_symbol = L"";
1817 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1825 +#ifdef __UCLIBC_HAS_XLOCALE__
1826 + __uselocale(__old);
1828 + setlocale(LC_ALL, __old);
1831 + __throw_exception_again;
1834 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1836 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1837 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1838 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1839 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1841 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1842 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1843 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1846 +#ifdef __UCLIBC_HAS_XLOCALE__
1847 + __uselocale(__old);
1849 + setlocale(LC_ALL, __old);
1857 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1858 +#ifdef __UCLIBC_HAS_XLOCALE__
1861 + const char* __name)
1865 + _M_data = new __moneypunct_cache<wchar_t, false>;
1870 + _M_data->_M_decimal_point = L'.';
1871 + _M_data->_M_thousands_sep = L',';
1872 + _M_data->_M_grouping = "";
1873 + _M_data->_M_grouping_size = 0;
1874 + _M_data->_M_curr_symbol = L"";
1875 + _M_data->_M_curr_symbol_size = 0;
1876 + _M_data->_M_positive_sign = L"";
1877 + _M_data->_M_positive_sign_size = 0;
1878 + _M_data->_M_negative_sign = L"";
1879 + _M_data->_M_negative_sign_size = 0;
1880 + _M_data->_M_frac_digits = 0;
1881 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1882 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1884 + // Use ctype::widen code without the facet...
1885 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1886 + _M_data->_M_atoms[__i] =
1887 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1892 +#ifdef __UCLIBC_HAS_XLOCALE__
1893 + __c_locale __old = __uselocale(__cloc);
1895 + // Switch to named locale so that mbsrtowcs will work.
1896 + char* __old = strdup(setlocale(LC_ALL, NULL));
1897 + setlocale(LC_ALL, __name);
1900 +#ifdef __UCLIBC_MJN3_ONLY__
1901 +#warning fix this... should be monetary
1904 +# ifdef __UCLIBC_HAS_XLOCALE__
1905 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1906 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1908 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1909 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1912 + union { char *__s; wchar_t __w; } __u;
1913 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1914 + _M_data->_M_decimal_point = __u.__w;
1916 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1917 + _M_data->_M_thousands_sep = __u.__w;
1919 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1920 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1922 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1923 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1924 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1926 + wchar_t* __wcs_ps = 0;
1927 + wchar_t* __wcs_ns = 0;
1928 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1931 + mbstate_t __state;
1933 + __len = strlen(__cpossign);
1937 + memset(&__state, 0, sizeof(mbstate_t));
1938 + __wcs_ps = new wchar_t[__len];
1939 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1940 + _M_data->_M_positive_sign = __wcs_ps;
1943 + _M_data->_M_positive_sign = L"";
1944 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1946 + __len = strlen(__cnegsign);
1948 + _M_data->_M_negative_sign = L"()";
1952 + memset(&__state, 0, sizeof(mbstate_t));
1953 + __wcs_ns = new wchar_t[__len];
1954 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1955 + _M_data->_M_negative_sign = __wcs_ns;
1958 + _M_data->_M_negative_sign = L"";
1959 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1962 + __len = strlen(__ccurr);
1966 + memset(&__state, 0, sizeof(mbstate_t));
1967 + wchar_t* __wcs = new wchar_t[__len];
1968 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1969 + _M_data->_M_curr_symbol = __wcs;
1972 + _M_data->_M_curr_symbol = L"";
1973 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1981 +#ifdef __UCLIBC_HAS_XLOCALE__
1982 + __uselocale(__old);
1984 + setlocale(LC_ALL, __old);
1987 + __throw_exception_again;
1990 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1991 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1992 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1993 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1994 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1996 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1997 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1998 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2001 +#ifdef __UCLIBC_HAS_XLOCALE__
2002 + __uselocale(__old);
2004 + setlocale(LC_ALL, __old);
2011 + moneypunct<wchar_t, true>::~moneypunct()
2013 + if (_M_data->_M_positive_sign_size)
2014 + delete [] _M_data->_M_positive_sign;
2015 + if (_M_data->_M_negative_sign_size
2016 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2017 + delete [] _M_data->_M_negative_sign;
2018 + if (_M_data->_M_curr_symbol_size)
2019 + delete [] _M_data->_M_curr_symbol;
2024 + moneypunct<wchar_t, false>::~moneypunct()
2026 + if (_M_data->_M_positive_sign_size)
2027 + delete [] _M_data->_M_positive_sign;
2028 + if (_M_data->_M_negative_sign_size
2029 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2030 + delete [] _M_data->_M_negative_sign;
2031 + if (_M_data->_M_curr_symbol_size)
2032 + delete [] _M_data->_M_curr_symbol;
2037 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2038 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
2039 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:35.000000000 +0200
2041 +// std::numpunct implementation details, GNU version -*- C++ -*-
2043 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2045 +// This file is part of the GNU ISO C++ Library. This library is free
2046 +// software; you can redistribute it and/or modify it under the
2047 +// terms of the GNU General Public License as published by the
2048 +// Free Software Foundation; either version 2, or (at your option)
2049 +// any later version.
2051 +// This library is distributed in the hope that it will be useful,
2052 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2053 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2054 +// GNU General Public License for more details.
2056 +// You should have received a copy of the GNU General Public License along
2057 +// with this library; see the file COPYING. If not, write to the Free
2058 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2061 +// As a special exception, you may use this file as part of a free software
2062 +// library without restriction. Specifically, if other files instantiate
2063 +// templates or use macros or inline functions from this file, or you compile
2064 +// this file and link it with other files to produce an executable, this
2065 +// file does not by itself cause the resulting executable to be covered by
2066 +// the GNU General Public License. This exception does not however
2067 +// invalidate any other reasons why the executable file might be covered by
2068 +// the GNU General Public License.
2071 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2074 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2079 +#include <bits/c++locale_internal.h>
2081 +#ifdef __UCLIBC_MJN3_ONLY__
2082 +#warning tailor for stub locale support
2084 +#ifndef __UCLIBC_HAS_XLOCALE__
2085 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2092 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2095 + _M_data = new __numpunct_cache<char>;
2100 + _M_data->_M_grouping = "";
2101 + _M_data->_M_grouping_size = 0;
2102 + _M_data->_M_use_grouping = false;
2104 + _M_data->_M_decimal_point = '.';
2105 + _M_data->_M_thousands_sep = ',';
2107 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2108 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2110 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2111 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2116 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2118 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2121 + // Check for NULL, which implies no grouping.
2122 + if (_M_data->_M_thousands_sep == '\0')
2123 + _M_data->_M_grouping = "";
2125 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2126 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2129 + // NB: There is no way to extact this info from posix locales.
2130 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2131 + _M_data->_M_truename = "true";
2132 + _M_data->_M_truename_size = 4;
2133 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2134 + _M_data->_M_falsename = "false";
2135 + _M_data->_M_falsename_size = 5;
2139 + numpunct<char>::~numpunct()
2140 + { delete _M_data; }
2142 +#ifdef _GLIBCXX_USE_WCHAR_T
2145 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2148 + _M_data = new __numpunct_cache<wchar_t>;
2153 + _M_data->_M_grouping = "";
2154 + _M_data->_M_grouping_size = 0;
2155 + _M_data->_M_use_grouping = false;
2157 + _M_data->_M_decimal_point = L'.';
2158 + _M_data->_M_thousands_sep = L',';
2160 + // Use ctype::widen code without the facet...
2161 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2162 + _M_data->_M_atoms_out[__i] =
2163 + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2165 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2166 + _M_data->_M_atoms_in[__j] =
2167 + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2172 + // NB: In the GNU model wchar_t is always 32 bit wide.
2173 + union { char *__s; wchar_t __w; } __u;
2174 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2175 + _M_data->_M_decimal_point = __u.__w;
2177 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2178 + _M_data->_M_thousands_sep = __u.__w;
2180 + if (_M_data->_M_thousands_sep == L'\0')
2181 + _M_data->_M_grouping = "";
2183 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2184 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2187 + // NB: There is no way to extact this info from posix locales.
2188 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2189 + _M_data->_M_truename = L"true";
2190 + _M_data->_M_truename_size = 4;
2191 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2192 + _M_data->_M_falsename = L"false";
2193 + _M_data->_M_falsename_size = 5;
2197 + numpunct<wchar_t>::~numpunct()
2198 + { delete _M_data; }
2201 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2202 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
2203 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:35.000000000 +0200
2205 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2207 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2209 +// This file is part of the GNU ISO C++ Library. This library is free
2210 +// software; you can redistribute it and/or modify it under the
2211 +// terms of the GNU General Public License as published by the
2212 +// Free Software Foundation; either version 2, or (at your option)
2213 +// any later version.
2215 +// This library is distributed in the hope that it will be useful,
2216 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2217 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2218 +// GNU General Public License for more details.
2220 +// You should have received a copy of the GNU General Public License along
2221 +// with this library; see the file COPYING. If not, write to the Free
2222 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2225 +// As a special exception, you may use this file as part of a free software
2226 +// library without restriction. Specifically, if other files instantiate
2227 +// templates or use macros or inline functions from this file, or you compile
2228 +// this file and link it with other files to produce an executable, this
2229 +// file does not by itself cause the resulting executable to be covered by
2230 +// the GNU General Public License. This exception does not however
2231 +// invalidate any other reasons why the executable file might be covered by
2232 +// the GNU General Public License.
2235 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2236 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2239 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2242 +#include <bits/c++locale_internal.h>
2244 +#ifdef __UCLIBC_MJN3_ONLY__
2245 +#warning tailor for stub locale support
2247 +#ifndef __UCLIBC_HAS_XLOCALE__
2248 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2255 + __timepunct<char>::
2256 + _M_put(char* __s, size_t __maxlen, const char* __format,
2257 + const tm* __tm) const
2259 +#ifdef __UCLIBC_HAS_XLOCALE__
2260 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2261 + _M_c_locale_timepunct);
2263 + char* __old = strdup(setlocale(LC_ALL, NULL));
2264 + setlocale(LC_ALL, _M_name_timepunct);
2265 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2266 + setlocale(LC_ALL, __old);
2269 + // Make sure __s is null terminated.
2276 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2279 + _M_data = new __timepunct_cache<char>;
2284 + _M_c_locale_timepunct = _S_get_c_locale();
2286 + _M_data->_M_date_format = "%m/%d/%y";
2287 + _M_data->_M_date_era_format = "%m/%d/%y";
2288 + _M_data->_M_time_format = "%H:%M:%S";
2289 + _M_data->_M_time_era_format = "%H:%M:%S";
2290 + _M_data->_M_date_time_format = "";
2291 + _M_data->_M_date_time_era_format = "";
2292 + _M_data->_M_am = "AM";
2293 + _M_data->_M_pm = "PM";
2294 + _M_data->_M_am_pm_format = "";
2296 + // Day names, starting with "C"'s Sunday.
2297 + _M_data->_M_day1 = "Sunday";
2298 + _M_data->_M_day2 = "Monday";
2299 + _M_data->_M_day3 = "Tuesday";
2300 + _M_data->_M_day4 = "Wednesday";
2301 + _M_data->_M_day5 = "Thursday";
2302 + _M_data->_M_day6 = "Friday";
2303 + _M_data->_M_day7 = "Saturday";
2305 + // Abbreviated day names, starting with "C"'s Sun.
2306 + _M_data->_M_aday1 = "Sun";
2307 + _M_data->_M_aday2 = "Mon";
2308 + _M_data->_M_aday3 = "Tue";
2309 + _M_data->_M_aday4 = "Wed";
2310 + _M_data->_M_aday5 = "Thu";
2311 + _M_data->_M_aday6 = "Fri";
2312 + _M_data->_M_aday7 = "Sat";
2314 + // Month names, starting with "C"'s January.
2315 + _M_data->_M_month01 = "January";
2316 + _M_data->_M_month02 = "February";
2317 + _M_data->_M_month03 = "March";
2318 + _M_data->_M_month04 = "April";
2319 + _M_data->_M_month05 = "May";
2320 + _M_data->_M_month06 = "June";
2321 + _M_data->_M_month07 = "July";
2322 + _M_data->_M_month08 = "August";
2323 + _M_data->_M_month09 = "September";
2324 + _M_data->_M_month10 = "October";
2325 + _M_data->_M_month11 = "November";
2326 + _M_data->_M_month12 = "December";
2328 + // Abbreviated month names, starting with "C"'s Jan.
2329 + _M_data->_M_amonth01 = "Jan";
2330 + _M_data->_M_amonth02 = "Feb";
2331 + _M_data->_M_amonth03 = "Mar";
2332 + _M_data->_M_amonth04 = "Apr";
2333 + _M_data->_M_amonth05 = "May";
2334 + _M_data->_M_amonth06 = "Jun";
2335 + _M_data->_M_amonth07 = "Jul";
2336 + _M_data->_M_amonth08 = "Aug";
2337 + _M_data->_M_amonth09 = "Sep";
2338 + _M_data->_M_amonth10 = "Oct";
2339 + _M_data->_M_amonth11 = "Nov";
2340 + _M_data->_M_amonth12 = "Dec";
2344 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2346 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2347 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2348 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2349 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2350 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2351 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2353 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2354 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2355 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2357 + // Day names, starting with "C"'s Sunday.
2358 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2359 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2360 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2361 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2362 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2363 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2364 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2366 + // Abbreviated day names, starting with "C"'s Sun.
2367 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2368 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2369 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2370 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2371 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2372 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2373 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2375 + // Month names, starting with "C"'s January.
2376 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2377 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2378 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2379 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2380 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2381 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2382 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2383 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2384 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2385 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2386 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2387 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2389 + // Abbreviated month names, starting with "C"'s Jan.
2390 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2391 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2392 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2393 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2394 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2395 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2396 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2397 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2398 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2399 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2400 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2401 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2405 +#ifdef _GLIBCXX_USE_WCHAR_T
2408 + __timepunct<wchar_t>::
2409 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2410 + const tm* __tm) const
2412 +#ifdef __UCLIBC_HAS_XLOCALE__
2413 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2414 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2415 + _M_c_locale_timepunct);
2417 + char* __old = strdup(setlocale(LC_ALL, NULL));
2418 + setlocale(LC_ALL, _M_name_timepunct);
2419 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2420 + setlocale(LC_ALL, __old);
2423 + // Make sure __s is null terminated.
2430 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2433 + _M_data = new __timepunct_cache<wchar_t>;
2435 +#warning wide time stuff
2439 + _M_c_locale_timepunct = _S_get_c_locale();
2441 + _M_data->_M_date_format = L"%m/%d/%y";
2442 + _M_data->_M_date_era_format = L"%m/%d/%y";
2443 + _M_data->_M_time_format = L"%H:%M:%S";
2444 + _M_data->_M_time_era_format = L"%H:%M:%S";
2445 + _M_data->_M_date_time_format = L"";
2446 + _M_data->_M_date_time_era_format = L"";
2447 + _M_data->_M_am = L"AM";
2448 + _M_data->_M_pm = L"PM";
2449 + _M_data->_M_am_pm_format = L"";
2451 + // Day names, starting with "C"'s Sunday.
2452 + _M_data->_M_day1 = L"Sunday";
2453 + _M_data->_M_day2 = L"Monday";
2454 + _M_data->_M_day3 = L"Tuesday";
2455 + _M_data->_M_day4 = L"Wednesday";
2456 + _M_data->_M_day5 = L"Thursday";
2457 + _M_data->_M_day6 = L"Friday";
2458 + _M_data->_M_day7 = L"Saturday";
2460 + // Abbreviated day names, starting with "C"'s Sun.
2461 + _M_data->_M_aday1 = L"Sun";
2462 + _M_data->_M_aday2 = L"Mon";
2463 + _M_data->_M_aday3 = L"Tue";
2464 + _M_data->_M_aday4 = L"Wed";
2465 + _M_data->_M_aday5 = L"Thu";
2466 + _M_data->_M_aday6 = L"Fri";
2467 + _M_data->_M_aday7 = L"Sat";
2469 + // Month names, starting with "C"'s January.
2470 + _M_data->_M_month01 = L"January";
2471 + _M_data->_M_month02 = L"February";
2472 + _M_data->_M_month03 = L"March";
2473 + _M_data->_M_month04 = L"April";
2474 + _M_data->_M_month05 = L"May";
2475 + _M_data->_M_month06 = L"June";
2476 + _M_data->_M_month07 = L"July";
2477 + _M_data->_M_month08 = L"August";
2478 + _M_data->_M_month09 = L"September";
2479 + _M_data->_M_month10 = L"October";
2480 + _M_data->_M_month11 = L"November";
2481 + _M_data->_M_month12 = L"December";
2483 + // Abbreviated month names, starting with "C"'s Jan.
2484 + _M_data->_M_amonth01 = L"Jan";
2485 + _M_data->_M_amonth02 = L"Feb";
2486 + _M_data->_M_amonth03 = L"Mar";
2487 + _M_data->_M_amonth04 = L"Apr";
2488 + _M_data->_M_amonth05 = L"May";
2489 + _M_data->_M_amonth06 = L"Jun";
2490 + _M_data->_M_amonth07 = L"Jul";
2491 + _M_data->_M_amonth08 = L"Aug";
2492 + _M_data->_M_amonth09 = L"Sep";
2493 + _M_data->_M_amonth10 = L"Oct";
2494 + _M_data->_M_amonth11 = L"Nov";
2495 + _M_data->_M_amonth12 = L"Dec";
2500 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2502 + union { char *__s; wchar_t *__w; } __u;
2504 + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2505 + _M_data->_M_date_format = __u.__w;
2506 + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2507 + _M_data->_M_date_era_format = __u.__w;
2508 + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2509 + _M_data->_M_time_format = __u.__w;
2510 + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2511 + _M_data->_M_time_era_format = __u.__w;
2512 + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2513 + _M_data->_M_date_time_format = __u.__w;
2514 + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2515 + _M_data->_M_date_time_era_format = __u.__w;
2516 + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2517 + _M_data->_M_am = __u.__w;
2518 + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2519 + _M_data->_M_pm = __u.__w;
2520 + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2521 + _M_data->_M_am_pm_format = __u.__w;
2523 + // Day names, starting with "C"'s Sunday.
2524 + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2525 + _M_data->_M_day1 = __u.__w;
2526 + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2527 + _M_data->_M_day2 = __u.__w;
2528 + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2529 + _M_data->_M_day3 = __u.__w;
2530 + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2531 + _M_data->_M_day4 = __u.__w;
2532 + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2533 + _M_data->_M_day5 = __u.__w;
2534 + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2535 + _M_data->_M_day6 = __u.__w;
2536 + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2537 + _M_data->_M_day7 = __u.__w;
2539 + // Abbreviated day names, starting with "C"'s Sun.
2540 + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2541 + _M_data->_M_aday1 = __u.__w;
2542 + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2543 + _M_data->_M_aday2 = __u.__w;
2544 + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2545 + _M_data->_M_aday3 = __u.__w;
2546 + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2547 + _M_data->_M_aday4 = __u.__w;
2548 + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2549 + _M_data->_M_aday5 = __u.__w;
2550 + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2551 + _M_data->_M_aday6 = __u.__w;
2552 + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2553 + _M_data->_M_aday7 = __u.__w;
2555 + // Month names, starting with "C"'s January.
2556 + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2557 + _M_data->_M_month01 = __u.__w;
2558 + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2559 + _M_data->_M_month02 = __u.__w;
2560 + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2561 + _M_data->_M_month03 = __u.__w;
2562 + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2563 + _M_data->_M_month04 = __u.__w;
2564 + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2565 + _M_data->_M_month05 = __u.__w;
2566 + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2567 + _M_data->_M_month06 = __u.__w;
2568 + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2569 + _M_data->_M_month07 = __u.__w;
2570 + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2571 + _M_data->_M_month08 = __u.__w;
2572 + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2573 + _M_data->_M_month09 = __u.__w;
2574 + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2575 + _M_data->_M_month10 = __u.__w;
2576 + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2577 + _M_data->_M_month11 = __u.__w;
2578 + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2579 + _M_data->_M_month12 = __u.__w;
2581 + // Abbreviated month names, starting with "C"'s Jan.
2582 + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2583 + _M_data->_M_amonth01 = __u.__w;
2584 + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2585 + _M_data->_M_amonth02 = __u.__w;
2586 + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2587 + _M_data->_M_amonth03 = __u.__w;
2588 + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2589 + _M_data->_M_amonth04 = __u.__w;
2590 + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2591 + _M_data->_M_amonth05 = __u.__w;
2592 + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2593 + _M_data->_M_amonth06 = __u.__w;
2594 + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2595 + _M_data->_M_amonth07 = __u.__w;
2596 + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2597 + _M_data->_M_amonth08 = __u.__w;
2598 + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2599 + _M_data->_M_amonth09 = __u.__w;
2600 + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2601 + _M_data->_M_amonth10 = __u.__w;
2602 + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2603 + _M_data->_M_amonth11 = __u.__w;
2604 + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2605 + _M_data->_M_amonth12 = __u.__w;
2611 diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
2612 --- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
2613 +++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:35.000000000 +0200
2615 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2617 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2619 +// This file is part of the GNU ISO C++ Library. This library is free
2620 +// software; you can redistribute it and/or modify it under the
2621 +// terms of the GNU General Public License as published by the
2622 +// Free Software Foundation; either version 2, or (at your option)
2623 +// any later version.
2625 +// This library is distributed in the hope that it will be useful,
2626 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2627 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2628 +// GNU General Public License for more details.
2630 +// You should have received a copy of the GNU General Public License along
2631 +// with this library; see the file COPYING. If not, write to the Free
2632 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2635 +// As a special exception, you may use this file as part of a free software
2636 +// library without restriction. Specifically, if other files instantiate
2637 +// templates or use macros or inline functions from this file, or you compile
2638 +// this file and link it with other files to produce an executable, this
2639 +// file does not by itself cause the resulting executable to be covered by
2640 +// the GNU General Public License. This exception does not however
2641 +// invalidate any other reasons why the executable file might be covered by
2642 +// the GNU General Public License.
2645 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2646 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2649 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2651 + template<typename _CharT>
2652 + __timepunct<_CharT>::__timepunct(size_t __refs)
2653 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2654 + _M_name_timepunct(_S_get_c_name())
2655 + { _M_initialize_timepunct(); }
2657 + template<typename _CharT>
2658 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2659 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2660 + _M_name_timepunct(_S_get_c_name())
2661 + { _M_initialize_timepunct(); }
2663 + template<typename _CharT>
2664 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2666 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2667 + _M_name_timepunct(__s)
2669 + char* __tmp = new char[std::strlen(__s) + 1];
2670 + std::strcpy(__tmp, __s);
2671 + _M_name_timepunct = __tmp;
2672 + _M_initialize_timepunct(__cloc);
2675 + template<typename _CharT>
2676 + __timepunct<_CharT>::~__timepunct()
2678 + if (_M_name_timepunct != _S_get_c_name())
2679 + delete [] _M_name_timepunct;
2681 + _S_destroy_c_locale(_M_c_locale_timepunct);
2683 diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
2684 --- gcc-4.3.0.orig/libstdc++-v3/configure 2008-02-29 01:00:39.000000000 +0100
2685 +++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:35.000000000 +0200
2686 @@ -14001,7 +14001,7 @@
2687 enableval="$enable_clocale"
2689 case "$enableval" in
2690 - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2691 + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
2692 *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
2693 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
2694 { (exit 1); exit 1; }; } ;;
2695 @@ -14034,6 +14034,9 @@
2696 # Default to "generic".
2697 if test $enable_clocale_flag = auto; then
2698 case ${target_os} in
2700 + enable_clocale_flag=uclibc
2702 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2703 enable_clocale_flag=gnu
2705 @@ -14422,6 +14425,76 @@
2706 CTIME_CC=config/locale/generic/time_members.cc
2707 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2710 + echo "$as_me:$LINENO: result: uclibc" >&5
2711 +echo "${ECHO_T}uclibc" >&6
2713 + # Declare intention to use gettext, and add support for specific
2715 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2716 + ALL_LINGUAS="de fr"
2718 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2719 + # Extract the first word of "msgfmt", so it can be a program name with args.
2720 +set dummy msgfmt; ac_word=$2
2721 +echo "$as_me:$LINENO: checking for $ac_word" >&5
2722 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2723 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2724 + echo $ECHO_N "(cached) $ECHO_C" >&6
2726 + if test -n "$check_msgfmt"; then
2727 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2729 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2730 +for as_dir in $PATH
2733 + test -z "$as_dir" && as_dir=.
2734 + for ac_exec_ext in '' $ac_executable_extensions; do
2735 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2736 + ac_cv_prog_check_msgfmt="yes"
2737 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2743 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
2746 +check_msgfmt=$ac_cv_prog_check_msgfmt
2747 +if test -n "$check_msgfmt"; then
2748 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
2749 +echo "${ECHO_T}$check_msgfmt" >&6
2751 + echo "$as_me:$LINENO: result: no" >&5
2752 +echo "${ECHO_T}no" >&6
2755 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2758 + # Export the build objects.
2759 + for ling in $ALL_LINGUAS; do \
2760 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2761 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2766 + CLOCALE_H=config/locale/uclibc/c_locale.h
2767 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
2768 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2769 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2770 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2771 + CMESSAGES_H=config/locale/uclibc/messages_members.h
2772 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2773 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
2774 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2775 + CTIME_H=config/locale/uclibc/time_members.h
2776 + CTIME_CC=config/locale/uclibc/time_members.cc
2777 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2781 # This is where the testsuite looks for locale catalogs, using the
2782 diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h
2783 --- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100
2784 +++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:45:35.000000000 +0200
2787 using std::wmemmove;
2789 +#if _GLIBCXX_HAVE_WCSFTIME
2790 using std::wcsftime;
2793 #if _GLIBCXX_USE_C99