1 diff -urN gcc-4.1.0/libstdc++-v3/acinclude.m4 gcc-4.1.0-patched/libstdc++-v3/acinclude.m4
2 --- gcc-4.1.0/libstdc++-v3/acinclude.m4 2005-04-11 19:13:06.000000000 -0500
3 +++ gcc-4.1.0-patched/libstdc++-v3/acinclude.m4 2005-04-27 22:20:27.569248995 -0500
5 AC_MSG_CHECKING([for C locale to use])
6 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
7 [use MODEL for target locale package],
8 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
9 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
11 # If they didn't use this option switch, or if they specified --enable
12 # with no specific model, we'll have to look for one. If they
14 # Default to "generic".
15 if test $enable_clocale_flag = auto; then
18 + enable_clocale_flag=uclibc
20 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
21 AC_EGREP_CPP([_GLIBCXX_ok], [
23 @@ -1206,6 +1209,41 @@
24 CTIME_CC=config/locale/generic/time_members.cc
25 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
28 + AC_MSG_RESULT(uclibc)
30 + # Declare intention to use gettext, and add support for specific
32 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
35 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
36 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
37 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
40 + # Export the build objects.
41 + for ling in $ALL_LINGUAS; do \
42 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
43 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
45 + AC_SUBST(glibcxx_MOFILES)
46 + AC_SUBST(glibcxx_POFILES)
48 + CLOCALE_H=config/locale/uclibc/c_locale.h
49 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
50 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
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 -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
66 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
67 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2005-04-27 22:20:27.571248664 -0500
69 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
71 +// Copyright (C) 2002, 2004 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>
102 +#ifdef __UCLIBC_MJN3_ONLY__
103 +#warning clean this up
106 +#ifdef __UCLIBC_HAS_XLOCALE__
108 +extern "C" __typeof(iswctype_l) __iswctype_l;
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(towlower_l) __towlower_l;
117 +extern "C" __typeof(towupper_l) __towupper_l;
118 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
119 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
120 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
121 +extern "C" __typeof(wctype_l) __wctype_l;
122 +extern "C" __typeof(newlocale) __newlocale;
123 +extern "C" __typeof(freelocale) __freelocale;
124 +extern "C" __typeof(duplocale) __duplocale;
125 +extern "C" __typeof(uselocale) __uselocale;
127 +#endif // GLIBC 2.3 and later
128 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.cc
129 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
130 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.cc 2005-04-27 22:20:27.572248498 -0500
132 +// Wrapper for underlying C-language localization -*- C++ -*-
134 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
136 +// This file is part of the GNU ISO C++ Library. This library is free
137 +// software; you can redistribute it and/or modify it under the
138 +// terms of the GNU General Public License as published by the
139 +// Free Software Foundation; either version 2, or (at your option)
140 +// any later version.
142 +// This library is distributed in the hope that it will be useful,
143 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
144 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
145 +// GNU General Public License for more details.
147 +// You should have received a copy of the GNU General Public License along
148 +// with this library; see the file COPYING. If not, write to the Free
149 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
152 +// As a special exception, you may use this file as part of a free software
153 +// library without restriction. Specifically, if other files instantiate
154 +// templates or use macros or inline functions from this file, or you compile
155 +// this file and link it with other files to produce an executable, this
156 +// file does not by itself cause the resulting executable to be covered by
157 +// the GNU General Public License. This exception does not however
158 +// invalidate any other reasons why the executable file might be covered by
159 +// the GNU General Public License.
162 +// ISO C++ 14882: 22.8 Standard locale categories.
165 +// Written by Benjamin Kosnik <bkoz@redhat.com>
167 +#include <cerrno> // For errno
169 +#include <stdexcept>
170 +#include <langinfo.h>
171 +#include <bits/c++locale_internal.h>
173 +#ifndef __UCLIBC_HAS_XLOCALE__
174 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
175 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
176 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
177 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
178 +#define __strtof_l(S, E, L) strtof((S), (E))
179 +#define __strtod_l(S, E, L) strtod((S), (E))
180 +#define __strtold_l(S, E, L) strtold((S), (E))
181 +#warning should dummy __newlocale check for C|POSIX ?
182 +#define __newlocale(a, b, c) NULL
183 +#define __freelocale(a) ((void)0)
184 +#define __duplocale(a) __c_locale()
191 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
192 + const __c_locale& __cloc)
194 + if (!(__err & ios_base::failbit))
198 + float __f = __strtof_l(__s, &__sanity, __cloc);
199 + if (__sanity != __s && errno != ERANGE)
202 + __err |= ios_base::failbit;
208 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
209 + const __c_locale& __cloc)
211 + if (!(__err & ios_base::failbit))
215 + double __d = __strtod_l(__s, &__sanity, __cloc);
216 + if (__sanity != __s && errno != ERANGE)
219 + __err |= ios_base::failbit;
225 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
226 + const __c_locale& __cloc)
228 + if (!(__err & ios_base::failbit))
232 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
233 + if (__sanity != __s && errno != ERANGE)
236 + __err |= ios_base::failbit;
241 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
244 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
245 +#ifdef __UCLIBC_HAS_XLOCALE__
248 + // This named locale is not supported by the underlying OS.
249 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
250 + "name not valid"));
256 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
258 + if (_S_get_c_locale() != __cloc)
259 + __freelocale(__cloc);
263 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
264 + { return __duplocale(__cloc); }
269 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
277 +#if _GLIBCXX_NUM_CATEGORIES != 0
283 + "LC_IDENTIFICATION"
290 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
292 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.h
293 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
294 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/c_locale.h 2005-04-27 22:20:27.573248332 -0500
296 +// Wrapper for underlying C-language localization -*- C++ -*-
298 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
300 +// This file is part of the GNU ISO C++ Library. This library is free
301 +// software; you can redistribute it and/or modify it under the
302 +// terms of the GNU General Public License as published by the
303 +// Free Software Foundation; either version 2, or (at your option)
304 +// any later version.
306 +// This library is distributed in the hope that it will be useful,
307 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
308 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
309 +// GNU General Public License for more details.
311 +// You should have received a copy of the GNU General Public License along
312 +// with this library; see the file COPYING. If not, write to the Free
313 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
316 +// As a special exception, you may use this file as part of a free software
317 +// library without restriction. Specifically, if other files instantiate
318 +// templates or use macros or inline functions from this file, or you compile
319 +// this file and link it with other files to produce an executable, this
320 +// file does not by itself cause the resulting executable to be covered by
321 +// the GNU General Public License. This exception does not however
322 +// invalidate any other reasons why the executable file might be covered by
323 +// the GNU General Public License.
326 +// ISO C++ 14882: 22.8 Standard locale categories.
329 +// Written by Benjamin Kosnik <bkoz@redhat.com>
332 +#define _C_LOCALE_H 1
334 +#pragma GCC system_header
336 +#include <cstring> // get std::strlen
337 +#include <cstdio> // get std::snprintf or std::sprintf
339 +#include <langinfo.h> // For codecvt
340 +#ifdef __UCLIBC_MJN3_ONLY__
343 +#ifdef __UCLIBC_HAS_LOCALE__
344 +#include <iconv.h> // For codecvt using iconv, iconv_t
346 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
347 +#include <libintl.h> // For messages
350 +#ifdef __UCLIBC_MJN3_ONLY__
351 +#warning what is _GLIBCXX_C_LOCALE_GNU for
353 +#define _GLIBCXX_C_LOCALE_GNU 1
355 +#ifdef __UCLIBC_MJN3_ONLY__
356 +#warning fix categories
358 +// #define _GLIBCXX_NUM_CATEGORIES 6
359 +#define _GLIBCXX_NUM_CATEGORIES 0
361 +#ifdef __UCLIBC_HAS_XLOCALE__
364 + extern "C" __typeof(uselocale) __uselocale;
370 +#ifdef __UCLIBC_HAS_XLOCALE__
371 + typedef __locale_t __c_locale;
373 + typedef int* __c_locale;
376 + // Convert numeric value of type _Tv to string and return length of
377 + // string. If snprintf is available use it, otherwise fall back to
378 + // the unsafe sprintf which, in general, can be dangerous and should
380 + template<typename _Tv>
382 + __convert_from_v(char* __out, const int __size, const char* __fmt,
383 +#ifdef __UCLIBC_HAS_XLOCALE__
384 + _Tv __v, const __c_locale& __cloc, int __prec)
386 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
388 + _Tv __v, const __c_locale&, int __prec)
390 +# ifdef __UCLIBC_HAS_LOCALE__
391 + char* __old = std::setlocale(LC_ALL, NULL);
392 + char* __sav = new char[std::strlen(__old) + 1];
393 + std::strcpy(__sav, __old);
394 + std::setlocale(LC_ALL, "C");
398 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
400 +#ifdef __UCLIBC_HAS_XLOCALE__
401 + __gnu_cxx::__uselocale(__old);
402 +#elif defined __UCLIBC_HAS_LOCALE__
403 + std::setlocale(LC_ALL, __sav);
411 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
412 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
413 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2005-04-27 22:20:27.574248167 -0500
415 +// std::codecvt implementation details, GNU version -*- C++ -*-
417 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
419 +// This file is part of the GNU ISO C++ Library. This library is free
420 +// software; you can redistribute it and/or modify it under the
421 +// terms of the GNU General Public License as published by the
422 +// Free Software Foundation; either version 2, or (at your option)
423 +// any later version.
425 +// This library is distributed in the hope that it will be useful,
426 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
427 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
428 +// GNU General Public License for more details.
430 +// You should have received a copy of the GNU General Public License along
431 +// with this library; see the file COPYING. If not, write to the Free
432 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
435 +// As a special exception, you may use this file as part of a free software
436 +// library without restriction. Specifically, if other files instantiate
437 +// templates or use macros or inline functions from this file, or you compile
438 +// this file and link it with other files to produce an executable, this
439 +// file does not by itself cause the resulting executable to be covered by
440 +// the GNU General Public License. This exception does not however
441 +// invalidate any other reasons why the executable file might be covered by
442 +// the GNU General Public License.
445 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
448 +// Written by Benjamin Kosnik <bkoz@redhat.com>
451 +#include <bits/c++locale_internal.h>
455 + // Specializations.
456 +#ifdef _GLIBCXX_USE_WCHAR_T
457 + codecvt_base::result
458 + codecvt<wchar_t, char, mbstate_t>::
459 + do_out(state_type& __state, const intern_type* __from,
460 + const intern_type* __from_end, const intern_type*& __from_next,
461 + extern_type* __to, extern_type* __to_end,
462 + extern_type*& __to_next) const
465 + state_type __tmp_state(__state);
467 +#ifdef __UCLIBC_HAS_XLOCALE__
468 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
471 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
472 + // in case we fall back to wcrtomb and then continue, in a loop.
473 + // NB: wcsnrtombs is a GNU extension
474 + for (__from_next = __from, __to_next = __to;
475 + __from_next < __from_end && __to_next < __to_end
478 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
479 + __from_end - __from_next);
480 + if (!__from_chunk_end)
481 + __from_chunk_end = __from_end;
483 + __from = __from_next;
484 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
485 + __from_chunk_end - __from_next,
486 + __to_end - __to_next, &__state);
487 + if (__conv == static_cast<size_t>(-1))
489 + // In case of error, in order to stop at the exact place we
490 + // have to start again from the beginning with a series of
492 + for (; __from < __from_next; ++__from)
493 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
494 + __state = __tmp_state;
497 + else if (__from_next && __from_next < __from_chunk_end)
499 + __to_next += __conv;
504 + __from_next = __from_chunk_end;
505 + __to_next += __conv;
508 + if (__from_next < __from_end && __ret == ok)
510 + extern_type __buf[MB_LEN_MAX];
511 + __tmp_state = __state;
512 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
513 + if (__conv > static_cast<size_t>(__to_end - __to_next))
517 + memcpy(__to_next, __buf, __conv);
518 + __state = __tmp_state;
519 + __to_next += __conv;
525 +#ifdef __UCLIBC_HAS_XLOCALE__
526 + __uselocale(__old);
532 + codecvt_base::result
533 + codecvt<wchar_t, char, mbstate_t>::
534 + do_in(state_type& __state, const extern_type* __from,
535 + const extern_type* __from_end, const extern_type*& __from_next,
536 + intern_type* __to, intern_type* __to_end,
537 + intern_type*& __to_next) const
540 + state_type __tmp_state(__state);
542 +#ifdef __UCLIBC_HAS_XLOCALE__
543 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
546 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
547 + // in case we store a L'\0' and then continue, in a loop.
548 + // NB: mbsnrtowcs is a GNU extension
549 + for (__from_next = __from, __to_next = __to;
550 + __from_next < __from_end && __to_next < __to_end
553 + const extern_type* __from_chunk_end;
554 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
557 + if (!__from_chunk_end)
558 + __from_chunk_end = __from_end;
560 + __from = __from_next;
561 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
562 + __from_chunk_end - __from_next,
563 + __to_end - __to_next, &__state);
564 + if (__conv == static_cast<size_t>(-1))
566 + // In case of error, in order to stop at the exact place we
567 + // have to start again from the beginning with a series of
569 + for (;; ++__to_next, __from += __conv)
571 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
573 + if (__conv == static_cast<size_t>(-1)
574 + || __conv == static_cast<size_t>(-2))
577 + __from_next = __from;
578 + __state = __tmp_state;
581 + else if (__from_next && __from_next < __from_chunk_end)
583 + // It is unclear what to return in this case (see DR 382).
584 + __to_next += __conv;
589 + __from_next = __from_chunk_end;
590 + __to_next += __conv;
593 + if (__from_next < __from_end && __ret == ok)
595 + if (__to_next < __to_end)
597 + // XXX Probably wrong for stateful encodings
598 + __tmp_state = __state;
600 + *__to_next++ = L'\0';
607 +#ifdef __UCLIBC_HAS_XLOCALE__
608 + __uselocale(__old);
615 + codecvt<wchar_t, char, mbstate_t>::
616 + do_encoding() const throw()
618 + // XXX This implementation assumes that the encoding is
619 + // stateless and is either single-byte or variable-width.
621 +#ifdef __UCLIBC_HAS_XLOCALE__
622 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
624 + if (MB_CUR_MAX == 1)
626 +#ifdef __UCLIBC_HAS_XLOCALE__
627 + __uselocale(__old);
633 + codecvt<wchar_t, char, mbstate_t>::
634 + do_max_length() const throw()
636 +#ifdef __UCLIBC_HAS_XLOCALE__
637 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
639 + // XXX Probably wrong for stateful encodings.
640 + int __ret = MB_CUR_MAX;
641 +#ifdef __UCLIBC_HAS_XLOCALE__
642 + __uselocale(__old);
648 + codecvt<wchar_t, char, mbstate_t>::
649 + do_length(state_type& __state, const extern_type* __from,
650 + const extern_type* __end, size_t __max) const
653 + state_type __tmp_state(__state);
655 +#ifdef __UCLIBC_HAS_XLOCALE__
656 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
659 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
660 + // in case we advance past it and then continue, in a loop.
661 + // NB: mbsnrtowcs is a GNU extension
663 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
664 + // its fourth parameter (it wouldn't with NULL as first parameter).
665 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
667 + while (__from < __end && __max)
669 + const extern_type* __from_chunk_end;
670 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
673 + if (!__from_chunk_end)
674 + __from_chunk_end = __end;
676 + const extern_type* __tmp_from = __from;
677 + size_t __conv = mbsnrtowcs(__to, &__from,
678 + __from_chunk_end - __from,
680 + if (__conv == static_cast<size_t>(-1))
682 + // In case of error, in order to stop at the exact place we
683 + // have to start again from the beginning with a series of
685 + for (__from = __tmp_from;; __from += __conv)
687 + __conv = mbrtowc(NULL, __from, __end - __from,
689 + if (__conv == static_cast<size_t>(-1)
690 + || __conv == static_cast<size_t>(-2))
693 + __state = __tmp_state;
694 + __ret += __from - __tmp_from;
698 + __from = __from_chunk_end;
700 + __ret += __from - __tmp_from;
703 + if (__from < __end && __max)
705 + // XXX Probably wrong for stateful encodings
706 + __tmp_state = __state;
713 +#ifdef __UCLIBC_HAS_XLOCALE__
714 + __uselocale(__old);
721 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/collate_members.cc
722 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
723 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/collate_members.cc 2005-04-27 22:20:27.575248001 -0500
725 +// std::collate implementation details, GNU version -*- C++ -*-
727 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
729 +// This file is part of the GNU ISO C++ Library. This library is free
730 +// software; you can redistribute it and/or modify it under the
731 +// terms of the GNU General Public License as published by the
732 +// Free Software Foundation; either version 2, or (at your option)
733 +// any later version.
735 +// This library is distributed in the hope that it will be useful,
736 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
737 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
738 +// GNU General Public License for more details.
740 +// You should have received a copy of the GNU General Public License along
741 +// with this library; see the file COPYING. If not, write to the Free
742 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
745 +// As a special exception, you may use this file as part of a free software
746 +// library without restriction. Specifically, if other files instantiate
747 +// templates or use macros or inline functions from this file, or you compile
748 +// this file and link it with other files to produce an executable, this
749 +// file does not by itself cause the resulting executable to be covered by
750 +// the GNU General Public License. This exception does not however
751 +// invalidate any other reasons why the executable file might be covered by
752 +// the GNU General Public License.
755 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
758 +// Written by Benjamin Kosnik <bkoz@redhat.com>
761 +#include <bits/c++locale_internal.h>
763 +#ifndef __UCLIBC_HAS_XLOCALE__
764 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
765 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
766 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
767 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
772 + // These are basically extensions to char_traits, and perhaps should
773 + // be put there instead of here.
776 + collate<char>::_M_compare(const char* __one, const char* __two) const
778 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
779 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
784 + collate<char>::_M_transform(char* __to, const char* __from,
786 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
788 +#ifdef _GLIBCXX_USE_WCHAR_T
791 + collate<wchar_t>::_M_compare(const wchar_t* __one,
792 + const wchar_t* __two) const
794 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
795 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
800 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
802 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
805 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/ctype_members.cc
806 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
807 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2005-04-27 22:20:27.595244687 -0500
809 +// std::ctype implementation details, GNU version -*- C++ -*-
811 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
813 +// This file is part of the GNU ISO C++ Library. This library is free
814 +// software; you can redistribute it and/or modify it under the
815 +// terms of the GNU General Public License as published by the
816 +// Free Software Foundation; either version 2, or (at your option)
817 +// any later version.
819 +// This library is distributed in the hope that it will be useful,
820 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
821 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
822 +// GNU General Public License for more details.
824 +// You should have received a copy of the GNU General Public License along
825 +// with this library; see the file COPYING. If not, write to the Free
826 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
829 +// As a special exception, you may use this file as part of a free software
830 +// library without restriction. Specifically, if other files instantiate
831 +// templates or use macros or inline functions from this file, or you compile
832 +// this file and link it with other files to produce an executable, this
833 +// file does not by itself cause the resulting executable to be covered by
834 +// the GNU General Public License. This exception does not however
835 +// invalidate any other reasons why the executable file might be covered by
836 +// the GNU General Public License.
839 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
842 +// Written by Benjamin Kosnik <bkoz@redhat.com>
847 +#include <bits/c++locale_internal.h>
849 +#ifndef __UCLIBC_HAS_XLOCALE__
850 +#define __wctype_l(S, L) wctype((S))
851 +#define __towupper_l(C, L) towupper((C))
852 +#define __towlower_l(C, L) towlower((C))
853 +#define __iswctype_l(C, M, L) iswctype((C), (M))
858 + // NB: The other ctype<char> specializations are in src/locale.cc and
859 + // various /config/os/* files.
861 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
862 + : ctype<char>(0, false, __refs)
864 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
866 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
867 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
868 +#ifdef __UCLIBC_HAS_XLOCALE__
869 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
870 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
871 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
876 +#ifdef _GLIBCXX_USE_WCHAR_T
877 + ctype<wchar_t>::__wmask_type
878 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
880 + __wmask_type __ret;
884 + __ret = __wctype_l("space", _M_c_locale_ctype);
887 + __ret = __wctype_l("print", _M_c_locale_ctype);
890 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
893 + __ret = __wctype_l("upper", _M_c_locale_ctype);
896 + __ret = __wctype_l("lower", _M_c_locale_ctype);
899 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
902 + __ret = __wctype_l("digit", _M_c_locale_ctype);
905 + __ret = __wctype_l("punct", _M_c_locale_ctype);
908 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
911 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
914 + __ret = __wctype_l("graph", _M_c_locale_ctype);
923 + ctype<wchar_t>::do_toupper(wchar_t __c) const
924 + { return __towupper_l(__c, _M_c_locale_ctype); }
927 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
929 + while (__lo < __hi)
931 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
938 + ctype<wchar_t>::do_tolower(wchar_t __c) const
939 + { return __towlower_l(__c, _M_c_locale_ctype); }
942 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
944 + while (__lo < __hi)
946 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
954 + do_is(mask __m, wchar_t __c) const
956 + // Highest bitmask in ctype_base == 10, but extra in "C"
957 + // library for blank.
958 + bool __ret = false;
959 + const size_t __bitmasksize = 11;
960 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
961 + if (__m & _M_bit[__bitcur]
962 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
972 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
974 + for (; __lo < __hi; ++__vec, ++__lo)
976 + // Highest bitmask in ctype_base == 10, but extra in "C"
977 + // library for blank.
978 + const size_t __bitmasksize = 11;
980 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
981 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
982 + __m |= _M_bit[__bitcur];
990 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
992 + while (__lo < __hi && !this->do_is(__m, *__lo))
999 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1001 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1008 + do_widen(char __c) const
1009 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1013 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1015 + while (__lo < __hi)
1017 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1026 + do_narrow(wchar_t __wc, char __dfault) const
1028 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1029 + return _M_narrow[__wc];
1030 +#ifdef __UCLIBC_HAS_XLOCALE__
1031 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1033 + const int __c = wctob(__wc);
1034 +#ifdef __UCLIBC_HAS_XLOCALE__
1035 + __uselocale(__old);
1037 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1042 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1043 + char* __dest) const
1045 +#ifdef __UCLIBC_HAS_XLOCALE__
1046 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1049 + while (__lo < __hi)
1051 + if (*__lo >= 0 && *__lo < 128)
1052 + *__dest = _M_narrow[*__lo];
1055 + const int __c = wctob(*__lo);
1056 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1062 + while (__lo < __hi)
1064 + const int __c = wctob(*__lo);
1065 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1069 +#ifdef __UCLIBC_HAS_XLOCALE__
1070 + __uselocale(__old);
1076 + ctype<wchar_t>::_M_initialize_ctype()
1078 +#ifdef __UCLIBC_HAS_XLOCALE__
1079 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1082 + for (__i = 0; __i < 128; ++__i)
1084 + const int __c = wctob(__i);
1088 + _M_narrow[__i] = static_cast<char>(__c);
1091 + _M_narrow_ok = true;
1093 + _M_narrow_ok = false;
1094 + for (size_t __j = 0;
1095 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1096 + _M_widen[__j] = btowc(__j);
1098 + for (size_t __k = 0; __k <= 11; ++__k)
1100 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1101 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1103 +#ifdef __UCLIBC_HAS_XLOCALE__
1104 + __uselocale(__old);
1107 +#endif // _GLIBCXX_USE_WCHAR_T
1109 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.cc
1110 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
1111 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.cc 2005-04-27 22:20:27.618240876 -0500
1113 +// std::messages implementation details, GNU version -*- C++ -*-
1115 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1117 +// This file is part of the GNU ISO C++ Library. This library is free
1118 +// software; you can redistribute it and/or modify it under the
1119 +// terms of the GNU General Public License as published by the
1120 +// Free Software Foundation; either version 2, or (at your option)
1121 +// any later version.
1123 +// This library is distributed in the hope that it will be useful,
1124 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1125 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1126 +// GNU General Public License for more details.
1128 +// You should have received a copy of the GNU General Public License along
1129 +// with this library; see the file COPYING. If not, write to the Free
1130 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1133 +// As a special exception, you may use this file as part of a free software
1134 +// library without restriction. Specifically, if other files instantiate
1135 +// templates or use macros or inline functions from this file, or you compile
1136 +// this file and link it with other files to produce an executable, this
1137 +// file does not by itself cause the resulting executable to be covered by
1138 +// the GNU General Public License. This exception does not however
1139 +// invalidate any other reasons why the executable file might be covered by
1140 +// the GNU General Public License.
1143 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1146 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1149 +#include <bits/c++locale_internal.h>
1151 +#ifdef __UCLIBC_MJN3_ONLY__
1152 +#warning fix gettext stuff
1154 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1155 +extern "C" char *__dcgettext(const char *domainname,
1156 + const char *msgid, int category);
1158 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1161 +#define gettext(msgid) (msgid)
1166 + // Specializations.
1169 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1171 +#ifdef __UCLIBC_HAS_XLOCALE__
1172 + __c_locale __old = __uselocale(_M_c_locale_messages);
1173 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1174 + __uselocale(__old);
1175 + return string(__msg);
1176 +#elif defined __UCLIBC_HAS_LOCALE__
1177 + char* __old = strdup(setlocale(LC_ALL, NULL));
1178 + setlocale(LC_ALL, _M_name_messages);
1179 + const char* __msg = gettext(__dfault.c_str());
1180 + setlocale(LC_ALL, __old);
1182 + return string(__msg);
1184 + const char* __msg = gettext(__dfault.c_str());
1185 + return string(__msg);
1189 +#ifdef _GLIBCXX_USE_WCHAR_T
1192 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1194 +# ifdef __UCLIBC_HAS_XLOCALE__
1195 + __c_locale __old = __uselocale(_M_c_locale_messages);
1196 + char* __msg = gettext(_M_convert_to_char(__dfault));
1197 + __uselocale(__old);
1198 + return _M_convert_from_char(__msg);
1199 +# elif defined __UCLIBC_HAS_LOCALE__
1200 + char* __old = strdup(setlocale(LC_ALL, NULL));
1201 + setlocale(LC_ALL, _M_name_messages);
1202 + char* __msg = gettext(_M_convert_to_char(__dfault));
1203 + setlocale(LC_ALL, __old);
1205 + return _M_convert_from_char(__msg);
1207 + char* __msg = gettext(_M_convert_to_char(__dfault));
1208 + return _M_convert_from_char(__msg);
1213 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.h
1214 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
1215 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/messages_members.h 2005-04-27 22:20:27.619240710 -0500
1217 +// std::messages implementation details, GNU version -*- C++ -*-
1219 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1221 +// This file is part of the GNU ISO C++ Library. This library is free
1222 +// software; you can redistribute it and/or modify it under the
1223 +// terms of the GNU General Public License as published by the
1224 +// Free Software Foundation; either version 2, or (at your option)
1225 +// any later version.
1227 +// This library is distributed in the hope that it will be useful,
1228 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1229 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1230 +// GNU General Public License for more details.
1232 +// You should have received a copy of the GNU General Public License along
1233 +// with this library; see the file COPYING. If not, write to the Free
1234 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1237 +// As a special exception, you may use this file as part of a free software
1238 +// library without restriction. Specifically, if other files instantiate
1239 +// templates or use macros or inline functions from this file, or you compile
1240 +// this file and link it with other files to produce an executable, this
1241 +// file does not by itself cause the resulting executable to be covered by
1242 +// the GNU General Public License. This exception does not however
1243 +// invalidate any other reasons why the executable file might be covered by
1244 +// the GNU General Public License.
1247 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1250 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1252 +#ifdef __UCLIBC_MJN3_ONLY__
1253 +#warning fix prototypes for *textdomain funcs
1255 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1256 +extern "C" char *__textdomain(const char *domainname);
1257 +extern "C" char *__bindtextdomain(const char *domainname,
1258 + const char *dirname);
1260 +#undef __textdomain
1261 +#undef __bindtextdomain
1262 +#define __textdomain(D) ((void)0)
1263 +#define __bindtextdomain(D,P) ((void)0)
1266 + // Non-virtual member functions.
1267 + template<typename _CharT>
1268 + messages<_CharT>::messages(size_t __refs)
1269 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1270 + _M_name_messages(_S_get_c_name())
1273 + template<typename _CharT>
1274 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1276 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1277 + _M_name_messages(__s)
1279 + char* __tmp = new char[std::strlen(__s) + 1];
1280 + std::strcpy(__tmp, __s);
1281 + _M_name_messages = __tmp;
1284 + template<typename _CharT>
1285 + typename messages<_CharT>::catalog
1286 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1287 + const char* __dir) const
1289 + __bindtextdomain(__s.c_str(), __dir);
1290 + return this->do_open(__s, __loc);
1293 + // Virtual member functions.
1294 + template<typename _CharT>
1295 + messages<_CharT>::~messages()
1297 + if (_M_name_messages != _S_get_c_name())
1298 + delete [] _M_name_messages;
1299 + _S_destroy_c_locale(_M_c_locale_messages);
1302 + template<typename _CharT>
1303 + typename messages<_CharT>::catalog
1304 + messages<_CharT>::do_open(const basic_string<char>& __s,
1305 + const locale&) const
1307 + // No error checking is done, assume the catalog exists and can
1309 + __textdomain(__s.c_str());
1313 + template<typename _CharT>
1315 + messages<_CharT>::do_close(catalog) const
1318 + // messages_byname
1319 + template<typename _CharT>
1320 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1321 + : messages<_CharT>(__refs)
1323 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1324 + delete [] this->_M_name_messages;
1325 + char* __tmp = new char[std::strlen(__s) + 1];
1326 + std::strcpy(__tmp, __s);
1327 + this->_M_name_messages = __tmp;
1329 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1331 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1332 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1335 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1336 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
1337 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2005-04-27 22:20:27.621240379 -0500
1339 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1341 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1343 +// This file is part of the GNU ISO C++ Library. This library is free
1344 +// software; you can redistribute it and/or modify it under the
1345 +// terms of the GNU General Public License as published by the
1346 +// Free Software Foundation; either version 2, or (at your option)
1347 +// any later version.
1349 +// This library is distributed in the hope that it will be useful,
1350 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1351 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1352 +// GNU General Public License for more details.
1354 +// You should have received a copy of the GNU General Public License along
1355 +// with this library; see the file COPYING. If not, write to the Free
1356 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1359 +// As a special exception, you may use this file as part of a free software
1360 +// library without restriction. Specifically, if other files instantiate
1361 +// templates or use macros or inline functions from this file, or you compile
1362 +// this file and link it with other files to produce an executable, this
1363 +// file does not by itself cause the resulting executable to be covered by
1364 +// the GNU General Public License. This exception does not however
1365 +// invalidate any other reasons why the executable file might be covered by
1366 +// the GNU General Public License.
1369 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1372 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1377 +#include <bits/c++locale_internal.h>
1379 +#ifdef __UCLIBC_MJN3_ONLY__
1380 +#warning optimize this for uclibc
1381 +#warning tailor for stub locale support
1384 +#ifndef __UCLIBC_HAS_XLOCALE__
1385 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1390 + // Construct and return valid pattern consisting of some combination of:
1391 + // space none symbol sign value
1392 + money_base::pattern
1393 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1397 + // This insanely complicated routine attempts to construct a valid
1398 + // pattern for use with monyepunct. A couple of invariants:
1400 + // if (__precedes) symbol -> value
1401 + // else value -> symbol
1403 + // if (__space) space
1406 + // none == never first
1407 + // space never first or last
1409 + // Any elegant implementations of this are welcome.
1414 + // 1 The sign precedes the value and symbol.
1415 + __ret.field[0] = sign;
1418 + // Pattern starts with sign.
1421 + __ret.field[1] = symbol;
1422 + __ret.field[3] = value;
1426 + __ret.field[1] = value;
1427 + __ret.field[3] = symbol;
1429 + __ret.field[2] = space;
1433 + // Pattern starts with sign and ends with none.
1436 + __ret.field[1] = symbol;
1437 + __ret.field[2] = value;
1441 + __ret.field[1] = value;
1442 + __ret.field[2] = symbol;
1444 + __ret.field[3] = none;
1448 + // 2 The sign follows the value and symbol.
1451 + // Pattern either ends with sign.
1454 + __ret.field[0] = symbol;
1455 + __ret.field[2] = value;
1459 + __ret.field[0] = value;
1460 + __ret.field[2] = symbol;
1462 + __ret.field[1] = space;
1463 + __ret.field[3] = sign;
1467 + // Pattern ends with sign then none.
1470 + __ret.field[0] = symbol;
1471 + __ret.field[1] = value;
1475 + __ret.field[0] = value;
1476 + __ret.field[1] = symbol;
1478 + __ret.field[2] = sign;
1479 + __ret.field[3] = none;
1483 + // 3 The sign immediately precedes the symbol.
1486 + __ret.field[0] = sign;
1487 + __ret.field[1] = symbol;
1490 + __ret.field[2] = space;
1491 + __ret.field[3] = value;
1495 + __ret.field[2] = value;
1496 + __ret.field[3] = none;
1501 + __ret.field[0] = value;
1504 + __ret.field[1] = space;
1505 + __ret.field[2] = sign;
1506 + __ret.field[3] = symbol;
1510 + __ret.field[1] = sign;
1511 + __ret.field[2] = symbol;
1512 + __ret.field[3] = none;
1517 + // 4 The sign immediately follows the symbol.
1520 + __ret.field[0] = symbol;
1521 + __ret.field[1] = sign;
1524 + __ret.field[2] = space;
1525 + __ret.field[3] = value;
1529 + __ret.field[2] = value;
1530 + __ret.field[3] = none;
1535 + __ret.field[0] = value;
1538 + __ret.field[1] = space;
1539 + __ret.field[2] = symbol;
1540 + __ret.field[3] = sign;
1544 + __ret.field[1] = symbol;
1545 + __ret.field[2] = sign;
1546 + __ret.field[3] = none;
1558 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1562 + _M_data = new __moneypunct_cache<char, true>;
1567 + _M_data->_M_decimal_point = '.';
1568 + _M_data->_M_thousands_sep = ',';
1569 + _M_data->_M_grouping = "";
1570 + _M_data->_M_grouping_size = 0;
1571 + _M_data->_M_curr_symbol = "";
1572 + _M_data->_M_curr_symbol_size = 0;
1573 + _M_data->_M_positive_sign = "";
1574 + _M_data->_M_positive_sign_size = 0;
1575 + _M_data->_M_negative_sign = "";
1576 + _M_data->_M_negative_sign_size = 0;
1577 + _M_data->_M_frac_digits = 0;
1578 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1579 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1581 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1582 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1587 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1589 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1591 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1592 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1593 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1594 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1596 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1598 + _M_data->_M_negative_sign = "()";
1600 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1602 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1605 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1606 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1607 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1609 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1610 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1611 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1612 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1614 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1615 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1616 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1623 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1627 + _M_data = new __moneypunct_cache<char, false>;
1632 + _M_data->_M_decimal_point = '.';
1633 + _M_data->_M_thousands_sep = ',';
1634 + _M_data->_M_grouping = "";
1635 + _M_data->_M_grouping_size = 0;
1636 + _M_data->_M_curr_symbol = "";
1637 + _M_data->_M_curr_symbol_size = 0;
1638 + _M_data->_M_positive_sign = "";
1639 + _M_data->_M_positive_sign_size = 0;
1640 + _M_data->_M_negative_sign = "";
1641 + _M_data->_M_negative_sign_size = 0;
1642 + _M_data->_M_frac_digits = 0;
1643 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1644 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1646 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1647 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1652 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1654 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1656 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1657 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1658 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1659 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1661 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1663 + _M_data->_M_negative_sign = "()";
1665 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1667 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1670 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1671 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1672 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1673 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1674 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1675 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1676 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1678 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1679 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1680 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1686 + moneypunct<char, true>::~moneypunct()
1687 + { delete _M_data; }
1690 + moneypunct<char, false>::~moneypunct()
1691 + { delete _M_data; }
1693 +#ifdef _GLIBCXX_USE_WCHAR_T
1696 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1697 +#ifdef __UCLIBC_HAS_XLOCALE__
1700 + const char* __name)
1704 + _M_data = new __moneypunct_cache<wchar_t, true>;
1709 + _M_data->_M_decimal_point = L'.';
1710 + _M_data->_M_thousands_sep = L',';
1711 + _M_data->_M_grouping = "";
1712 + _M_data->_M_grouping_size = 0;
1713 + _M_data->_M_curr_symbol = L"";
1714 + _M_data->_M_curr_symbol_size = 0;
1715 + _M_data->_M_positive_sign = L"";
1716 + _M_data->_M_positive_sign_size = 0;
1717 + _M_data->_M_negative_sign = L"";
1718 + _M_data->_M_negative_sign_size = 0;
1719 + _M_data->_M_frac_digits = 0;
1720 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1721 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1723 + // Use ctype::widen code without the facet...
1725 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1727 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1728 + _M_data->_M_atoms[__i] = btowc(uc);
1734 +#ifdef __UCLIBC_HAS_XLOCALE__
1735 + __c_locale __old = __uselocale(__cloc);
1737 + // Switch to named locale so that mbsrtowcs will work.
1738 + char* __old = strdup(setlocale(LC_ALL, NULL));
1739 + setlocale(LC_ALL, __name);
1742 +#ifdef __UCLIBC_MJN3_ONLY__
1743 +#warning fix this... should be monetary
1746 +# ifdef __UCLIBC_HAS_XLOCALE__
1747 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1748 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1750 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1751 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1754 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1755 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1756 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1758 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1759 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1761 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1762 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1764 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1765 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1766 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1768 + wchar_t* __wcs_ps = 0;
1769 + wchar_t* __wcs_ns = 0;
1770 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1773 + mbstate_t __state;
1774 + size_t __len = strlen(__cpossign);
1778 + memset(&__state, 0, sizeof(mbstate_t));
1779 + __wcs_ps = new wchar_t[__len];
1780 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1781 + _M_data->_M_positive_sign = __wcs_ps;
1784 + _M_data->_M_positive_sign = L"";
1785 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1787 + __len = strlen(__cnegsign);
1789 + _M_data->_M_negative_sign = L"()";
1793 + memset(&__state, 0, sizeof(mbstate_t));
1794 + __wcs_ns = new wchar_t[__len];
1795 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1796 + _M_data->_M_negative_sign = __wcs_ns;
1799 + _M_data->_M_negative_sign = L"";
1800 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1803 + __len = strlen(__ccurr);
1807 + memset(&__state, 0, sizeof(mbstate_t));
1808 + wchar_t* __wcs = new wchar_t[__len];
1809 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1810 + _M_data->_M_curr_symbol = __wcs;
1813 + _M_data->_M_curr_symbol = L"";
1814 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1822 +#ifdef __UCLIBC_HAS_XLOCALE__
1823 + __uselocale(__old);
1825 + setlocale(LC_ALL, __old);
1828 + __throw_exception_again;
1831 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1833 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1834 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1835 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1836 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1838 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1839 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1840 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1843 +#ifdef __UCLIBC_HAS_XLOCALE__
1844 + __uselocale(__old);
1846 + setlocale(LC_ALL, __old);
1854 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1855 +#ifdef __UCLIBC_HAS_XLOCALE__
1858 + const char* __name)
1862 + _M_data = new __moneypunct_cache<wchar_t, false>;
1867 + _M_data->_M_decimal_point = L'.';
1868 + _M_data->_M_thousands_sep = L',';
1869 + _M_data->_M_grouping = "";
1870 + _M_data->_M_grouping_size = 0;
1871 + _M_data->_M_curr_symbol = L"";
1872 + _M_data->_M_curr_symbol_size = 0;
1873 + _M_data->_M_positive_sign = L"";
1874 + _M_data->_M_positive_sign_size = 0;
1875 + _M_data->_M_negative_sign = L"";
1876 + _M_data->_M_negative_sign_size = 0;
1877 + _M_data->_M_frac_digits = 0;
1878 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1879 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1881 + // Use ctype::widen code without the facet...
1883 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1885 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1886 + _M_data->_M_atoms[__i] = btowc(uc);
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 __s_and_w { const char *__s; unsigned int __w; } __u;
1913 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1914 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1916 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1917 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__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 -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2038 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
2039 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2005-04-27 22:20:27.623240047 -0500
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 = strlen(_M_data->_M_truename);
2133 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2134 + _M_data->_M_falsename = "false";
2135 + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
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 +#ifdef __UCLIBC_HAS_XLOCALE__
2161 + __c_locale __old = __uselocale(_S_get_c_locale());
2163 + // Use ctype::widen code without the facet...
2165 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2167 + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
2168 + _M_data->_M_atoms_out[__i] = btowc(uc);
2171 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2173 + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
2174 + _M_data->_M_atoms_in[__j] = btowc(uc);
2176 +#ifdef __UCLIBC_HAS_XLOCALE__
2177 + __uselocale(__old);
2183 +#ifdef __UCLIBC_MJN3_ONLY__
2187 +# ifdef __UCLIBC_HAS_XLOCALE__
2188 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2189 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2191 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2192 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2195 + union __s_and_w { const char *__s; unsigned int __w; } __u;
2196 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2197 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
2199 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2200 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
2203 + if (_M_data->_M_thousands_sep == L'\0')
2204 + _M_data->_M_grouping = "";
2206 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2207 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2210 + // NB: There is no way to extact this info from posix locales.
2211 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2212 + _M_data->_M_truename = L"true";
2213 + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
2214 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2215 + _M_data->_M_falsename = L"false";
2216 + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
2220 + numpunct<wchar_t>::~numpunct()
2221 + { delete _M_data; }
2224 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.cc
2225 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
2226 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.cc 2005-04-27 22:20:27.624239882 -0500
2228 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2230 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2232 +// This file is part of the GNU ISO C++ Library. This library is free
2233 +// software; you can redistribute it and/or modify it under the
2234 +// terms of the GNU General Public License as published by the
2235 +// Free Software Foundation; either version 2, or (at your option)
2236 +// any later version.
2238 +// This library is distributed in the hope that it will be useful,
2239 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2240 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2241 +// GNU General Public License for more details.
2243 +// You should have received a copy of the GNU General Public License along
2244 +// with this library; see the file COPYING. If not, write to the Free
2245 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2248 +// As a special exception, you may use this file as part of a free software
2249 +// library without restriction. Specifically, if other files instantiate
2250 +// templates or use macros or inline functions from this file, or you compile
2251 +// this file and link it with other files to produce an executable, this
2252 +// file does not by itself cause the resulting executable to be covered by
2253 +// the GNU General Public License. This exception does not however
2254 +// invalidate any other reasons why the executable file might be covered by
2255 +// the GNU General Public License.
2258 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2259 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2262 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2265 +#include <bits/c++locale_internal.h>
2267 +#ifdef __UCLIBC_MJN3_ONLY__
2268 +#warning tailor for stub locale support
2270 +#ifndef __UCLIBC_HAS_XLOCALE__
2271 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2278 + __timepunct<char>::
2279 + _M_put(char* __s, size_t __maxlen, const char* __format,
2280 + const tm* __tm) const
2282 +#ifdef __UCLIBC_HAS_XLOCALE__
2283 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2284 + _M_c_locale_timepunct);
2286 + char* __old = strdup(setlocale(LC_ALL, NULL));
2287 + setlocale(LC_ALL, _M_name_timepunct);
2288 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2289 + setlocale(LC_ALL, __old);
2292 + // Make sure __s is null terminated.
2299 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2302 + _M_data = new __timepunct_cache<char>;
2307 + _M_c_locale_timepunct = _S_get_c_locale();
2309 + _M_data->_M_date_format = "%m/%d/%y";
2310 + _M_data->_M_date_era_format = "%m/%d/%y";
2311 + _M_data->_M_time_format = "%H:%M:%S";
2312 + _M_data->_M_time_era_format = "%H:%M:%S";
2313 + _M_data->_M_date_time_format = "";
2314 + _M_data->_M_date_time_era_format = "";
2315 + _M_data->_M_am = "AM";
2316 + _M_data->_M_pm = "PM";
2317 + _M_data->_M_am_pm_format = "";
2319 + // Day names, starting with "C"'s Sunday.
2320 + _M_data->_M_day1 = "Sunday";
2321 + _M_data->_M_day2 = "Monday";
2322 + _M_data->_M_day3 = "Tuesday";
2323 + _M_data->_M_day4 = "Wednesday";
2324 + _M_data->_M_day5 = "Thursday";
2325 + _M_data->_M_day6 = "Friday";
2326 + _M_data->_M_day7 = "Saturday";
2328 + // Abbreviated day names, starting with "C"'s Sun.
2329 + _M_data->_M_aday1 = "Sun";
2330 + _M_data->_M_aday2 = "Mon";
2331 + _M_data->_M_aday3 = "Tue";
2332 + _M_data->_M_aday4 = "Wed";
2333 + _M_data->_M_aday5 = "Thu";
2334 + _M_data->_M_aday6 = "Fri";
2335 + _M_data->_M_aday7 = "Sat";
2337 + // Month names, starting with "C"'s January.
2338 + _M_data->_M_month01 = "January";
2339 + _M_data->_M_month02 = "February";
2340 + _M_data->_M_month03 = "March";
2341 + _M_data->_M_month04 = "April";
2342 + _M_data->_M_month05 = "May";
2343 + _M_data->_M_month06 = "June";
2344 + _M_data->_M_month07 = "July";
2345 + _M_data->_M_month08 = "August";
2346 + _M_data->_M_month09 = "September";
2347 + _M_data->_M_month10 = "October";
2348 + _M_data->_M_month11 = "November";
2349 + _M_data->_M_month12 = "December";
2351 + // Abbreviated month names, starting with "C"'s Jan.
2352 + _M_data->_M_amonth01 = "Jan";
2353 + _M_data->_M_amonth02 = "Feb";
2354 + _M_data->_M_amonth03 = "Mar";
2355 + _M_data->_M_amonth04 = "Apr";
2356 + _M_data->_M_amonth05 = "May";
2357 + _M_data->_M_amonth06 = "Jun";
2358 + _M_data->_M_amonth07 = "Jul";
2359 + _M_data->_M_amonth08 = "Aug";
2360 + _M_data->_M_amonth09 = "Sep";
2361 + _M_data->_M_amonth10 = "Oct";
2362 + _M_data->_M_amonth11 = "Nov";
2363 + _M_data->_M_amonth12 = "Dec";
2367 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2369 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2370 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2371 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2372 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2373 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2374 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
2375 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2376 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2377 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2379 + // Day names, starting with "C"'s Sunday.
2380 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2381 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2382 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2383 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2384 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2385 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2386 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2388 + // Abbreviated day names, starting with "C"'s Sun.
2389 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2390 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2391 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2392 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2393 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2394 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2395 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2397 + // Month names, starting with "C"'s January.
2398 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2399 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2400 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2401 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2402 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2403 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2404 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2405 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2406 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2407 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2408 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2409 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2411 + // Abbreviated month names, starting with "C"'s Jan.
2412 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2413 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2414 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2415 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2416 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2417 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2418 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2419 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2420 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2421 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2422 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2423 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2427 +#ifdef _GLIBCXX_USE_WCHAR_T
2430 + __timepunct<wchar_t>::
2431 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2432 + const tm* __tm) const
2434 +#ifdef __UCLIBC_HAS_XLOCALE__
2435 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2436 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2437 + _M_c_locale_timepunct);
2439 + char* __old = strdup(setlocale(LC_ALL, NULL));
2440 + setlocale(LC_ALL, _M_name_timepunct);
2441 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2442 + setlocale(LC_ALL, __old);
2445 + // Make sure __s is null terminated.
2452 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2455 + _M_data = new __timepunct_cache<wchar_t>;
2457 +#warning wide time stuff
2461 + _M_c_locale_timepunct = _S_get_c_locale();
2463 + _M_data->_M_date_format = L"%m/%d/%y";
2464 + _M_data->_M_date_era_format = L"%m/%d/%y";
2465 + _M_data->_M_time_format = L"%H:%M:%S";
2466 + _M_data->_M_time_era_format = L"%H:%M:%S";
2467 + _M_data->_M_date_time_format = L"";
2468 + _M_data->_M_date_time_era_format = L"";
2469 + _M_data->_M_am = L"AM";
2470 + _M_data->_M_pm = L"PM";
2471 + _M_data->_M_am_pm_format = L"";
2473 + // Day names, starting with "C"'s Sunday.
2474 + _M_data->_M_day1 = L"Sunday";
2475 + _M_data->_M_day2 = L"Monday";
2476 + _M_data->_M_day3 = L"Tuesday";
2477 + _M_data->_M_day4 = L"Wednesday";
2478 + _M_data->_M_day5 = L"Thursday";
2479 + _M_data->_M_day6 = L"Friday";
2480 + _M_data->_M_day7 = L"Saturday";
2482 + // Abbreviated day names, starting with "C"'s Sun.
2483 + _M_data->_M_aday1 = L"Sun";
2484 + _M_data->_M_aday2 = L"Mon";
2485 + _M_data->_M_aday3 = L"Tue";
2486 + _M_data->_M_aday4 = L"Wed";
2487 + _M_data->_M_aday5 = L"Thu";
2488 + _M_data->_M_aday6 = L"Fri";
2489 + _M_data->_M_aday7 = L"Sat";
2491 + // Month names, starting with "C"'s January.
2492 + _M_data->_M_month01 = L"January";
2493 + _M_data->_M_month02 = L"February";
2494 + _M_data->_M_month03 = L"March";
2495 + _M_data->_M_month04 = L"April";
2496 + _M_data->_M_month05 = L"May";
2497 + _M_data->_M_month06 = L"June";
2498 + _M_data->_M_month07 = L"July";
2499 + _M_data->_M_month08 = L"August";
2500 + _M_data->_M_month09 = L"September";
2501 + _M_data->_M_month10 = L"October";
2502 + _M_data->_M_month11 = L"November";
2503 + _M_data->_M_month12 = L"December";
2505 + // Abbreviated month names, starting with "C"'s Jan.
2506 + _M_data->_M_amonth01 = L"Jan";
2507 + _M_data->_M_amonth02 = L"Feb";
2508 + _M_data->_M_amonth03 = L"Mar";
2509 + _M_data->_M_amonth04 = L"Apr";
2510 + _M_data->_M_amonth05 = L"May";
2511 + _M_data->_M_amonth06 = L"Jun";
2512 + _M_data->_M_amonth07 = L"Jul";
2513 + _M_data->_M_amonth08 = L"Aug";
2514 + _M_data->_M_amonth09 = L"Sep";
2515 + _M_data->_M_amonth10 = L"Oct";
2516 + _M_data->_M_amonth11 = L"Nov";
2517 + _M_data->_M_amonth12 = L"Dec";
2522 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2524 + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
2525 + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
2526 + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
2527 + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
2528 + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
2529 + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
2530 + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
2531 + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
2532 + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
2534 + // Day names, starting with "C"'s Sunday.
2535 + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
2536 + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
2537 + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
2538 + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
2539 + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
2540 + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
2541 + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
2543 + // Abbreviated day names, starting with "C"'s Sun.
2544 + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
2545 + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
2546 + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
2547 + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
2548 + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
2549 + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
2550 + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
2552 + // Month names, starting with "C"'s January.
2553 + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
2554 + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
2555 + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
2556 + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
2557 + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
2558 + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
2559 + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
2560 + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
2561 + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
2562 + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
2563 + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
2564 + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
2566 + // Abbreviated month names, starting with "C"'s Jan.
2567 + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
2568 + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
2569 + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
2570 + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
2571 + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
2572 + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
2573 + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
2574 + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
2575 + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
2576 + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
2577 + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
2578 + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
2584 diff -urN gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.h
2585 --- gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
2586 +++ gcc-4.1.0-patched/libstdc++-v3/config/locale/uclibc/time_members.h 2005-04-27 22:20:27.625239716 -0500
2588 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2590 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2592 +// This file is part of the GNU ISO C++ Library. This library is free
2593 +// software; you can redistribute it and/or modify it under the
2594 +// terms of the GNU General Public License as published by the
2595 +// Free Software Foundation; either version 2, or (at your option)
2596 +// any later version.
2598 +// This library is distributed in the hope that it will be useful,
2599 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2600 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2601 +// GNU General Public License for more details.
2603 +// You should have received a copy of the GNU General Public License along
2604 +// with this library; see the file COPYING. If not, write to the Free
2605 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2608 +// As a special exception, you may use this file as part of a free software
2609 +// library without restriction. Specifically, if other files instantiate
2610 +// templates or use macros or inline functions from this file, or you compile
2611 +// this file and link it with other files to produce an executable, this
2612 +// file does not by itself cause the resulting executable to be covered by
2613 +// the GNU General Public License. This exception does not however
2614 +// invalidate any other reasons why the executable file might be covered by
2615 +// the GNU General Public License.
2618 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2619 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2622 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2624 + template<typename _CharT>
2625 + __timepunct<_CharT>::__timepunct(size_t __refs)
2626 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2627 + _M_name_timepunct(_S_get_c_name())
2628 + { _M_initialize_timepunct(); }
2630 + template<typename _CharT>
2631 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2632 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2633 + _M_name_timepunct(_S_get_c_name())
2634 + { _M_initialize_timepunct(); }
2636 + template<typename _CharT>
2637 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2639 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2640 + _M_name_timepunct(__s)
2642 + char* __tmp = new char[std::strlen(__s) + 1];
2643 + std::strcpy(__tmp, __s);
2644 + _M_name_timepunct = __tmp;
2645 + _M_initialize_timepunct(__cloc);
2648 + template<typename _CharT>
2649 + __timepunct<_CharT>::~__timepunct()
2651 + if (_M_name_timepunct != _S_get_c_name())
2652 + delete [] _M_name_timepunct;
2654 + _S_destroy_c_locale(_M_c_locale_timepunct);
2656 diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_base.h
2657 --- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
2658 +++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_base.h 2005-04-27 22:20:27.626239550 -0500
2660 +// Locale support -*- C++ -*-
2662 +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
2663 +// Free Software Foundation, Inc.
2665 +// This file is part of the GNU ISO C++ Library. This library is free
2666 +// software; you can redistribute it and/or modify it under the
2667 +// terms of the GNU General Public License as published by the
2668 +// Free Software Foundation; either version 2, or (at your option)
2669 +// any later version.
2671 +// This library is distributed in the hope that it will be useful,
2672 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2673 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2674 +// GNU General Public License for more details.
2676 +// You should have received a copy of the GNU General Public License along
2677 +// with this library; see the file COPYING. If not, write to the Free
2678 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2681 +// As a special exception, you may use this file as part of a free software
2682 +// library without restriction. Specifically, if other files instantiate
2683 +// templates or use macros or inline functions from this file, or you compile
2684 +// this file and link it with other files to produce an executable, this
2685 +// file does not by itself cause the resulting executable to be covered by
2686 +// the GNU General Public License. This exception does not however
2687 +// invalidate any other reasons why the executable file might be covered by
2688 +// the GNU General Public License.
2691 +// ISO C++ 14882: 22.1 Locales
2694 +// Information as gleaned from /usr/include/ctype.h
2698 + // Note: In uClibc, the following two types depend on configuration.
2700 + // Non-standard typedefs.
2701 + typedef const __ctype_touplow_t* __to_type;
2703 + // NB: Offsets into ctype<char>::_M_table force a particular size
2704 + // on the mask type. Because of this, we don't use an enum.
2705 + typedef __ctype_mask_t mask;
2706 + static const mask upper = _ISupper;
2707 + static const mask lower = _ISlower;
2708 + static const mask alpha = _ISalpha;
2709 + static const mask digit = _ISdigit;
2710 + static const mask xdigit = _ISxdigit;
2711 + static const mask space = _ISspace;
2712 + static const mask print = _ISprint;
2713 + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2714 + static const mask cntrl = _IScntrl;
2715 + static const mask punct = _ISpunct;
2716 + static const mask alnum = _ISalpha | _ISdigit;
2718 diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_inline.h
2719 --- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
2720 +++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_inline.h 2005-04-27 22:20:27.626239550 -0500
2722 +// Locale support -*- C++ -*-
2724 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2726 +// This file is part of the GNU ISO C++ Library. This library is free
2727 +// software; you can redistribute it and/or modify it under the
2728 +// terms of the GNU General Public License as published by the
2729 +// Free Software Foundation; either version 2, or (at your option)
2730 +// any later version.
2732 +// This library is distributed in the hope that it will be useful,
2733 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2734 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2735 +// GNU General Public License for more details.
2737 +// You should have received a copy of the GNU General Public License along
2738 +// with this library; see the file COPYING. If not, write to the Free
2739 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2742 +// As a special exception, you may use this file as part of a free software
2743 +// library without restriction. Specifically, if other files instantiate
2744 +// templates or use macros or inline functions from this file, or you compile
2745 +// this file and link it with other files to produce an executable, this
2746 +// file does not by itself cause the resulting executable to be covered by
2747 +// the GNU General Public License. This exception does not however
2748 +// invalidate any other reasons why the executable file might be covered by
2749 +// the GNU General Public License.
2752 +// ISO C++ 14882: 22.1 Locales
2755 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2756 +// functions go in ctype.cc
2760 + is(mask __m, char __c) const
2761 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2765 + is(const char* __low, const char* __high, mask* __vec) const
2767 + while (__low < __high)
2768 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2774 + scan_is(mask __m, const char* __low, const char* __high) const
2776 + while (__low < __high
2777 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2784 + scan_not(mask __m, const char* __low, const char* __high) const
2786 + while (__low < __high
2787 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2791 diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2792 --- gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
2793 +++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2005-04-27 22:20:27.627239385 -0500
2795 +// Locale support -*- C++ -*-
2797 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
2798 +// Free Software Foundation, Inc.
2800 +// This file is part of the GNU ISO C++ Library. This library is free
2801 +// software; you can redistribute it and/or modify it under the
2802 +// terms of the GNU General Public License as published by the
2803 +// Free Software Foundation; either version 2, or (at your option)
2804 +// any later version.
2806 +// This library is distributed in the hope that it will be useful,
2807 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2808 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2809 +// GNU General Public License for more details.
2811 +// You should have received a copy of the GNU General Public License along
2812 +// with this library; see the file COPYING. If not, write to the Free
2813 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2816 +// As a special exception, you may use this file as part of a free software
2817 +// library without restriction. Specifically, if other files instantiate
2818 +// templates or use macros or inline functions from this file, or you compile
2819 +// this file and link it with other files to produce an executable, this
2820 +// file does not by itself cause the resulting executable to be covered by
2821 +// the GNU General Public License. This exception does not however
2822 +// invalidate any other reasons why the executable file might be covered by
2823 +// the GNU General Public License.
2826 +// ISO C++ 14882: 22.1 Locales
2829 +// Information as gleaned from /usr/include/ctype.h
2831 + const ctype_base::mask*
2832 + ctype<char>::classic_table() throw()
2833 + { return __C_ctype_b; }
2835 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2837 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2838 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2840 + _M_toupper = __C_ctype_toupper;
2841 + _M_tolower = __C_ctype_tolower;
2842 + _M_table = __table ? __table : __C_ctype_b;
2843 + memset(_M_widen, 0, sizeof(_M_widen));
2844 + memset(_M_narrow, 0, sizeof(_M_narrow));
2847 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2848 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2849 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2851 + _M_toupper = __C_ctype_toupper;
2852 + _M_tolower = __C_ctype_tolower;
2853 + _M_table = __table ? __table : __C_ctype_b;
2854 + memset(_M_widen, 0, sizeof(_M_widen));
2855 + memset(_M_narrow, 0, sizeof(_M_narrow));
2859 + ctype<char>::do_toupper(char __c) const
2860 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2863 + ctype<char>::do_toupper(char* __low, const char* __high) const
2865 + while (__low < __high)
2867 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2874 + ctype<char>::do_tolower(char __c) const
2875 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2878 + ctype<char>::do_tolower(char* __low, const char* __high) const
2880 + while (__low < __high)
2882 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2887 diff -urN gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/os_defines.h
2888 --- gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
2889 +++ gcc-4.1.0-patched/libstdc++-v3/config/os/uclibc/os_defines.h 2005-04-27 22:20:27.628239219 -0500
2891 +// Specific definitions for GNU/Linux -*- C++ -*-
2893 +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2895 +// This file is part of the GNU ISO C++ Library. This library is free
2896 +// software; you can redistribute it and/or modify it under the
2897 +// terms of the GNU General Public License as published by the
2898 +// Free Software Foundation; either version 2, or (at your option)
2899 +// any later version.
2901 +// This library is distributed in the hope that it will be useful,
2902 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2903 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2904 +// GNU General Public License for more details.
2906 +// You should have received a copy of the GNU General Public License along
2907 +// with this library; see the file COPYING. If not, write to the Free
2908 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2911 +// As a special exception, you may use this file as part of a free software
2912 +// library without restriction. Specifically, if other files instantiate
2913 +// templates or use macros or inline functions from this file, or you compile
2914 +// this file and link it with other files to produce an executable, this
2915 +// file does not by itself cause the resulting executable to be covered by
2916 +// the GNU General Public License. This exception does not however
2917 +// invalidate any other reasons why the executable file might be covered by
2918 +// the GNU General Public License.
2920 +#ifndef _GLIBCXX_OS_DEFINES
2921 +#define _GLIBCXX_OS_DEFINES 1
2923 +// System-specific #define, typedefs, corrections, etc, go here. This
2924 +// file will come before all others.
2926 +// This keeps isanum, et al from being propagated as macros.
2927 +#define __NO_CTYPE 1
2929 +#include <features.h>
2931 +// We must not see the optimized string functions GNU libc defines.
2932 +#define __NO_STRING_INLINES
2935 diff -urN gcc-4.1.0/libstdc++-v3/configure gcc-4.1.0-patched/libstdc++-v3/configure
2936 --- gcc-4.1.0/libstdc++-v3/configure 2005-04-13 19:31:43.000000000 -0500
2937 +++ gcc-4.1.0-patched/libstdc++-v3/configure 2005-04-27 22:20:33.285301695 -0500
2938 @@ -3986,6 +3986,11 @@
2939 lt_cv_deplibs_check_method=pass_all
2943 + lt_cv_deplibs_check_method=pass_all
2944 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
2947 netbsd* | knetbsd*-gnu)
2948 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2949 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
2950 @@ -5744,6 +5749,9 @@
2951 # Default to "generic".
2952 if test $enable_clocale_flag = auto; then
2953 case ${target_os} in
2955 + enable_clocale_flag=uclibc
2957 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2958 cat >conftest.$ac_ext <<_ACEOF
2960 @@ -5974,6 +5982,77 @@
2961 CTIME_CC=config/locale/generic/time_members.cc
2962 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2965 + echo "$as_me:$LINENO: result: uclibc" >&5
2966 +echo "${ECHO_T}uclibc" >&6
2968 + # Declare intention to use gettext, and add support for specific
2970 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2971 + ALL_LINGUAS="de fr"
2973 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2974 + # Extract the first word of "msgfmt", so it can be a program name with args.
2975 +set dummy msgfmt; ac_word=$2
2976 +echo "$as_me:$LINENO: checking for $ac_word" >&5
2977 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2978 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2979 + echo $ECHO_N "(cached) $ECHO_C" >&6
2981 + if test -n "$check_msgfmt"; then
2982 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2984 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2985 +for as_dir in $PATH
2988 + test -z "$as_dir" && as_dir=.
2989 + for ac_exec_ext in '' $ac_executable_extensions; do
2990 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2991 + ac_cv_prog_check_msgfmt="yes"
2992 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2998 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3001 +check_msgfmt=$ac_cv_prog_check_msgfmt
3002 +if test -n "$check_msgfmt"; then
3003 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3004 +echo "${ECHO_T}$check_msgfmt" >&6
3006 + echo "$as_me:$LINENO: result: no" >&5
3007 +echo "${ECHO_T}no" >&6
3010 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3013 + # Export the build objects.
3014 + for ling in $ALL_LINGUAS; do \
3015 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3016 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3021 + CLOCALE_H=config/locale/uclibc/c_locale.h
3022 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
3023 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
3024 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3025 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3026 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3027 + CMESSAGES_H=config/locale/uclibc/messages_members.h
3028 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3029 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
3030 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3031 + CTIME_H=config/locale/uclibc/time_members.h
3032 + CTIME_CC=config/locale/uclibc/time_members.cc
3033 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3037 # This is where the testsuite looks for locale catalogs, using the
3038 diff -urN gcc-4.1.0/libstdc++-v3/configure.host gcc-4.1.0-patched/libstdc++-v3/configure.host
3039 --- gcc-4.1.0/libstdc++-v3/configure.host 2005-01-13 16:48:14.000000000 -0600
3040 +++ gcc-4.1.0-patched/libstdc++-v3/configure.host 2005-04-27 22:20:28.088162997 -0500
3041 @@ -249,6 +249,12 @@
3045 +# Override for uClibc since linux-uclibc gets mishandled above.
3046 +case "${host_os}" in
3048 + os_include_dir="os/uclibc"
3052 # Set any OS-dependent and CPU-dependent bits.
3053 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3054 diff -urN gcc-4.1.0/libstdc++-v3/crossconfig.m4 gcc-4.1.0-patched/libstdc++-v3/crossconfig.m4
3055 --- gcc-4.1.0/libstdc++-v3/crossconfig.m4 2005-04-06 18:31:16.000000000 -0500
3056 +++ gcc-4.1.0-patched/libstdc++-v3/crossconfig.m4 2005-04-27 22:20:28.089162832 -0500
3057 @@ -143,6 +143,99 @@
3062 +# Temporary hack until we implement the float versions of the libm funcs
3063 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3064 + machine/endian.h machine/param.h sys/machine.h sys/types.h \
3065 + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3066 + SECTION_FLAGS='-ffunction-sections -fdata-sections'
3067 + AC_SUBST(SECTION_FLAGS)
3068 + GLIBCXX_CHECK_LINKER_FEATURES
3069 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3070 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
3073 + AC_DEFINE(HAVE_INT64_T)
3076 + # Don't enable LFS with uClinux
3079 + AC_DEFINE(_GLIBCXX_USE_LFS)
3082 + # For showmanyc_helper().
3083 + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3084 + GLIBCXX_CHECK_POLL
3085 + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3088 + AC_CHECK_HEADERS(sys/uio.h)
3089 + GLIBCXX_CHECK_WRITEV
3091 +# AC_DEFINE(HAVE_ACOSF)
3092 +# AC_DEFINE(HAVE_ASINF)
3093 +# AC_DEFINE(HAVE_ATANF)
3094 +# AC_DEFINE(HAVE_ATAN2F)
3095 + AC_DEFINE(HAVE_CEILF)
3096 + AC_DEFINE(HAVE_COPYSIGN)
3097 +# AC_DEFINE(HAVE_COPYSIGNF)
3098 +# AC_DEFINE(HAVE_COSF)
3099 +# AC_DEFINE(HAVE_COSHF)
3100 +# AC_DEFINE(HAVE_EXPF)
3101 +# AC_DEFINE(HAVE_FABSF)
3102 + AC_DEFINE(HAVE_FINITE)
3103 + AC_DEFINE(HAVE_FINITEF)
3104 + AC_DEFINE(HAVE_FLOORF)
3105 +# AC_DEFINE(HAVE_FMODF)
3106 +# AC_DEFINE(HAVE_FREXPF)
3107 + AC_DEFINE(HAVE_HYPOT)
3108 +# AC_DEFINE(HAVE_HYPOTF)
3109 + AC_DEFINE(HAVE_ISINF)
3110 + AC_DEFINE(HAVE_ISINFF)
3111 + AC_DEFINE(HAVE_ISNAN)
3112 + AC_DEFINE(HAVE_ISNANF)
3113 +# AC_DEFINE(HAVE_LOGF)
3114 +# AC_DEFINE(HAVE_LOG10F)
3115 +# AC_DEFINE(HAVE_MODFF)
3116 +# AC_DEFINE(HAVE_SINF)
3117 +# AC_DEFINE(HAVE_SINHF)
3118 +# AC_DEFINE(HAVE_SINCOS)
3119 +# AC_DEFINE(HAVE_SINCOSF)
3120 + AC_DEFINE(HAVE_SQRTF)
3121 +# AC_DEFINE(HAVE_TANF)
3122 +# AC_DEFINE(HAVE_TANHF)
3123 + if test x"long_double_math_on_this_cpu" = x"yes"; then
3124 + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3125 +# AC_DEFINE(HAVE_ACOSL)
3126 +# AC_DEFINE(HAVE_ASINL)
3127 +# AC_DEFINE(HAVE_ATANL)
3128 +# AC_DEFINE(HAVE_ATAN2L)
3129 +# AC_DEFINE(HAVE_CEILL)
3130 +# AC_DEFINE(HAVE_COPYSIGNL)
3131 +# AC_DEFINE(HAVE_COSL)
3132 +# AC_DEFINE(HAVE_COSHL)
3133 +# AC_DEFINE(HAVE_EXPL)
3134 +# AC_DEFINE(HAVE_FABSL)
3135 +# AC_DEFINE(HAVE_FINITEL)
3136 +# AC_DEFINE(HAVE_FLOORL)
3137 +# AC_DEFINE(HAVE_FMODL)
3138 +# AC_DEFINE(HAVE_FREXPL)
3139 +# AC_DEFINE(HAVE_HYPOTL)
3140 +# AC_DEFINE(HAVE_ISINFL)
3141 +# AC_DEFINE(HAVE_ISNANL)
3142 +# AC_DEFINE(HAVE_LOGL)
3143 +# AC_DEFINE(HAVE_LOG10L)
3144 +# AC_DEFINE(HAVE_MODFL)
3145 +# AC_DEFINE(HAVE_POWL)
3146 +# AC_DEFINE(HAVE_SINL)
3147 +# AC_DEFINE(HAVE_SINHL)
3148 +# AC_DEFINE(HAVE_SINCOSL)
3149 +# AC_DEFINE(HAVE_SQRTL)
3150 +# AC_DEFINE(HAVE_TANL)
3151 +# AC_DEFINE(HAVE_TANHL)
3154 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3155 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3156 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3158 AC_DEFINE(HAVE_INT64_T)
3161 - # Don't enable LFS with uClibc
3162 + # Don't enable LFS with uClinux
3165 AC_DEFINE(_GLIBCXX_USE_LFS)
3166 diff -urN gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.1.0-patched/libstdc++-v3/include/c_compatibility/wchar.h
3167 --- gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
3168 +++ gcc-4.1.0-patched/libstdc++-v3/include/c_compatibility/wchar.h 2005-04-27 22:20:28.089162832 -0500
3171 using std::wmemmove;
3173 +#if _GLIBCXX_HAVE_WCSFTIME
3174 using std::wcsftime;
3177 #if _GLIBCXX_USE_C99
3179 diff -urN gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.1.0-patched/libstdc++-v3/include/c_std/std_cwchar.h
3180 --- gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h 2004-07-20 03:47:42.000000000 -0500
3181 +++ gcc-4.1.0-patched/libstdc++-v3/include/c_std/std_cwchar.h 2005-04-27 22:20:28.090162666 -0500
3186 +#if _GLIBCXX_HAVE_WCSFTIME