1 diff -urN gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 gcc-3.4.0/libstdc++-v3/acinclude.m4
2 --- gcc-3.4.0-dist/libstdc++-v3/acinclude.m4 2004-03-18 11:35:22.000000000 -0600
3 +++ gcc-3.4.0/libstdc++-v3/acinclude.m4 2004-08-12 17:08:19.000000000 -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 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
21 AC_EGREP_CPP([_GLIBCXX_ok], [
23 @@ -1137,6 +1140,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-3.4.0-dist/libstdc++-v3/aclocal.m4 gcc-3.4.0/libstdc++-v3/aclocal.m4
66 --- gcc-3.4.0-dist/libstdc++-v3/aclocal.m4 2004-03-18 11:35:23.000000000 -0600
67 +++ gcc-3.4.0/libstdc++-v3/aclocal.m4 2004-08-12 17:13:42.000000000 -0500
69 # Default to "generic".
70 if test $enable_clocale_flag = auto; then
73 + enable_clocale_flag=uclibc
75 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
76 AC_EGREP_CPP([_GLIBCXX_ok], [
78 @@ -1150,6 +1153,41 @@
79 CTIME_CC=config/locale/generic/time_members.cc
80 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
83 + AC_MSG_RESULT(uclibc)
85 + # Declare intention to use gettext, and add support for specific
87 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
90 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
91 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
92 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
95 + # Export the build objects.
96 + for ling in $ALL_LINGUAS; do \
97 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
98 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
100 + AC_SUBST(glibcxx_MOFILES)
101 + AC_SUBST(glibcxx_POFILES)
103 + CLOCALE_H=config/locale/uclibc/c_locale.h
104 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
105 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
106 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
107 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
108 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
109 + CMESSAGES_H=config/locale/uclibc/messages_members.h
110 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
111 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
112 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
113 + CTIME_H=config/locale/uclibc/time_members.h
114 + CTIME_CC=config/locale/uclibc/time_members.cc
115 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
119 # This is where the testsuite looks for locale catalogs, using the
120 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
121 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
122 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-08-12 17:08:19.000000000 -0500
124 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
126 +// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
128 +// This file is part of the GNU ISO C++ Library. This library is free
129 +// software; you can redistribute it and/or modify it under the
130 +// terms of the GNU General Public License as published by the
131 +// Free Software Foundation; either version 2, or (at your option)
132 +// any later version.
134 +// This library is distributed in the hope that it will be useful,
135 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
136 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
137 +// GNU General Public License for more details.
139 +// You should have received a copy of the GNU General Public License along
140 +// with this library; see the file COPYING. If not, write to the Free
141 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
144 +// As a special exception, you may use this file as part of a free software
145 +// library without restriction. Specifically, if other files instantiate
146 +// templates or use macros or inline functions from this file, or you compile
147 +// this file and link it with other files to produce an executable, this
148 +// file does not by itself cause the resulting executable to be covered by
149 +// the GNU General Public License. This exception does not however
150 +// invalidate any other reasons why the executable file might be covered by
151 +// the GNU General Public License.
153 +// Written by Jakub Jelinek <jakub@redhat.com>
157 +#ifdef __UCLIBC_MJN3_ONLY__
158 +#warning clean this up
161 +#ifdef __UCLIBC_HAS_XLOCALE__
163 +extern "C" __typeof(iswctype_l) __iswctype_l;
164 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
165 +extern "C" __typeof(strcoll_l) __strcoll_l;
166 +extern "C" __typeof(strftime_l) __strftime_l;
167 +extern "C" __typeof(strtod_l) __strtod_l;
168 +extern "C" __typeof(strtof_l) __strtof_l;
169 +extern "C" __typeof(strtold_l) __strtold_l;
170 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
171 +extern "C" __typeof(towlower_l) __towlower_l;
172 +extern "C" __typeof(towupper_l) __towupper_l;
173 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
174 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
175 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
176 +extern "C" __typeof(wctype_l) __wctype_l;
177 +extern "C" __typeof(newlocale) __newlocale;
178 +extern "C" __typeof(freelocale) __freelocale;
179 +extern "C" __typeof(duplocale) __duplocale;
180 +extern "C" __typeof(uselocale) __uselocale;
182 +#endif // GLIBC 2.3 and later
183 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
184 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
185 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-08-12 17:08:19.000000000 -0500
187 +// Wrapper for underlying C-language localization -*- C++ -*-
189 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
191 +// This file is part of the GNU ISO C++ Library. This library is free
192 +// software; you can redistribute it and/or modify it under the
193 +// terms of the GNU General Public License as published by the
194 +// Free Software Foundation; either version 2, or (at your option)
195 +// any later version.
197 +// This library is distributed in the hope that it will be useful,
198 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
199 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
200 +// GNU General Public License for more details.
202 +// You should have received a copy of the GNU General Public License along
203 +// with this library; see the file COPYING. If not, write to the Free
204 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
207 +// As a special exception, you may use this file as part of a free software
208 +// library without restriction. Specifically, if other files instantiate
209 +// templates or use macros or inline functions from this file, or you compile
210 +// this file and link it with other files to produce an executable, this
211 +// file does not by itself cause the resulting executable to be covered by
212 +// the GNU General Public License. This exception does not however
213 +// invalidate any other reasons why the executable file might be covered by
214 +// the GNU General Public License.
217 +// ISO C++ 14882: 22.8 Standard locale categories.
220 +// Written by Benjamin Kosnik <bkoz@redhat.com>
222 +#include <cerrno> // For errno
224 +#include <stdexcept>
225 +#include <langinfo.h>
226 +#include <bits/c++locale_internal.h>
228 +#ifndef __UCLIBC_HAS_XLOCALE__
229 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
230 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
231 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
232 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
233 +#define __strtof_l(S, E, L) strtof((S), (E))
234 +#define __strtod_l(S, E, L) strtod((S), (E))
235 +#define __strtold_l(S, E, L) strtold((S), (E))
236 +#warning should dummy __newlocale check for C|POSIX ?
237 +#define __newlocale(a, b, c) NULL
238 +#define __freelocale(a) ((void)0)
239 +#define __duplocale(a) __c_locale()
246 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
247 + const __c_locale& __cloc)
249 + if (!(__err & ios_base::failbit))
253 + float __f = __strtof_l(__s, &__sanity, __cloc);
254 + if (__sanity != __s && errno != ERANGE)
257 + __err |= ios_base::failbit;
263 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
264 + const __c_locale& __cloc)
266 + if (!(__err & ios_base::failbit))
270 + double __d = __strtod_l(__s, &__sanity, __cloc);
271 + if (__sanity != __s && errno != ERANGE)
274 + __err |= ios_base::failbit;
280 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
281 + const __c_locale& __cloc)
283 + if (!(__err & ios_base::failbit))
287 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
288 + if (__sanity != __s && errno != ERANGE)
291 + __err |= ios_base::failbit;
296 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
299 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
300 +#ifdef __UCLIBC_HAS_XLOCALE__
303 + // This named locale is not supported by the underlying OS.
304 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
305 + "name not valid"));
311 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
313 + if (_S_get_c_locale() != __cloc)
314 + __freelocale(__cloc);
318 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
319 + { return __duplocale(__cloc); }
324 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
332 +#if _GLIBCXX_NUM_CATEGORIES != 0
338 + "LC_IDENTIFICATION"
345 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
347 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h
348 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
349 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-08-12 17:08:19.000000000 -0500
351 +// Wrapper for underlying C-language localization -*- C++ -*-
353 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
355 +// This file is part of the GNU ISO C++ Library. This library is free
356 +// software; you can redistribute it and/or modify it under the
357 +// terms of the GNU General Public License as published by the
358 +// Free Software Foundation; either version 2, or (at your option)
359 +// any later version.
361 +// This library is distributed in the hope that it will be useful,
362 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
363 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
364 +// GNU General Public License for more details.
366 +// You should have received a copy of the GNU General Public License along
367 +// with this library; see the file COPYING. If not, write to the Free
368 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
371 +// As a special exception, you may use this file as part of a free software
372 +// library without restriction. Specifically, if other files instantiate
373 +// templates or use macros or inline functions from this file, or you compile
374 +// this file and link it with other files to produce an executable, this
375 +// file does not by itself cause the resulting executable to be covered by
376 +// the GNU General Public License. This exception does not however
377 +// invalidate any other reasons why the executable file might be covered by
378 +// the GNU General Public License.
381 +// ISO C++ 14882: 22.8 Standard locale categories.
384 +// Written by Benjamin Kosnik <bkoz@redhat.com>
387 +#define _C_LOCALE_H 1
389 +#pragma GCC system_header
391 +#include <cstring> // get std::strlen
392 +#include <cstdio> // get std::snprintf or std::sprintf
394 +#include <langinfo.h> // For codecvt
395 +#ifdef __UCLIBC_MJN3_ONLY__
398 +#ifdef __UCLIBC_HAS_LOCALE__
399 +#include <iconv.h> // For codecvt using iconv, iconv_t
401 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
402 +#include <libintl.h> // For messages
405 +#ifdef __UCLIBC_MJN3_ONLY__
406 +#warning what is _GLIBCXX_C_LOCALE_GNU for
408 +#define _GLIBCXX_C_LOCALE_GNU 1
410 +#ifdef __UCLIBC_MJN3_ONLY__
411 +#warning fix categories
413 +// #define _GLIBCXX_NUM_CATEGORIES 6
414 +#define _GLIBCXX_NUM_CATEGORIES 0
416 +#ifdef __UCLIBC_HAS_XLOCALE__
419 + extern "C" __typeof(uselocale) __uselocale;
425 +#ifdef __UCLIBC_HAS_XLOCALE__
426 + typedef __locale_t __c_locale;
428 + typedef int* __c_locale;
431 + // Convert numeric value of type _Tv to string and return length of
432 + // string. If snprintf is available use it, otherwise fall back to
433 + // the unsafe sprintf which, in general, can be dangerous and should
435 + template<typename _Tv>
437 + __convert_from_v(char* __out, const int __size, const char* __fmt,
438 +#ifdef __UCLIBC_HAS_XLOCALE__
439 + _Tv __v, const __c_locale& __cloc, int __prec = -1)
441 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
443 + _Tv __v, const __c_locale&, int __prec = -1)
445 +# ifdef __UCLIBC_HAS_LOCALE__
446 + char* __old = std::setlocale(LC_ALL, NULL);
447 + char* __sav = new char[std::strlen(__old) + 1];
448 + std::strcpy(__sav, __old);
449 + std::setlocale(LC_ALL, "C");
455 + __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
457 + __ret = std::snprintf(__out, __size, __fmt, __v);
459 +#ifdef __UCLIBC_HAS_XLOCALE__
460 + __gnu_cxx::__uselocale(__old);
461 +#elif defined __UCLIBC_HAS_LOCALE__
462 + std::setlocale(LC_ALL, __sav);
470 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
471 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
472 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-08-12 17:08:19.000000000 -0500
474 +// std::codecvt implementation details, GNU version -*- C++ -*-
476 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
478 +// This file is part of the GNU ISO C++ Library. This library is free
479 +// software; you can redistribute it and/or modify it under the
480 +// terms of the GNU General Public License as published by the
481 +// Free Software Foundation; either version 2, or (at your option)
482 +// any later version.
484 +// This library is distributed in the hope that it will be useful,
485 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
486 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
487 +// GNU General Public License for more details.
489 +// You should have received a copy of the GNU General Public License along
490 +// with this library; see the file COPYING. If not, write to the Free
491 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
494 +// As a special exception, you may use this file as part of a free software
495 +// library without restriction. Specifically, if other files instantiate
496 +// templates or use macros or inline functions from this file, or you compile
497 +// this file and link it with other files to produce an executable, this
498 +// file does not by itself cause the resulting executable to be covered by
499 +// the GNU General Public License. This exception does not however
500 +// invalidate any other reasons why the executable file might be covered by
501 +// the GNU General Public License.
504 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
507 +// Written by Benjamin Kosnik <bkoz@redhat.com>
510 +#include <bits/c++locale_internal.h>
514 + // Specializations.
515 +#ifdef _GLIBCXX_USE_WCHAR_T
516 + codecvt_base::result
517 + codecvt<wchar_t, char, mbstate_t>::
518 + do_out(state_type& __state, const intern_type* __from,
519 + const intern_type* __from_end, const intern_type*& __from_next,
520 + extern_type* __to, extern_type* __to_end,
521 + extern_type*& __to_next) const
524 + state_type __tmp_state(__state);
526 +#ifdef __UCLIBC_HAS_XLOCALE__
527 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
530 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
531 + // in case we fall back to wcrtomb and then continue, in a loop.
532 + // NB: wcsnrtombs is a GNU extension
533 + for (__from_next = __from, __to_next = __to;
534 + __from_next < __from_end && __to_next < __to_end
537 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
538 + __from_end - __from_next);
539 + if (!__from_chunk_end)
540 + __from_chunk_end = __from_end;
542 + __from = __from_next;
543 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
544 + __from_chunk_end - __from_next,
545 + __to_end - __to_next, &__state);
546 + if (__conv == static_cast<size_t>(-1))
548 + // In case of error, in order to stop at the exact place we
549 + // have to start again from the beginning with a series of
551 + for (; __from < __from_next; ++__from)
552 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
553 + __state = __tmp_state;
556 + else if (__from_next && __from_next < __from_chunk_end)
558 + __to_next += __conv;
563 + __from_next = __from_chunk_end;
564 + __to_next += __conv;
567 + if (__from_next < __from_end && __ret == ok)
569 + extern_type __buf[MB_LEN_MAX];
570 + __tmp_state = __state;
571 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
572 + if (__conv > static_cast<size_t>(__to_end - __to_next))
576 + memcpy(__to_next, __buf, __conv);
577 + __state = __tmp_state;
578 + __to_next += __conv;
584 +#ifdef __UCLIBC_HAS_XLOCALE__
585 + __uselocale(__old);
591 + codecvt_base::result
592 + codecvt<wchar_t, char, mbstate_t>::
593 + do_in(state_type& __state, const extern_type* __from,
594 + const extern_type* __from_end, const extern_type*& __from_next,
595 + intern_type* __to, intern_type* __to_end,
596 + intern_type*& __to_next) const
599 + state_type __tmp_state(__state);
601 +#ifdef __UCLIBC_HAS_XLOCALE__
602 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
605 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
606 + // in case we store a L'\0' and then continue, in a loop.
607 + // NB: mbsnrtowcs is a GNU extension
608 + for (__from_next = __from, __to_next = __to;
609 + __from_next < __from_end && __to_next < __to_end
612 + const extern_type* __from_chunk_end;
613 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
616 + if (!__from_chunk_end)
617 + __from_chunk_end = __from_end;
619 + __from = __from_next;
620 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
621 + __from_chunk_end - __from_next,
622 + __to_end - __to_next, &__state);
623 + if (__conv == static_cast<size_t>(-1))
625 + // In case of error, in order to stop at the exact place we
626 + // have to start again from the beginning with a series of
628 + for (;; ++__to_next, __from += __conv)
630 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
632 + if (__conv == static_cast<size_t>(-1)
633 + || __conv == static_cast<size_t>(-2))
636 + __from_next = __from;
637 + __state = __tmp_state;
640 + else if (__from_next && __from_next < __from_chunk_end)
642 + // It is unclear what to return in this case (see DR 382).
643 + __to_next += __conv;
648 + __from_next = __from_chunk_end;
649 + __to_next += __conv;
652 + if (__from_next < __from_end && __ret == ok)
654 + if (__to_next < __to_end)
656 + // XXX Probably wrong for stateful encodings
657 + __tmp_state = __state;
659 + *__to_next++ = L'\0';
666 +#ifdef __UCLIBC_HAS_XLOCALE__
667 + __uselocale(__old);
674 + codecvt<wchar_t, char, mbstate_t>::
675 + do_encoding() const throw()
677 + // XXX This implementation assumes that the encoding is
678 + // stateless and is either single-byte or variable-width.
680 +#ifdef __UCLIBC_HAS_XLOCALE__
681 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
683 + if (MB_CUR_MAX == 1)
685 +#ifdef __UCLIBC_HAS_XLOCALE__
686 + __uselocale(__old);
692 + codecvt<wchar_t, char, mbstate_t>::
693 + do_max_length() const throw()
695 +#ifdef __UCLIBC_HAS_XLOCALE__
696 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
698 + // XXX Probably wrong for stateful encodings.
699 + int __ret = MB_CUR_MAX;
700 +#ifdef __UCLIBC_HAS_XLOCALE__
701 + __uselocale(__old);
707 + codecvt<wchar_t, char, mbstate_t>::
708 + do_length(state_type& __state, const extern_type* __from,
709 + const extern_type* __end, size_t __max) const
712 + state_type __tmp_state(__state);
714 +#ifdef __UCLIBC_HAS_XLOCALE__
715 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
718 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
719 + // in case we advance past it and then continue, in a loop.
720 + // NB: mbsnrtowcs is a GNU extension
722 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
723 + // its fourth parameter (it wouldn't with NULL as first parameter).
724 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
726 + while (__from < __end && __max)
728 + const extern_type* __from_chunk_end;
729 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
732 + if (!__from_chunk_end)
733 + __from_chunk_end = __end;
735 + const extern_type* __tmp_from = __from;
736 + size_t __conv = mbsnrtowcs(__to, &__from,
737 + __from_chunk_end - __from,
739 + if (__conv == static_cast<size_t>(-1))
741 + // In case of error, in order to stop at the exact place we
742 + // have to start again from the beginning with a series of
744 + for (__from = __tmp_from;; __from += __conv)
746 + __conv = mbrtowc(NULL, __from, __end - __from,
748 + if (__conv == static_cast<size_t>(-1)
749 + || __conv == static_cast<size_t>(-2))
752 + __state = __tmp_state;
753 + __ret += __from - __tmp_from;
757 + __from = __from_chunk_end;
759 + __ret += __from - __tmp_from;
762 + if (__from < __end && __max)
764 + // XXX Probably wrong for stateful encodings
765 + __tmp_state = __state;
772 +#ifdef __UCLIBC_HAS_XLOCALE__
773 + __uselocale(__old);
780 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
781 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
782 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-08-12 17:08:19.000000000 -0500
784 +// std::collate implementation details, GNU version -*- C++ -*-
786 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
788 +// This file is part of the GNU ISO C++ Library. This library is free
789 +// software; you can redistribute it and/or modify it under the
790 +// terms of the GNU General Public License as published by the
791 +// Free Software Foundation; either version 2, or (at your option)
792 +// any later version.
794 +// This library is distributed in the hope that it will be useful,
795 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
796 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797 +// GNU General Public License for more details.
799 +// You should have received a copy of the GNU General Public License along
800 +// with this library; see the file COPYING. If not, write to the Free
801 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
804 +// As a special exception, you may use this file as part of a free software
805 +// library without restriction. Specifically, if other files instantiate
806 +// templates or use macros or inline functions from this file, or you compile
807 +// this file and link it with other files to produce an executable, this
808 +// file does not by itself cause the resulting executable to be covered by
809 +// the GNU General Public License. This exception does not however
810 +// invalidate any other reasons why the executable file might be covered by
811 +// the GNU General Public License.
814 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
817 +// Written by Benjamin Kosnik <bkoz@redhat.com>
820 +#include <bits/c++locale_internal.h>
822 +#ifndef __UCLIBC_HAS_XLOCALE__
823 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
824 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
825 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
826 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
831 + // These are basically extensions to char_traits, and perhaps should
832 + // be put there instead of here.
835 + collate<char>::_M_compare(const char* __one, const char* __two) const
837 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
838 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
843 + collate<char>::_M_transform(char* __to, const char* __from,
845 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
847 +#ifdef _GLIBCXX_USE_WCHAR_T
850 + collate<wchar_t>::_M_compare(const wchar_t* __one,
851 + const wchar_t* __two) const
853 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
854 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
859 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
861 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
864 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
865 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
866 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-08-12 17:08:19.000000000 -0500
868 +// std::ctype implementation details, GNU version -*- C++ -*-
870 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
872 +// This file is part of the GNU ISO C++ Library. This library is free
873 +// software; you can redistribute it and/or modify it under the
874 +// terms of the GNU General Public License as published by the
875 +// Free Software Foundation; either version 2, or (at your option)
876 +// any later version.
878 +// This library is distributed in the hope that it will be useful,
879 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
880 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
881 +// GNU General Public License for more details.
883 +// You should have received a copy of the GNU General Public License along
884 +// with this library; see the file COPYING. If not, write to the Free
885 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
888 +// As a special exception, you may use this file as part of a free software
889 +// library without restriction. Specifically, if other files instantiate
890 +// templates or use macros or inline functions from this file, or you compile
891 +// this file and link it with other files to produce an executable, this
892 +// file does not by itself cause the resulting executable to be covered by
893 +// the GNU General Public License. This exception does not however
894 +// invalidate any other reasons why the executable file might be covered by
895 +// the GNU General Public License.
898 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
901 +// Written by Benjamin Kosnik <bkoz@redhat.com>
906 +#include <bits/c++locale_internal.h>
908 +#ifndef __UCLIBC_HAS_XLOCALE__
909 +#define __wctype_l(S, L) wctype((S))
910 +#define __towupper_l(C, L) towupper((C))
911 +#define __towlower_l(C, L) towlower((C))
912 +#define __iswctype_l(C, M, L) iswctype((C), (M))
917 + // NB: The other ctype<char> specializations are in src/locale.cc and
918 + // various /config/os/* files.
920 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
921 + : ctype<char>(0, false, __refs)
923 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
925 + _S_destroy_c_locale(_M_c_locale_ctype);
926 + _S_create_c_locale(_M_c_locale_ctype, __s);
927 +#ifdef __UCLIBC_HAS_XLOCALE__
928 + _M_toupper = _M_c_locale_ctype->__ctype_toupper;
929 + _M_tolower = _M_c_locale_ctype->__ctype_tolower;
930 + _M_table = _M_c_locale_ctype->__ctype_b;
935 +#ifdef _GLIBCXX_USE_WCHAR_T
936 + ctype<wchar_t>::__wmask_type
937 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
939 + __wmask_type __ret;
943 + __ret = __wctype_l("space", _M_c_locale_ctype);
946 + __ret = __wctype_l("print", _M_c_locale_ctype);
949 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
952 + __ret = __wctype_l("upper", _M_c_locale_ctype);
955 + __ret = __wctype_l("lower", _M_c_locale_ctype);
958 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
961 + __ret = __wctype_l("digit", _M_c_locale_ctype);
964 + __ret = __wctype_l("punct", _M_c_locale_ctype);
967 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
970 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
973 + __ret = __wctype_l("graph", _M_c_locale_ctype);
982 + ctype<wchar_t>::do_toupper(wchar_t __c) const
983 + { return __towupper_l(__c, _M_c_locale_ctype); }
986 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
988 + while (__lo < __hi)
990 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
997 + ctype<wchar_t>::do_tolower(wchar_t __c) const
998 + { return __towlower_l(__c, _M_c_locale_ctype); }
1001 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
1003 + while (__lo < __hi)
1005 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
1013 + do_is(mask __m, wchar_t __c) const
1015 + // Highest bitmask in ctype_base == 10, but extra in "C"
1016 + // library for blank.
1017 + bool __ret = false;
1018 + const size_t __bitmasksize = 11;
1019 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1020 + if (__m & _M_bit[__bitcur]
1021 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
1031 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
1033 + for (; __lo < __hi; ++__vec, ++__lo)
1035 + // Highest bitmask in ctype_base == 10, but extra in "C"
1036 + // library for blank.
1037 + const size_t __bitmasksize = 11;
1039 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1040 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
1041 + __m |= _M_bit[__bitcur];
1049 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1051 + while (__lo < __hi && !this->do_is(__m, *__lo))
1058 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1060 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1067 + do_widen(char __c) const
1068 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1072 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1074 + while (__lo < __hi)
1076 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1085 + do_narrow(wchar_t __wc, char __dfault) const
1087 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1088 + return _M_narrow[__wc];
1089 +#ifdef __UCLIBC_HAS_XLOCALE__
1090 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1092 + const int __c = wctob(__wc);
1093 +#ifdef __UCLIBC_HAS_XLOCALE__
1094 + __uselocale(__old);
1096 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1101 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1102 + char* __dest) const
1104 +#ifdef __UCLIBC_HAS_XLOCALE__
1105 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1108 + while (__lo < __hi)
1110 + if (*__lo >= 0 && *__lo < 128)
1111 + *__dest = _M_narrow[*__lo];
1114 + const int __c = wctob(*__lo);
1115 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1121 + while (__lo < __hi)
1123 + const int __c = wctob(*__lo);
1124 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1128 +#ifdef __UCLIBC_HAS_XLOCALE__
1129 + __uselocale(__old);
1135 + ctype<wchar_t>::_M_initialize_ctype()
1137 +#ifdef __UCLIBC_HAS_XLOCALE__
1138 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1141 + for (__i = 0; __i < 128; ++__i)
1143 + const int __c = wctob(__i);
1147 + _M_narrow[__i] = static_cast<char>(__c);
1150 + _M_narrow_ok = true;
1152 + _M_narrow_ok = false;
1153 + for (size_t __i = 0;
1154 + __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
1155 + _M_widen[__i] = btowc(__i);
1157 + for (size_t __i = 0; __i <= 11; ++__i)
1159 + _M_bit[__i] = static_cast<mask>(_ISbit(__i));
1160 + _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
1162 +#ifdef __UCLIBC_HAS_XLOCALE__
1163 + __uselocale(__old);
1166 +#endif // _GLIBCXX_USE_WCHAR_T
1168 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1169 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
1170 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-08-12 17:08:19.000000000 -0500
1172 +// std::messages implementation details, GNU version -*- C++ -*-
1174 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1176 +// This file is part of the GNU ISO C++ Library. This library is free
1177 +// software; you can redistribute it and/or modify it under the
1178 +// terms of the GNU General Public License as published by the
1179 +// Free Software Foundation; either version 2, or (at your option)
1180 +// any later version.
1182 +// This library is distributed in the hope that it will be useful,
1183 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1184 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1185 +// GNU General Public License for more details.
1187 +// You should have received a copy of the GNU General Public License along
1188 +// with this library; see the file COPYING. If not, write to the Free
1189 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1192 +// As a special exception, you may use this file as part of a free software
1193 +// library without restriction. Specifically, if other files instantiate
1194 +// templates or use macros or inline functions from this file, or you compile
1195 +// this file and link it with other files to produce an executable, this
1196 +// file does not by itself cause the resulting executable to be covered by
1197 +// the GNU General Public License. This exception does not however
1198 +// invalidate any other reasons why the executable file might be covered by
1199 +// the GNU General Public License.
1202 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1205 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1208 +#include <bits/c++locale_internal.h>
1210 +#ifdef __UCLIBC_MJN3_ONLY__
1211 +#warning fix gettext stuff
1213 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1214 +extern "C" char *__dcgettext(const char *domainname,
1215 + const char *msgid, int category);
1217 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1220 +#define gettext(msgid) (msgid)
1225 + // Specializations.
1228 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1230 +#ifdef __UCLIBC_HAS_XLOCALE__
1231 + __c_locale __old = __uselocale(_M_c_locale_messages);
1232 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1233 + __uselocale(__old);
1234 + return string(__msg);
1235 +#elif defined __UCLIBC_HAS_LOCALE__
1236 + char* __old = strdup(setlocale(LC_ALL, NULL));
1237 + setlocale(LC_ALL, _M_name_messages);
1238 + const char* __msg = gettext(__dfault.c_str());
1239 + setlocale(LC_ALL, __old);
1241 + return string(__msg);
1243 + const char* __msg = gettext(__dfault.c_str());
1244 + return string(__msg);
1248 +#ifdef _GLIBCXX_USE_WCHAR_T
1251 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1253 +# ifdef __UCLIBC_HAS_XLOCALE__
1254 + __c_locale __old = __uselocale(_M_c_locale_messages);
1255 + char* __msg = gettext(_M_convert_to_char(__dfault));
1256 + __uselocale(__old);
1257 + return _M_convert_from_char(__msg);
1258 +# elif defined __UCLIBC_HAS_LOCALE__
1259 + char* __old = strdup(setlocale(LC_ALL, NULL));
1260 + setlocale(LC_ALL, _M_name_messages);
1261 + char* __msg = gettext(_M_convert_to_char(__dfault));
1262 + setlocale(LC_ALL, __old);
1264 + return _M_convert_from_char(__msg);
1266 + char* __msg = gettext(_M_convert_to_char(__dfault));
1267 + return _M_convert_from_char(__msg);
1272 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1273 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
1274 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-08-12 17:08:19.000000000 -0500
1276 +// std::messages implementation details, GNU version -*- C++ -*-
1278 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
1280 +// This file is part of the GNU ISO C++ Library. This library is free
1281 +// software; you can redistribute it and/or modify it under the
1282 +// terms of the GNU General Public License as published by the
1283 +// Free Software Foundation; either version 2, or (at your option)
1284 +// any later version.
1286 +// This library is distributed in the hope that it will be useful,
1287 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1288 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1289 +// GNU General Public License for more details.
1291 +// You should have received a copy of the GNU General Public License along
1292 +// with this library; see the file COPYING. If not, write to the Free
1293 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1296 +// As a special exception, you may use this file as part of a free software
1297 +// library without restriction. Specifically, if other files instantiate
1298 +// templates or use macros or inline functions from this file, or you compile
1299 +// this file and link it with other files to produce an executable, this
1300 +// file does not by itself cause the resulting executable to be covered by
1301 +// the GNU General Public License. This exception does not however
1302 +// invalidate any other reasons why the executable file might be covered by
1303 +// the GNU General Public License.
1306 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1309 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1311 +#ifdef __UCLIBC_MJN3_ONLY__
1312 +#warning fix prototypes for *textdomain funcs
1314 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1315 +extern "C" char *__textdomain(const char *domainname);
1316 +extern "C" char *__bindtextdomain(const char *domainname,
1317 + const char *dirname);
1319 +#undef __textdomain
1320 +#undef __bindtextdomain
1321 +#define __textdomain(D) ((void)0)
1322 +#define __bindtextdomain(D,P) ((void)0)
1325 + // Non-virtual member functions.
1326 + template<typename _CharT>
1327 + messages<_CharT>::messages(size_t __refs)
1330 + _M_c_locale_messages = _S_get_c_locale();
1333 + template<typename _CharT>
1334 + messages<_CharT>::messages(__c_locale __cloc,
1335 + const char* __s __attribute__ ((__unused__)),
1339 + _M_c_locale_messages = _S_clone_c_locale(__cloc);
1342 + template<typename _CharT>
1343 + typename messages<_CharT>::catalog
1344 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1345 + const char* __dir) const
1347 + __bindtextdomain(__s.c_str(), __dir);
1348 + return this->do_open(__s, __loc);
1351 + // Virtual member functions.
1352 + template<typename _CharT>
1353 + messages<_CharT>::~messages()
1355 + _S_destroy_c_locale(_M_c_locale_messages);
1358 + template<typename _CharT>
1359 + typename messages<_CharT>::catalog
1360 + messages<_CharT>::do_open(const basic_string<char>& __s,
1361 + const locale&) const
1363 + // No error checking is done, assume the catalog exists and can
1365 + __textdomain(__s.c_str());
1369 + template<typename _CharT>
1371 + messages<_CharT>::do_close(catalog) const
1374 + // messages_byname
1375 + template<typename _CharT>
1376 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1377 + : messages<_CharT>(__refs)
1379 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1381 + _S_destroy_c_locale(this->_M_c_locale_messages);
1382 + _S_create_c_locale(this->_M_c_locale_messages, __s);
1385 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1386 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
1387 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-08-12 17:08:19.000000000 -0500
1389 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1391 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1393 +// This file is part of the GNU ISO C++ Library. This library is free
1394 +// software; you can redistribute it and/or modify it under the
1395 +// terms of the GNU General Public License as published by the
1396 +// Free Software Foundation; either version 2, or (at your option)
1397 +// any later version.
1399 +// This library is distributed in the hope that it will be useful,
1400 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1401 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1402 +// GNU General Public License for more details.
1404 +// You should have received a copy of the GNU General Public License along
1405 +// with this library; see the file COPYING. If not, write to the Free
1406 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1409 +// As a special exception, you may use this file as part of a free software
1410 +// library without restriction. Specifically, if other files instantiate
1411 +// templates or use macros or inline functions from this file, or you compile
1412 +// this file and link it with other files to produce an executable, this
1413 +// file does not by itself cause the resulting executable to be covered by
1414 +// the GNU General Public License. This exception does not however
1415 +// invalidate any other reasons why the executable file might be covered by
1416 +// the GNU General Public License.
1419 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1422 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1427 +#include <bits/c++locale_internal.h>
1429 +#ifdef __UCLIBC_MJN3_ONLY__
1430 +#warning optimize this for uclibc
1431 +#warning tailor for stub locale support
1434 +#ifndef __UCLIBC_HAS_XLOCALE__
1435 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1440 + // Construct and return valid pattern consisting of some combination of:
1441 + // space none symbol sign value
1442 + money_base::pattern
1443 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1447 + // This insanely complicated routine attempts to construct a valid
1448 + // pattern for use with monyepunct. A couple of invariants:
1450 + // if (__precedes) symbol -> value
1451 + // else value -> symbol
1453 + // if (__space) space
1456 + // none == never first
1457 + // space never first or last
1459 + // Any elegant implementations of this are welcome.
1464 + // 1 The sign precedes the value and symbol.
1465 + __ret.field[0] = sign;
1468 + // Pattern starts with sign.
1471 + __ret.field[1] = symbol;
1472 + __ret.field[3] = value;
1476 + __ret.field[1] = value;
1477 + __ret.field[3] = symbol;
1479 + __ret.field[2] = space;
1483 + // Pattern starts with sign and ends with none.
1486 + __ret.field[1] = symbol;
1487 + __ret.field[2] = value;
1491 + __ret.field[1] = value;
1492 + __ret.field[2] = symbol;
1494 + __ret.field[3] = none;
1498 + // 2 The sign follows the value and symbol.
1501 + // Pattern either ends with sign.
1504 + __ret.field[0] = symbol;
1505 + __ret.field[2] = value;
1509 + __ret.field[0] = value;
1510 + __ret.field[2] = symbol;
1512 + __ret.field[1] = space;
1513 + __ret.field[3] = sign;
1517 + // Pattern ends with sign then none.
1520 + __ret.field[0] = symbol;
1521 + __ret.field[1] = value;
1525 + __ret.field[0] = value;
1526 + __ret.field[1] = symbol;
1528 + __ret.field[2] = sign;
1529 + __ret.field[3] = none;
1533 + // 3 The sign immediately precedes the symbol.
1536 + __ret.field[0] = sign;
1537 + __ret.field[1] = symbol;
1540 + __ret.field[2] = space;
1541 + __ret.field[3] = value;
1545 + __ret.field[2] = value;
1546 + __ret.field[3] = none;
1551 + __ret.field[0] = value;
1554 + __ret.field[1] = space;
1555 + __ret.field[2] = sign;
1556 + __ret.field[3] = symbol;
1560 + __ret.field[1] = sign;
1561 + __ret.field[2] = symbol;
1562 + __ret.field[3] = none;
1567 + // 4 The sign immediately follows the symbol.
1570 + __ret.field[0] = symbol;
1571 + __ret.field[1] = sign;
1574 + __ret.field[2] = space;
1575 + __ret.field[3] = value;
1579 + __ret.field[2] = value;
1580 + __ret.field[3] = none;
1585 + __ret.field[0] = value;
1588 + __ret.field[1] = space;
1589 + __ret.field[2] = symbol;
1590 + __ret.field[3] = sign;
1594 + __ret.field[1] = symbol;
1595 + __ret.field[2] = sign;
1596 + __ret.field[3] = none;
1608 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1612 + _M_data = new __moneypunct_cache<char, true>;
1617 + _M_data->_M_decimal_point = '.';
1618 + _M_data->_M_thousands_sep = ',';
1619 + _M_data->_M_grouping = "";
1620 + _M_data->_M_grouping_size = 0;
1621 + _M_data->_M_curr_symbol = "";
1622 + _M_data->_M_curr_symbol_size = 0;
1623 + _M_data->_M_positive_sign = "";
1624 + _M_data->_M_positive_sign_size = 0;
1625 + _M_data->_M_negative_sign = "";
1626 + _M_data->_M_negative_sign_size = 0;
1627 + _M_data->_M_frac_digits = 0;
1628 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1629 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1631 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1632 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1637 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1639 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1641 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1642 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1643 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1644 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1646 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1648 + _M_data->_M_negative_sign = "()";
1650 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1652 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1655 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1656 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1657 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1659 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1660 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1661 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1662 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1664 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1665 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1666 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1673 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1677 + _M_data = new __moneypunct_cache<char, false>;
1682 + _M_data->_M_decimal_point = '.';
1683 + _M_data->_M_thousands_sep = ',';
1684 + _M_data->_M_grouping = "";
1685 + _M_data->_M_grouping_size = 0;
1686 + _M_data->_M_curr_symbol = "";
1687 + _M_data->_M_curr_symbol_size = 0;
1688 + _M_data->_M_positive_sign = "";
1689 + _M_data->_M_positive_sign_size = 0;
1690 + _M_data->_M_negative_sign = "";
1691 + _M_data->_M_negative_sign_size = 0;
1692 + _M_data->_M_frac_digits = 0;
1693 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1694 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1696 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1697 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1702 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1704 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1706 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1707 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1708 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1709 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1711 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1713 + _M_data->_M_negative_sign = "()";
1715 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1717 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1720 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1721 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1722 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1723 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1724 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1725 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1726 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1728 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1729 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1730 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1736 + moneypunct<char, true>::~moneypunct()
1737 + { delete _M_data; }
1740 + moneypunct<char, false>::~moneypunct()
1741 + { delete _M_data; }
1743 +#ifdef _GLIBCXX_USE_WCHAR_T
1746 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1747 +#ifdef __UCLIBC_HAS_XLOCALE__
1750 + const char* __name)
1754 + _M_data = new __moneypunct_cache<wchar_t, true>;
1759 + _M_data->_M_decimal_point = L'.';
1760 + _M_data->_M_thousands_sep = L',';
1761 + _M_data->_M_grouping = "";
1762 + _M_data->_M_grouping_size = 0;
1763 + _M_data->_M_curr_symbol = L"";
1764 + _M_data->_M_curr_symbol_size = 0;
1765 + _M_data->_M_positive_sign = L"";
1766 + _M_data->_M_positive_sign_size = 0;
1767 + _M_data->_M_negative_sign = L"";
1768 + _M_data->_M_negative_sign_size = 0;
1769 + _M_data->_M_frac_digits = 0;
1770 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1771 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1773 + // Use ctype::widen code without the facet...
1775 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1777 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1778 + _M_data->_M_atoms[__i] = btowc(uc);
1784 +#ifdef __UCLIBC_HAS_XLOCALE__
1785 + __c_locale __old = __uselocale(__cloc);
1787 + // Switch to named locale so that mbsrtowcs will work.
1788 + char* __old = strdup(setlocale(LC_ALL, NULL));
1789 + setlocale(LC_ALL, __name);
1792 +#ifdef __UCLIBC_MJN3_ONLY__
1793 +#warning fix this... should be monetary
1796 +# ifdef __UCLIBC_HAS_XLOCALE__
1797 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1798 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1800 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1801 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1804 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1805 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1806 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1808 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1809 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1811 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1812 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1814 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1815 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1816 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1818 + wchar_t* __wcs_ps = 0;
1819 + wchar_t* __wcs_ns = 0;
1820 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1823 + mbstate_t __state;
1824 + size_t __len = strlen(__cpossign);
1828 + memset(&__state, 0, sizeof(mbstate_t));
1829 + __wcs_ps = new wchar_t[__len];
1830 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1831 + _M_data->_M_positive_sign = __wcs_ps;
1834 + _M_data->_M_positive_sign = L"";
1835 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1837 + __len = strlen(__cnegsign);
1839 + _M_data->_M_negative_sign = L"()";
1843 + memset(&__state, 0, sizeof(mbstate_t));
1844 + __wcs_ns = new wchar_t[__len];
1845 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1846 + _M_data->_M_negative_sign = __wcs_ns;
1849 + _M_data->_M_negative_sign = L"";
1850 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1853 + __len = strlen(__ccurr);
1857 + memset(&__state, 0, sizeof(mbstate_t));
1858 + wchar_t* __wcs = new wchar_t[__len];
1859 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1860 + _M_data->_M_curr_symbol = __wcs;
1863 + _M_data->_M_curr_symbol = L"";
1864 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1872 +#ifdef __UCLIBC_HAS_XLOCALE__
1873 + __uselocale(__old);
1875 + setlocale(LC_ALL, __old);
1878 + __throw_exception_again;
1881 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1883 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1884 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1885 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1886 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1888 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1889 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1890 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1893 +#ifdef __UCLIBC_HAS_XLOCALE__
1894 + __uselocale(__old);
1896 + setlocale(LC_ALL, __old);
1904 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1905 +#ifdef __UCLIBC_HAS_XLOCALE__
1908 + const char* __name)
1912 + _M_data = new __moneypunct_cache<wchar_t, false>;
1917 + _M_data->_M_decimal_point = L'.';
1918 + _M_data->_M_thousands_sep = L',';
1919 + _M_data->_M_grouping = "";
1920 + _M_data->_M_grouping_size = 0;
1921 + _M_data->_M_curr_symbol = L"";
1922 + _M_data->_M_curr_symbol_size = 0;
1923 + _M_data->_M_positive_sign = L"";
1924 + _M_data->_M_positive_sign_size = 0;
1925 + _M_data->_M_negative_sign = L"";
1926 + _M_data->_M_negative_sign_size = 0;
1927 + _M_data->_M_frac_digits = 0;
1928 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1929 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1931 + // Use ctype::widen code without the facet...
1933 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1935 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1936 + _M_data->_M_atoms[__i] = btowc(uc);
1942 +#ifdef __UCLIBC_HAS_XLOCALE__
1943 + __c_locale __old = __uselocale(__cloc);
1945 + // Switch to named locale so that mbsrtowcs will work.
1946 + char* __old = strdup(setlocale(LC_ALL, NULL));
1947 + setlocale(LC_ALL, __name);
1950 +#ifdef __UCLIBC_MJN3_ONLY__
1951 +#warning fix this... should be monetary
1954 +# ifdef __UCLIBC_HAS_XLOCALE__
1955 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1956 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1958 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1959 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1962 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1963 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1964 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1966 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1967 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1969 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1970 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1972 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1973 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1974 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1976 + wchar_t* __wcs_ps = 0;
1977 + wchar_t* __wcs_ns = 0;
1978 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1981 + mbstate_t __state;
1983 + __len = strlen(__cpossign);
1987 + memset(&__state, 0, sizeof(mbstate_t));
1988 + __wcs_ps = new wchar_t[__len];
1989 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1990 + _M_data->_M_positive_sign = __wcs_ps;
1993 + _M_data->_M_positive_sign = L"";
1994 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1996 + __len = strlen(__cnegsign);
1998 + _M_data->_M_negative_sign = L"()";
2002 + memset(&__state, 0, sizeof(mbstate_t));
2003 + __wcs_ns = new wchar_t[__len];
2004 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
2005 + _M_data->_M_negative_sign = __wcs_ns;
2008 + _M_data->_M_negative_sign = L"";
2009 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
2012 + __len = strlen(__ccurr);
2016 + memset(&__state, 0, sizeof(mbstate_t));
2017 + wchar_t* __wcs = new wchar_t[__len];
2018 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2019 + _M_data->_M_curr_symbol = __wcs;
2022 + _M_data->_M_curr_symbol = L"";
2023 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
2031 +#ifdef __UCLIBC_HAS_XLOCALE__
2032 + __uselocale(__old);
2034 + setlocale(LC_ALL, __old);
2037 + __throw_exception_again;
2040 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2041 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2042 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2043 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2044 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2046 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2047 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2048 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2051 +#ifdef __UCLIBC_HAS_XLOCALE__
2052 + __uselocale(__old);
2054 + setlocale(LC_ALL, __old);
2061 + moneypunct<wchar_t, true>::~moneypunct()
2063 + if (_M_data->_M_positive_sign_size)
2064 + delete [] _M_data->_M_positive_sign;
2065 + if (_M_data->_M_negative_sign_size
2066 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2067 + delete [] _M_data->_M_negative_sign;
2068 + if (_M_data->_M_curr_symbol_size)
2069 + delete [] _M_data->_M_curr_symbol;
2074 + moneypunct<wchar_t, false>::~moneypunct()
2076 + if (_M_data->_M_positive_sign_size)
2077 + delete [] _M_data->_M_positive_sign;
2078 + if (_M_data->_M_negative_sign_size
2079 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2080 + delete [] _M_data->_M_negative_sign;
2081 + if (_M_data->_M_curr_symbol_size)
2082 + delete [] _M_data->_M_curr_symbol;
2087 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2088 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
2089 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-08-12 17:15:14.000000000 -0500
2091 +// std::numpunct implementation details, GNU version -*- C++ -*-
2093 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2095 +// This file is part of the GNU ISO C++ Library. This library is free
2096 +// software; you can redistribute it and/or modify it under the
2097 +// terms of the GNU General Public License as published by the
2098 +// Free Software Foundation; either version 2, or (at your option)
2099 +// any later version.
2101 +// This library is distributed in the hope that it will be useful,
2102 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2103 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2104 +// GNU General Public License for more details.
2106 +// You should have received a copy of the GNU General Public License along
2107 +// with this library; see the file COPYING. If not, write to the Free
2108 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2111 +// As a special exception, you may use this file as part of a free software
2112 +// library without restriction. Specifically, if other files instantiate
2113 +// templates or use macros or inline functions from this file, or you compile
2114 +// this file and link it with other files to produce an executable, this
2115 +// file does not by itself cause the resulting executable to be covered by
2116 +// the GNU General Public License. This exception does not however
2117 +// invalidate any other reasons why the executable file might be covered by
2118 +// the GNU General Public License.
2121 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2124 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2129 +#include <bits/c++locale_internal.h>
2131 +#ifdef __UCLIBC_MJN3_ONLY__
2132 +#warning tailor for stub locale support
2134 +#ifndef __UCLIBC_HAS_XLOCALE__
2135 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2142 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2145 + _M_data = new __numpunct_cache<char>;
2150 + _M_data->_M_grouping = "";
2151 + _M_data->_M_grouping_size = 0;
2152 + _M_data->_M_use_grouping = false;
2154 + _M_data->_M_decimal_point = '.';
2155 + _M_data->_M_thousands_sep = ',';
2157 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2158 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2160 + for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
2161 + _M_data->_M_atoms_in[__i] = __num_base::_S_atoms_in[__i];
2166 + _M_data->_M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
2167 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
2169 + // Check for NULL, which implies no grouping.
2170 + if (_M_data->_M_thousands_sep == '\0')
2171 + _M_data->_M_grouping = "";
2173 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2174 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2177 + // NB: There is no way to extact this info from posix locales.
2178 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2179 + _M_data->_M_truename = "true";
2180 + _M_data->_M_truename_size = strlen(_M_data->_M_truename);
2181 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2182 + _M_data->_M_falsename = "false";
2183 + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
2187 + numpunct<char>::~numpunct()
2188 + { delete _M_data; }
2190 +#ifdef _GLIBCXX_USE_WCHAR_T
2193 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2196 + _M_data = new __numpunct_cache<wchar_t>;
2201 + _M_data->_M_grouping = "";
2202 + _M_data->_M_grouping_size = 0;
2203 + _M_data->_M_use_grouping = false;
2205 + _M_data->_M_decimal_point = L'.';
2206 + _M_data->_M_thousands_sep = L',';
2208 +#ifdef __UCLIBC_HAS_XLOCALE__
2209 + __c_locale __old = __uselocale(_S_get_c_locale());
2211 + // Use ctype::widen code without the facet...
2213 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2215 + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
2216 + _M_data->_M_atoms_out[__i] = btowc(uc);
2219 + for (size_t __i = 0; __i < __num_base::_S_iend; ++__i)
2221 + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__i]);
2222 + _M_data->_M_atoms_in[__i] = btowc(uc);
2224 +#ifdef __UCLIBC_HAS_XLOCALE__
2225 + __uselocale(__old);
2231 +#ifdef __UCLIBC_MJN3_ONLY__
2235 +# ifdef __UCLIBC_HAS_XLOCALE__
2236 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2237 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2239 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2240 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2243 + union __s_and_w { const char *__s; unsigned int __w; } __u;
2244 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2245 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
2247 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2248 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
2251 + if (_M_data->_M_thousands_sep == L'\0')
2252 + _M_data->_M_grouping = "";
2254 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2255 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2258 + // NB: There is no way to extact this info from posix locales.
2259 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2260 + _M_data->_M_truename = L"true";
2261 + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
2262 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2263 + _M_data->_M_falsename = L"false";
2264 + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
2268 + numpunct<wchar_t>::~numpunct()
2269 + { delete _M_data; }
2272 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2273 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
2274 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-08-12 17:08:19.000000000 -0500
2276 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2278 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2280 +// This file is part of the GNU ISO C++ Library. This library is free
2281 +// software; you can redistribute it and/or modify it under the
2282 +// terms of the GNU General Public License as published by the
2283 +// Free Software Foundation; either version 2, or (at your option)
2284 +// any later version.
2286 +// This library is distributed in the hope that it will be useful,
2287 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2288 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2289 +// GNU General Public License for more details.
2291 +// You should have received a copy of the GNU General Public License along
2292 +// with this library; see the file COPYING. If not, write to the Free
2293 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2296 +// As a special exception, you may use this file as part of a free software
2297 +// library without restriction. Specifically, if other files instantiate
2298 +// templates or use macros or inline functions from this file, or you compile
2299 +// this file and link it with other files to produce an executable, this
2300 +// file does not by itself cause the resulting executable to be covered by
2301 +// the GNU General Public License. This exception does not however
2302 +// invalidate any other reasons why the executable file might be covered by
2303 +// the GNU General Public License.
2306 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2307 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2310 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2313 +#include <bits/c++locale_internal.h>
2315 +#ifdef __UCLIBC_MJN3_ONLY__
2316 +#warning tailor for stub locale support
2318 +#ifndef __UCLIBC_HAS_XLOCALE__
2319 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2326 + __timepunct<char>::
2327 + _M_put(char* __s, size_t __maxlen, const char* __format,
2328 + const tm* __tm) const
2330 +#ifdef __UCLIBC_HAS_XLOCALE__
2331 + __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2333 + char* __old = strdup(setlocale(LC_ALL, NULL));
2334 + setlocale(LC_ALL, _M_name_timepunct);
2335 + strftime(__s, __maxlen, __format, __tm);
2336 + setlocale(LC_ALL, __old);
2343 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2346 + _M_data = new __timepunct_cache<char>;
2351 + _M_c_locale_timepunct = _S_get_c_locale();
2353 + _M_data->_M_date_format = "%m/%d/%y";
2354 + _M_data->_M_date_era_format = "%m/%d/%y";
2355 + _M_data->_M_time_format = "%H:%M:%S";
2356 + _M_data->_M_time_era_format = "%H:%M:%S";
2357 + _M_data->_M_date_time_format = "";
2358 + _M_data->_M_date_time_era_format = "";
2359 + _M_data->_M_am = "AM";
2360 + _M_data->_M_pm = "PM";
2361 + _M_data->_M_am_pm_format = "";
2363 + // Day names, starting with "C"'s Sunday.
2364 + _M_data->_M_day1 = "Sunday";
2365 + _M_data->_M_day2 = "Monday";
2366 + _M_data->_M_day3 = "Tuesday";
2367 + _M_data->_M_day4 = "Wednesday";
2368 + _M_data->_M_day5 = "Thursday";
2369 + _M_data->_M_day6 = "Friday";
2370 + _M_data->_M_day7 = "Saturday";
2372 + // Abbreviated day names, starting with "C"'s Sun.
2373 + _M_data->_M_aday1 = "Sun";
2374 + _M_data->_M_aday2 = "Mon";
2375 + _M_data->_M_aday3 = "Tue";
2376 + _M_data->_M_aday4 = "Wed";
2377 + _M_data->_M_aday5 = "Thu";
2378 + _M_data->_M_aday6 = "Fri";
2379 + _M_data->_M_aday7 = "Sat";
2381 + // Month names, starting with "C"'s January.
2382 + _M_data->_M_month01 = "January";
2383 + _M_data->_M_month02 = "February";
2384 + _M_data->_M_month03 = "March";
2385 + _M_data->_M_month04 = "April";
2386 + _M_data->_M_month05 = "May";
2387 + _M_data->_M_month06 = "June";
2388 + _M_data->_M_month07 = "July";
2389 + _M_data->_M_month08 = "August";
2390 + _M_data->_M_month09 = "September";
2391 + _M_data->_M_month10 = "October";
2392 + _M_data->_M_month11 = "November";
2393 + _M_data->_M_month12 = "December";
2395 + // Abbreviated month names, starting with "C"'s Jan.
2396 + _M_data->_M_amonth01 = "Jan";
2397 + _M_data->_M_amonth02 = "Feb";
2398 + _M_data->_M_amonth03 = "Mar";
2399 + _M_data->_M_amonth04 = "Apr";
2400 + _M_data->_M_amonth05 = "May";
2401 + _M_data->_M_amonth06 = "Jun";
2402 + _M_data->_M_amonth07 = "July";
2403 + _M_data->_M_amonth08 = "Aug";
2404 + _M_data->_M_amonth09 = "Sep";
2405 + _M_data->_M_amonth10 = "Oct";
2406 + _M_data->_M_amonth11 = "Nov";
2407 + _M_data->_M_amonth12 = "Dec";
2411 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2413 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2414 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2415 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2416 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2417 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2418 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
2419 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2420 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2421 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2423 + // Day names, starting with "C"'s Sunday.
2424 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2425 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2426 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2427 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2428 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2429 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2430 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2432 + // Abbreviated day names, starting with "C"'s Sun.
2433 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2434 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2435 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2436 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2437 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2438 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2439 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2441 + // Month names, starting with "C"'s January.
2442 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2443 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2444 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2445 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2446 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2447 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2448 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2449 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2450 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2451 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2452 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2453 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2455 + // Abbreviated month names, starting with "C"'s Jan.
2456 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2457 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2458 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2459 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2460 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2461 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2462 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2463 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2464 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2465 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2466 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2467 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2471 +#ifdef _GLIBCXX_USE_WCHAR_T
2474 + __timepunct<wchar_t>::
2475 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2476 + const tm* __tm) const
2478 +#ifdef __UCLIBC_HAS_XLOCALE__
2479 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2481 + char* __old = strdup(setlocale(LC_ALL, NULL));
2482 + setlocale(LC_ALL, _M_name_timepunct);
2483 + wcsftime(__s, __maxlen, __format, __tm);
2484 + setlocale(LC_ALL, __old);
2491 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2494 + _M_data = new __timepunct_cache<wchar_t>;
2496 +#warning wide time stuff
2500 + _M_c_locale_timepunct = _S_get_c_locale();
2502 + _M_data->_M_date_format = L"%m/%d/%y";
2503 + _M_data->_M_date_era_format = L"%m/%d/%y";
2504 + _M_data->_M_time_format = L"%H:%M:%S";
2505 + _M_data->_M_time_era_format = L"%H:%M:%S";
2506 + _M_data->_M_date_time_format = L"";
2507 + _M_data->_M_date_time_era_format = L"";
2508 + _M_data->_M_am = L"AM";
2509 + _M_data->_M_pm = L"PM";
2510 + _M_data->_M_am_pm_format = L"";
2512 + // Day names, starting with "C"'s Sunday.
2513 + _M_data->_M_day1 = L"Sunday";
2514 + _M_data->_M_day2 = L"Monday";
2515 + _M_data->_M_day3 = L"Tuesday";
2516 + _M_data->_M_day4 = L"Wednesday";
2517 + _M_data->_M_day5 = L"Thursday";
2518 + _M_data->_M_day6 = L"Friday";
2519 + _M_data->_M_day7 = L"Saturday";
2521 + // Abbreviated day names, starting with "C"'s Sun.
2522 + _M_data->_M_aday1 = L"Sun";
2523 + _M_data->_M_aday2 = L"Mon";
2524 + _M_data->_M_aday3 = L"Tue";
2525 + _M_data->_M_aday4 = L"Wed";
2526 + _M_data->_M_aday5 = L"Thu";
2527 + _M_data->_M_aday6 = L"Fri";
2528 + _M_data->_M_aday7 = L"Sat";
2530 + // Month names, starting with "C"'s January.
2531 + _M_data->_M_month01 = L"January";
2532 + _M_data->_M_month02 = L"February";
2533 + _M_data->_M_month03 = L"March";
2534 + _M_data->_M_month04 = L"April";
2535 + _M_data->_M_month05 = L"May";
2536 + _M_data->_M_month06 = L"June";
2537 + _M_data->_M_month07 = L"July";
2538 + _M_data->_M_month08 = L"August";
2539 + _M_data->_M_month09 = L"September";
2540 + _M_data->_M_month10 = L"October";
2541 + _M_data->_M_month11 = L"November";
2542 + _M_data->_M_month12 = L"December";
2544 + // Abbreviated month names, starting with "C"'s Jan.
2545 + _M_data->_M_amonth01 = L"Jan";
2546 + _M_data->_M_amonth02 = L"Feb";
2547 + _M_data->_M_amonth03 = L"Mar";
2548 + _M_data->_M_amonth04 = L"Apr";
2549 + _M_data->_M_amonth05 = L"May";
2550 + _M_data->_M_amonth06 = L"Jun";
2551 + _M_data->_M_amonth07 = L"July";
2552 + _M_data->_M_amonth08 = L"Aug";
2553 + _M_data->_M_amonth09 = L"Sep";
2554 + _M_data->_M_amonth10 = L"Oct";
2555 + _M_data->_M_amonth11 = L"Nov";
2556 + _M_data->_M_amonth12 = L"Dec";
2561 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2563 + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
2564 + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
2565 + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
2566 + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
2567 + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
2568 + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
2569 + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
2570 + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
2571 + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
2573 + // Day names, starting with "C"'s Sunday.
2574 + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
2575 + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
2576 + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
2577 + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
2578 + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
2579 + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
2580 + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
2582 + // Abbreviated day names, starting with "C"'s Sun.
2583 + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
2584 + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
2585 + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
2586 + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
2587 + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
2588 + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
2589 + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
2591 + // Month names, starting with "C"'s January.
2592 + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
2593 + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
2594 + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
2595 + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
2596 + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
2597 + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
2598 + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
2599 + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
2600 + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
2601 + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
2602 + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
2603 + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
2605 + // Abbreviated month names, starting with "C"'s Jan.
2606 + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
2607 + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
2608 + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
2609 + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
2610 + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
2611 + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
2612 + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
2613 + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
2614 + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
2615 + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
2616 + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
2617 + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
2623 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h
2624 --- gcc-3.4.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
2625 +++ gcc-3.4.0/libstdc++-v3/config/locale/uclibc/time_members.h 2004-08-12 17:08:19.000000000 -0500
2627 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2629 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2631 +// This file is part of the GNU ISO C++ Library. This library is free
2632 +// software; you can redistribute it and/or modify it under the
2633 +// terms of the GNU General Public License as published by the
2634 +// Free Software Foundation; either version 2, or (at your option)
2635 +// any later version.
2637 +// This library is distributed in the hope that it will be useful,
2638 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2639 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2640 +// GNU General Public License for more details.
2642 +// You should have received a copy of the GNU General Public License along
2643 +// with this library; see the file COPYING. If not, write to the Free
2644 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2647 +// As a special exception, you may use this file as part of a free software
2648 +// library without restriction. Specifically, if other files instantiate
2649 +// templates or use macros or inline functions from this file, or you compile
2650 +// this file and link it with other files to produce an executable, this
2651 +// file does not by itself cause the resulting executable to be covered by
2652 +// the GNU General Public License. This exception does not however
2653 +// invalidate any other reasons why the executable file might be covered by
2654 +// the GNU General Public License.
2657 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2658 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2661 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2663 + template<typename _CharT>
2664 + __timepunct<_CharT>::__timepunct(size_t __refs)
2665 + : facet(__refs), _M_data(NULL)
2667 +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
2668 + _M_name_timepunct = _S_get_c_name();
2670 + _M_initialize_timepunct();
2673 + template<typename _CharT>
2674 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2675 + : facet(__refs), _M_data(__cache)
2677 +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
2678 + _M_name_timepunct = _S_get_c_name();
2680 + _M_initialize_timepunct();
2683 + template<typename _CharT>
2684 + __timepunct<_CharT>::__timepunct(__c_locale __cloc,
2685 + const char* __s __attribute__ ((__unused__)),
2687 + : facet(__refs), _M_data(NULL)
2689 +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
2690 + char* __tmp = new char[std::strlen(__s) + 1];
2691 + std::strcpy(__tmp, __s);
2692 + _M_name_timepunct = __tmp;
2694 + _M_initialize_timepunct(__cloc);
2697 + template<typename _CharT>
2698 + __timepunct<_CharT>::~__timepunct()
2700 +#if !(__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2))
2701 + if (_M_name_timepunct != _S_get_c_name())
2702 + delete [] _M_name_timepunct;
2705 + _S_destroy_c_locale(_M_c_locale_timepunct);
2707 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h
2708 --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
2709 +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-08-12 17:08:19.000000000 -0500
2711 +// Locale support -*- C++ -*-
2713 +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
2714 +// Free Software Foundation, Inc.
2716 +// This file is part of the GNU ISO C++ Library. This library is free
2717 +// software; you can redistribute it and/or modify it under the
2718 +// terms of the GNU General Public License as published by the
2719 +// Free Software Foundation; either version 2, or (at your option)
2720 +// any later version.
2722 +// This library is distributed in the hope that it will be useful,
2723 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2724 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2725 +// GNU General Public License for more details.
2727 +// You should have received a copy of the GNU General Public License along
2728 +// with this library; see the file COPYING. If not, write to the Free
2729 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2732 +// As a special exception, you may use this file as part of a free software
2733 +// library without restriction. Specifically, if other files instantiate
2734 +// templates or use macros or inline functions from this file, or you compile
2735 +// this file and link it with other files to produce an executable, this
2736 +// file does not by itself cause the resulting executable to be covered by
2737 +// the GNU General Public License. This exception does not however
2738 +// invalidate any other reasons why the executable file might be covered by
2739 +// the GNU General Public License.
2742 +// ISO C++ 14882: 22.1 Locales
2745 +// Information as gleaned from /usr/include/ctype.h
2749 + // Note: In uClibc, the following two types depend on configuration.
2751 + // Non-standard typedefs.
2752 + typedef const __ctype_touplow_t* __to_type;
2754 + // NB: Offsets into ctype<char>::_M_table force a particular size
2755 + // on the mask type. Because of this, we don't use an enum.
2756 + typedef __ctype_mask_t mask;
2757 + static const mask upper = _ISupper;
2758 + static const mask lower = _ISlower;
2759 + static const mask alpha = _ISalpha;
2760 + static const mask digit = _ISdigit;
2761 + static const mask xdigit = _ISxdigit;
2762 + static const mask space = _ISspace;
2763 + static const mask print = _ISprint;
2764 + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2765 + static const mask cntrl = _IScntrl;
2766 + static const mask punct = _ISpunct;
2767 + static const mask alnum = _ISalpha | _ISdigit;
2769 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
2770 --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
2771 +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2004-08-12 17:08:19.000000000 -0500
2773 +// Locale support -*- C++ -*-
2775 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2777 +// This file is part of the GNU ISO C++ Library. This library is free
2778 +// software; you can redistribute it and/or modify it under the
2779 +// terms of the GNU General Public License as published by the
2780 +// Free Software Foundation; either version 2, or (at your option)
2781 +// any later version.
2783 +// This library is distributed in the hope that it will be useful,
2784 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2785 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2786 +// GNU General Public License for more details.
2788 +// You should have received a copy of the GNU General Public License along
2789 +// with this library; see the file COPYING. If not, write to the Free
2790 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2793 +// As a special exception, you may use this file as part of a free software
2794 +// library without restriction. Specifically, if other files instantiate
2795 +// templates or use macros or inline functions from this file, or you compile
2796 +// this file and link it with other files to produce an executable, this
2797 +// file does not by itself cause the resulting executable to be covered by
2798 +// the GNU General Public License. This exception does not however
2799 +// invalidate any other reasons why the executable file might be covered by
2800 +// the GNU General Public License.
2803 +// ISO C++ 14882: 22.1 Locales
2806 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2807 +// functions go in ctype.cc
2811 + is(mask __m, char __c) const
2812 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2816 + is(const char* __low, const char* __high, mask* __vec) const
2818 + while (__low < __high)
2819 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2825 + scan_is(mask __m, const char* __low, const char* __high) const
2827 + while (__low < __high
2828 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2835 + scan_not(mask __m, const char* __low, const char* __high) const
2837 + while (__low < __high
2838 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2842 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2843 --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
2844 +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-08-12 17:08:19.000000000 -0500
2846 +// Locale support -*- C++ -*-
2848 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
2849 +// Free Software Foundation, Inc.
2851 +// This file is part of the GNU ISO C++ Library. This library is free
2852 +// software; you can redistribute it and/or modify it under the
2853 +// terms of the GNU General Public License as published by the
2854 +// Free Software Foundation; either version 2, or (at your option)
2855 +// any later version.
2857 +// This library is distributed in the hope that it will be useful,
2858 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2859 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2860 +// GNU General Public License for more details.
2862 +// You should have received a copy of the GNU General Public License along
2863 +// with this library; see the file COPYING. If not, write to the Free
2864 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2867 +// As a special exception, you may use this file as part of a free software
2868 +// library without restriction. Specifically, if other files instantiate
2869 +// templates or use macros or inline functions from this file, or you compile
2870 +// this file and link it with other files to produce an executable, this
2871 +// file does not by itself cause the resulting executable to be covered by
2872 +// the GNU General Public License. This exception does not however
2873 +// invalidate any other reasons why the executable file might be covered by
2874 +// the GNU General Public License.
2877 +// ISO C++ 14882: 22.1 Locales
2880 +// Information as gleaned from /usr/include/ctype.h
2882 + const ctype_base::mask*
2883 + ctype<char>::classic_table() throw()
2884 + { return __C_ctype_b; }
2886 + ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
2888 + : facet(__refs), _M_del(__table != 0 && __del)
2890 + _M_c_locale_ctype = _S_clone_c_locale(__cloc);
2891 + _M_toupper = __C_ctype_toupper;
2892 + _M_tolower = __C_ctype_tolower;
2893 + _M_table = __table ? __table : __C_ctype_b;
2894 + memset(_M_widen, 0, sizeof(_M_widen));
2896 + memset(_M_narrow, 0, sizeof(_M_narrow));
2900 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2901 + : facet(__refs), _M_del(__table != 0 && __del)
2903 + _M_c_locale_ctype = _S_get_c_locale();
2904 + _M_toupper = __C_ctype_toupper;
2905 + _M_tolower = __C_ctype_tolower;
2906 + _M_table = __table ? __table : __C_ctype_b;
2907 + memset(_M_widen, 0, sizeof(_M_widen));
2909 + memset(_M_narrow, 0, sizeof(_M_narrow));
2914 + ctype<char>::do_toupper(char __c) const
2915 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2918 + ctype<char>::do_toupper(char* __low, const char* __high) const
2920 + while (__low < __high)
2922 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2929 + ctype<char>::do_tolower(char __c) const
2930 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2933 + ctype<char>::do_tolower(char* __low, const char* __high) const
2935 + while (__low < __high)
2937 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2942 diff -urN gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h
2943 --- gcc-3.4.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
2944 +++ gcc-3.4.0/libstdc++-v3/config/os/uclibc/os_defines.h 2004-08-12 17:08:19.000000000 -0500
2946 +// Specific definitions for GNU/Linux -*- C++ -*-
2948 +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2950 +// This file is part of the GNU ISO C++ Library. This library is free
2951 +// software; you can redistribute it and/or modify it under the
2952 +// terms of the GNU General Public License as published by the
2953 +// Free Software Foundation; either version 2, or (at your option)
2954 +// any later version.
2956 +// This library is distributed in the hope that it will be useful,
2957 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2958 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2959 +// GNU General Public License for more details.
2961 +// You should have received a copy of the GNU General Public License along
2962 +// with this library; see the file COPYING. If not, write to the Free
2963 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2966 +// As a special exception, you may use this file as part of a free software
2967 +// library without restriction. Specifically, if other files instantiate
2968 +// templates or use macros or inline functions from this file, or you compile
2969 +// this file and link it with other files to produce an executable, this
2970 +// file does not by itself cause the resulting executable to be covered by
2971 +// the GNU General Public License. This exception does not however
2972 +// invalidate any other reasons why the executable file might be covered by
2973 +// the GNU General Public License.
2975 +#ifndef _GLIBCXX_OS_DEFINES
2976 +#define _GLIBCXX_OS_DEFINES 1
2978 +// System-specific #define, typedefs, corrections, etc, go here. This
2979 +// file will come before all others.
2981 +// This keeps isanum, et al from being propagated as macros.
2982 +#define __NO_CTYPE 1
2984 +#include <features.h>
2986 +// We must not see the optimized string functions GNU libc defines.
2987 +#define __NO_STRING_INLINES
2990 diff -urN gcc-3.4.0-dist/libstdc++-v3/configure gcc-3.4.0/libstdc++-v3/configure
2991 --- gcc-3.4.0-dist/libstdc++-v3/configure 2004-03-18 11:35:25.000000000 -0600
2992 +++ gcc-3.4.0/libstdc++-v3/configure 2004-08-12 17:08:58.000000000 -0500
2993 @@ -3878,6 +3878,11 @@
2994 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
2998 + lt_cv_deplibs_check_method=pass_all
2999 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
3003 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3004 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3005 @@ -5545,6 +5550,9 @@
3006 # Default to "generic".
3007 if test $enable_clocale_flag = auto; then
3008 case x${target_os} in
3010 + enable_clocale_flag=uclibc
3012 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
3013 cat >conftest.$ac_ext <<_ACEOF
3014 #line $LINENO "configure"
3015 @@ -5759,6 +5767,77 @@
3016 CTIME_CC=config/locale/generic/time_members.cc
3017 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
3020 + echo "$as_me:$LINENO: result: uclibc" >&5
3021 +echo "${ECHO_T}uclibc" >&6
3023 + # Declare intention to use gettext, and add support for specific
3025 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
3026 + ALL_LINGUAS="de fr"
3028 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
3029 + # Extract the first word of "msgfmt", so it can be a program name with args.
3030 +set dummy msgfmt; ac_word=$2
3031 +echo "$as_me:$LINENO: checking for $ac_word" >&5
3032 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3033 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
3034 + echo $ECHO_N "(cached) $ECHO_C" >&6
3036 + if test -n "$check_msgfmt"; then
3037 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
3039 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3040 +for as_dir in $PATH
3043 + test -z "$as_dir" && as_dir=.
3044 + for ac_exec_ext in '' $ac_executable_extensions; do
3045 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3046 + ac_cv_prog_check_msgfmt="yes"
3047 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
3053 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3056 +check_msgfmt=$ac_cv_prog_check_msgfmt
3057 +if test -n "$check_msgfmt"; then
3058 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3059 +echo "${ECHO_T}$check_msgfmt" >&6
3061 + echo "$as_me:$LINENO: result: no" >&5
3062 +echo "${ECHO_T}no" >&6
3065 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3068 + # Export the build objects.
3069 + for ling in $ALL_LINGUAS; do \
3070 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3071 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3076 + CLOCALE_H=config/locale/uclibc/c_locale.h
3077 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
3078 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
3079 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3080 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3081 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3082 + CMESSAGES_H=config/locale/uclibc/messages_members.h
3083 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3084 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
3085 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3086 + CTIME_H=config/locale/uclibc/time_members.h
3087 + CTIME_CC=config/locale/uclibc/time_members.cc
3088 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3092 # This is where the testsuite looks for locale catalogs, using the
3093 diff -urN gcc-3.4.0-dist/libstdc++-v3/configure.host gcc-3.4.0/libstdc++-v3/configure.host
3094 --- gcc-3.4.0-dist/libstdc++-v3/configure.host 2004-03-18 11:36:12.000000000 -0600
3095 +++ gcc-3.4.0/libstdc++-v3/configure.host 2004-08-12 17:08:19.000000000 -0500
3096 @@ -217,6 +217,12 @@
3100 +# Override for uClibc since linux-uclibc gets mishandled above.
3101 +case "${host_os}" in
3103 + os_include_dir="os/uclibc"
3107 # Set any OS-dependent and CPU-dependent bits.
3108 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3109 diff -urN gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 gcc-3.4.0/libstdc++-v3/crossconfig.m4
3110 --- gcc-3.4.0-dist/libstdc++-v3/crossconfig.m4 2004-02-09 01:17:55.000000000 -0600
3111 +++ gcc-3.4.0/libstdc++-v3/crossconfig.m4 2004-08-12 17:08:19.000000000 -0500
3112 @@ -122,6 +122,99 @@
3117 +# Temporary hack until we implement the float versions of the libm funcs
3118 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3119 + machine/endian.h machine/param.h sys/machine.h sys/types.h \
3120 + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3121 + SECTION_FLAGS='-ffunction-sections -fdata-sections'
3122 + AC_SUBST(SECTION_FLAGS)
3123 + GLIBCXX_CHECK_LINKER_FEATURES
3124 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3125 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
3128 + AC_DEFINE(HAVE_INT64_T)
3131 + # Don't enable LFS with uClinux
3134 + AC_DEFINE(_GLIBCXX_USE_LFS)
3137 + # For showmanyc_helper().
3138 + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3139 + GLIBCXX_CHECK_POLL
3140 + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3143 + AC_CHECK_HEADERS(sys/uio.h)
3144 + GLIBCXX_CHECK_WRITEV
3146 +# AC_DEFINE(HAVE_ACOSF)
3147 +# AC_DEFINE(HAVE_ASINF)
3148 +# AC_DEFINE(HAVE_ATANF)
3149 +# AC_DEFINE(HAVE_ATAN2F)
3150 + AC_DEFINE(HAVE_CEILF)
3151 + AC_DEFINE(HAVE_COPYSIGN)
3152 +# AC_DEFINE(HAVE_COPYSIGNF)
3153 +# AC_DEFINE(HAVE_COSF)
3154 +# AC_DEFINE(HAVE_COSHF)
3155 +# AC_DEFINE(HAVE_EXPF)
3156 +# AC_DEFINE(HAVE_FABSF)
3157 + AC_DEFINE(HAVE_FINITE)
3158 + AC_DEFINE(HAVE_FINITEF)
3159 + AC_DEFINE(HAVE_FLOORF)
3160 +# AC_DEFINE(HAVE_FMODF)
3161 +# AC_DEFINE(HAVE_FREXPF)
3162 + AC_DEFINE(HAVE_HYPOT)
3163 +# AC_DEFINE(HAVE_HYPOTF)
3164 + AC_DEFINE(HAVE_ISINF)
3165 + AC_DEFINE(HAVE_ISINFF)
3166 + AC_DEFINE(HAVE_ISNAN)
3167 + AC_DEFINE(HAVE_ISNANF)
3168 +# AC_DEFINE(HAVE_LOGF)
3169 +# AC_DEFINE(HAVE_LOG10F)
3170 +# AC_DEFINE(HAVE_MODFF)
3171 +# AC_DEFINE(HAVE_SINF)
3172 +# AC_DEFINE(HAVE_SINHF)
3173 +# AC_DEFINE(HAVE_SINCOS)
3174 +# AC_DEFINE(HAVE_SINCOSF)
3175 + AC_DEFINE(HAVE_SQRTF)
3176 +# AC_DEFINE(HAVE_TANF)
3177 +# AC_DEFINE(HAVE_TANHF)
3178 + if test x"long_double_math_on_this_cpu" = x"yes"; then
3179 + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3180 +# AC_DEFINE(HAVE_ACOSL)
3181 +# AC_DEFINE(HAVE_ASINL)
3182 +# AC_DEFINE(HAVE_ATANL)
3183 +# AC_DEFINE(HAVE_ATAN2L)
3184 +# AC_DEFINE(HAVE_CEILL)
3185 +# AC_DEFINE(HAVE_COPYSIGNL)
3186 +# AC_DEFINE(HAVE_COSL)
3187 +# AC_DEFINE(HAVE_COSHL)
3188 +# AC_DEFINE(HAVE_EXPL)
3189 +# AC_DEFINE(HAVE_FABSL)
3190 +# AC_DEFINE(HAVE_FINITEL)
3191 +# AC_DEFINE(HAVE_FLOORL)
3192 +# AC_DEFINE(HAVE_FMODL)
3193 +# AC_DEFINE(HAVE_FREXPL)
3194 +# AC_DEFINE(HAVE_HYPOTL)
3195 +# AC_DEFINE(HAVE_ISINFL)
3196 +# AC_DEFINE(HAVE_ISNANL)
3197 +# AC_DEFINE(HAVE_LOGL)
3198 +# AC_DEFINE(HAVE_LOG10L)
3199 +# AC_DEFINE(HAVE_MODFL)
3200 +# AC_DEFINE(HAVE_POWL)
3201 +# AC_DEFINE(HAVE_SINL)
3202 +# AC_DEFINE(HAVE_SINHL)
3203 +# AC_DEFINE(HAVE_SINCOSL)
3204 +# AC_DEFINE(HAVE_SQRTL)
3205 +# AC_DEFINE(HAVE_TANL)
3206 +# AC_DEFINE(HAVE_TANHL)
3209 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3210 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3211 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3213 AC_DEFINE(HAVE_INT64_T)
3216 - # Don't enable LFS with uClibc
3217 + # Don't enable LFS with uClinux
3220 AC_DEFINE(_GLIBCXX_USE_LFS)
3221 diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h
3222 --- gcc-3.4.0-dist/libstdc++-v3/include/c_compatibility/wchar.h 2003-12-08 21:51:45.000000000 -0600
3223 +++ gcc-3.4.0/libstdc++-v3/include/c_compatibility/wchar.h 2004-08-12 17:14:36.000000000 -0500
3226 using std::wmemmove;
3228 +#if __GLIBCXX_HAVE_WCSFTIME
3229 using std::wcsftime;
3232 #if _GLIBCXX_USE_C99
3234 diff -urN gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h
3235 --- gcc-3.4.0-dist/libstdc++-v3/include/c_std/std_cwchar.h 2003-12-08 21:44:35.000000000 -0600
3236 +++ gcc-3.4.0/libstdc++-v3/include/c_std/std_cwchar.h 2004-08-12 17:08:19.000000000 -0500
3241 +#if _GLIBCXX_HAVE_WCSFTIME