1 diff -urN gcc-4.1.0-dist/libstdc++-v3/acinclude.m4 gcc-4.1.0/libstdc++-v3/acinclude.m4
2 --- gcc-4.1.0-dist/libstdc++-v3/acinclude.m4 2006-03-26 12:08:28.000000000 -0700
3 +++ gcc-4.1.0/libstdc++-v3/acinclude.m4 2006-03-25 22:06:30.000000000 -0700
5 AC_MSG_CHECKING([for C locale to use])
6 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
7 [use MODEL for target locale package],
8 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
9 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
11 # If they didn't use this option switch, or if they specified --enable
12 # with no specific model, we'll have to look for one. If they
14 # Default to "generic".
15 if test $enable_clocale_flag = auto; then
18 + enable_clocale_flag=uclibc
20 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
21 AC_EGREP_CPP([_GLIBCXX_ok], [
23 @@ -1230,6 +1233,40 @@
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_CC=config/locale/uclibc/codecvt_members.cc
51 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
52 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
53 + CMESSAGES_H=config/locale/uclibc/messages_members.h
54 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
55 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
56 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
57 + CTIME_H=config/locale/uclibc/time_members.h
58 + CTIME_CC=config/locale/uclibc/time_members.cc
59 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
63 # This is where the testsuite looks for locale catalogs, using the
64 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
65 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 17:00:00.000000000 -0700
66 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2006-03-25 22:18:37.000000000 -0700
68 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
70 +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
72 +// This file is part of the GNU ISO C++ Library. This library is free
73 +// software; you can redistribute it and/or modify it under the
74 +// terms of the GNU General Public License as published by the
75 +// Free Software Foundation; either version 2, or (at your option)
76 +// any later version.
78 +// This library is distributed in the hope that it will be useful,
79 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
80 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
81 +// GNU General Public License for more details.
83 +// You should have received a copy of the GNU General Public License along
84 +// with this library; see the file COPYING. If not, write to the Free
85 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
88 +// As a special exception, you may use this file as part of a free software
89 +// library without restriction. Specifically, if other files instantiate
90 +// templates or use macros or inline functions from this file, or you compile
91 +// this file and link it with other files to produce an executable, this
92 +// file does not by itself cause the resulting executable to be covered by
93 +// the GNU General Public License. This exception does not however
94 +// invalidate any other reasons why the executable file might be covered by
95 +// the GNU General Public License.
97 +// Written by Jakub Jelinek <jakub@redhat.com>
99 +#include <bits/c++config.h>
102 +#ifdef __UCLIBC_MJN3_ONLY__
103 +#warning clean this up
106 +#ifdef __UCLIBC_HAS_XLOCALE__
108 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
109 +extern "C" __typeof(strcoll_l) __strcoll_l;
110 +extern "C" __typeof(strftime_l) __strftime_l;
111 +extern "C" __typeof(strtod_l) __strtod_l;
112 +extern "C" __typeof(strtof_l) __strtof_l;
113 +extern "C" __typeof(strtold_l) __strtold_l;
114 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
115 +extern "C" __typeof(newlocale) __newlocale;
116 +extern "C" __typeof(freelocale) __freelocale;
117 +extern "C" __typeof(duplocale) __duplocale;
118 +extern "C" __typeof(uselocale) __uselocale;
120 +#ifdef _GLIBCXX_USE_WCHAR_T
121 +extern "C" __typeof(iswctype_l) __iswctype_l;
122 +extern "C" __typeof(towlower_l) __towlower_l;
123 +extern "C" __typeof(towupper_l) __towupper_l;
124 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
125 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
126 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
127 +extern "C" __typeof(wctype_l) __wctype_l;
130 +#endif // GLIBC 2.3 and later
131 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
132 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 17:00:00.000000000 -0700
133 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2006-03-25 22:18:37.000000000 -0700
135 +// Wrapper for underlying C-language localization -*- C++ -*-
137 +// Copyright (C) 2001, 2002, 2003, 2004, 2005
138 +// Free Software Foundation, Inc.
140 +// This file is part of the GNU ISO C++ Library. This library is free
141 +// software; you can redistribute it and/or modify it under the
142 +// terms of the GNU General Public License as published by the
143 +// Free Software Foundation; either version 2, or (at your option)
144 +// any later version.
146 +// This library is distributed in the hope that it will be useful,
147 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
148 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
149 +// GNU General Public License for more details.
151 +// You should have received a copy of the GNU General Public License along
152 +// with this library; see the file COPYING. If not, write to the Free
153 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
156 +// As a special exception, you may use this file as part of a free software
157 +// library without restriction. Specifically, if other files instantiate
158 +// templates or use macros or inline functions from this file, or you compile
159 +// this file and link it with other files to produce an executable, this
160 +// file does not by itself cause the resulting executable to be covered by
161 +// the GNU General Public License. This exception does not however
162 +// invalidate any other reasons why the executable file might be covered by
163 +// the GNU General Public License.
166 +// ISO C++ 14882: 22.8 Standard locale categories.
169 +// Written by Benjamin Kosnik <bkoz@redhat.com>
171 +#include <cerrno> // For errno
173 +#include <stdexcept>
174 +#include <langinfo.h>
175 +#include <bits/c++locale_internal.h>
177 +#ifndef __UCLIBC_HAS_XLOCALE__
178 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
179 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
180 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
181 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
182 +#define __strtof_l(S, E, L) strtof((S), (E))
183 +#define __strtod_l(S, E, L) strtod((S), (E))
184 +#define __strtold_l(S, E, L) strtold((S), (E))
185 +#warning should dummy __newlocale check for C|POSIX ?
186 +#define __newlocale(a, b, c) NULL
187 +#define __freelocale(a) ((void)0)
188 +#define __duplocale(a) __c_locale()
195 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
196 + const __c_locale& __cloc)
200 + float __f = __strtof_l(__s, &__sanity, __cloc);
201 + if (__sanity != __s && errno != ERANGE)
204 + __err |= ios_base::failbit;
209 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
210 + const __c_locale& __cloc)
214 + double __d = __strtod_l(__s, &__sanity, __cloc);
215 + if (__sanity != __s && errno != ERANGE)
218 + __err |= ios_base::failbit;
223 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
224 + const __c_locale& __cloc)
228 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
229 + if (__sanity != __s && errno != ERANGE)
232 + __err |= ios_base::failbit;
236 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
239 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
240 +#ifdef __UCLIBC_HAS_XLOCALE__
243 + // This named locale is not supported by the underlying OS.
244 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
245 + "name not valid"));
251 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
253 + if (__cloc && _S_get_c_locale() != __cloc)
254 + __freelocale(__cloc);
258 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
259 + { return __duplocale(__cloc); }
264 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
272 +#if _GLIBCXX_NUM_CATEGORIES != 0
278 + "LC_IDENTIFICATION"
285 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
287 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h
288 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 17:00:00.000000000 -0700
289 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2006-03-26 13:03:42.000000000 -0700
291 +// Wrapper for underlying C-language localization -*- C++ -*-
293 +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
295 +// This file is part of the GNU ISO C++ Library. This library is free
296 +// software; you can redistribute it and/or modify it under the
297 +// terms of the GNU General Public License as published by the
298 +// Free Software Foundation; either version 2, or (at your option)
299 +// any later version.
301 +// This library is distributed in the hope that it will be useful,
302 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
303 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 +// GNU General Public License for more details.
306 +// You should have received a copy of the GNU General Public License along
307 +// with this library; see the file COPYING. If not, write to the Free
308 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
311 +// As a special exception, you may use this file as part of a free software
312 +// library without restriction. Specifically, if other files instantiate
313 +// templates or use macros or inline functions from this file, or you compile
314 +// this file and link it with other files to produce an executable, this
315 +// file does not by itself cause the resulting executable to be covered by
316 +// the GNU General Public License. This exception does not however
317 +// invalidate any other reasons why the executable file might be covered by
318 +// the GNU General Public License.
321 +// ISO C++ 14882: 22.8 Standard locale categories.
324 +// Written by Benjamin Kosnik <bkoz@redhat.com>
327 +#define _C_LOCALE_H 1
329 +#pragma GCC system_header
331 +#include <cstring> // get std::strlen
332 +#include <cstdio> // get std::snprintf or std::sprintf
334 +#include <langinfo.h> // For codecvt
335 +#ifdef __UCLIBC_MJN3_ONLY__
338 +#ifdef __UCLIBC_HAS_LOCALE__
339 +#include <iconv.h> // For codecvt using iconv, iconv_t
341 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
342 +#include <libintl.h> // For messages
345 +#ifdef __UCLIBC_MJN3_ONLY__
346 +#warning what is _GLIBCXX_C_LOCALE_GNU for
348 +#define _GLIBCXX_C_LOCALE_GNU 1
350 +#ifdef __UCLIBC_MJN3_ONLY__
351 +#warning fix categories
353 +// #define _GLIBCXX_NUM_CATEGORIES 6
354 +#define _GLIBCXX_NUM_CATEGORIES 0
356 +#ifdef __UCLIBC_HAS_XLOCALE__
359 + extern "C" __typeof(uselocale) __uselocale;
365 +#ifdef __UCLIBC_HAS_XLOCALE__
366 + typedef __locale_t __c_locale;
368 + typedef int* __c_locale;
371 + // Convert numeric value of type _Tv to string and return length of
372 + // string. If snprintf is available use it, otherwise fall back to
373 + // the unsafe sprintf which, in general, can be dangerous and should
375 + template<typename _Tv>
377 + __convert_from_v(char* __out,
378 + const int __size __attribute__ ((__unused__)),
380 +#ifdef __UCLIBC_HAS_XLOCALE__
381 + _Tv __v, const __c_locale& __cloc, int __prec)
383 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
385 + _Tv __v, const __c_locale&, int __prec)
387 +# ifdef __UCLIBC_HAS_LOCALE__
388 + char* __old = std::setlocale(LC_ALL, NULL);
389 + char* __sav = new char[std::strlen(__old) + 1];
390 + std::strcpy(__sav, __old);
391 + std::setlocale(LC_ALL, "C");
395 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
397 +#ifdef __UCLIBC_HAS_XLOCALE__
398 + __gnu_cxx::__uselocale(__old);
399 +#elif defined __UCLIBC_HAS_LOCALE__
400 + std::setlocale(LC_ALL, __sav);
408 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
409 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 17:00:00.000000000 -0700
410 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2006-03-25 22:18:37.000000000 -0700
412 +// std::codecvt implementation details, GNU version -*- C++ -*-
414 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
416 +// This file is part of the GNU ISO C++ Library. This library is free
417 +// software; you can redistribute it and/or modify it under the
418 +// terms of the GNU General Public License as published by the
419 +// Free Software Foundation; either version 2, or (at your option)
420 +// any later version.
422 +// This library is distributed in the hope that it will be useful,
423 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
424 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
425 +// GNU General Public License for more details.
427 +// You should have received a copy of the GNU General Public License along
428 +// with this library; see the file COPYING. If not, write to the Free
429 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
432 +// As a special exception, you may use this file as part of a free software
433 +// library without restriction. Specifically, if other files instantiate
434 +// templates or use macros or inline functions from this file, or you compile
435 +// this file and link it with other files to produce an executable, this
436 +// file does not by itself cause the resulting executable to be covered by
437 +// the GNU General Public License. This exception does not however
438 +// invalidate any other reasons why the executable file might be covered by
439 +// the GNU General Public License.
442 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
445 +// Written by Benjamin Kosnik <bkoz@redhat.com>
448 +#include <bits/c++locale_internal.h>
452 + // Specializations.
453 +#ifdef _GLIBCXX_USE_WCHAR_T
454 + codecvt_base::result
455 + codecvt<wchar_t, char, mbstate_t>::
456 + do_out(state_type& __state, const intern_type* __from,
457 + const intern_type* __from_end, const intern_type*& __from_next,
458 + extern_type* __to, extern_type* __to_end,
459 + extern_type*& __to_next) const
462 + state_type __tmp_state(__state);
464 +#ifdef __UCLIBC_HAS_XLOCALE__
465 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
468 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
469 + // in case we fall back to wcrtomb and then continue, in a loop.
470 + // NB: wcsnrtombs is a GNU extension
471 + for (__from_next = __from, __to_next = __to;
472 + __from_next < __from_end && __to_next < __to_end
475 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
476 + __from_end - __from_next);
477 + if (!__from_chunk_end)
478 + __from_chunk_end = __from_end;
480 + __from = __from_next;
481 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
482 + __from_chunk_end - __from_next,
483 + __to_end - __to_next, &__state);
484 + if (__conv == static_cast<size_t>(-1))
486 + // In case of error, in order to stop at the exact place we
487 + // have to start again from the beginning with a series of
489 + for (; __from < __from_next; ++__from)
490 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
491 + __state = __tmp_state;
494 + else if (__from_next && __from_next < __from_chunk_end)
496 + __to_next += __conv;
501 + __from_next = __from_chunk_end;
502 + __to_next += __conv;
505 + if (__from_next < __from_end && __ret == ok)
507 + extern_type __buf[MB_LEN_MAX];
508 + __tmp_state = __state;
509 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
510 + if (__conv > static_cast<size_t>(__to_end - __to_next))
514 + memcpy(__to_next, __buf, __conv);
515 + __state = __tmp_state;
516 + __to_next += __conv;
522 +#ifdef __UCLIBC_HAS_XLOCALE__
523 + __uselocale(__old);
529 + codecvt_base::result
530 + codecvt<wchar_t, char, mbstate_t>::
531 + do_in(state_type& __state, const extern_type* __from,
532 + const extern_type* __from_end, const extern_type*& __from_next,
533 + intern_type* __to, intern_type* __to_end,
534 + intern_type*& __to_next) const
537 + state_type __tmp_state(__state);
539 +#ifdef __UCLIBC_HAS_XLOCALE__
540 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
543 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
544 + // in case we store a L'\0' and then continue, in a loop.
545 + // NB: mbsnrtowcs is a GNU extension
546 + for (__from_next = __from, __to_next = __to;
547 + __from_next < __from_end && __to_next < __to_end
550 + const extern_type* __from_chunk_end;
551 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
554 + if (!__from_chunk_end)
555 + __from_chunk_end = __from_end;
557 + __from = __from_next;
558 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
559 + __from_chunk_end - __from_next,
560 + __to_end - __to_next, &__state);
561 + if (__conv == static_cast<size_t>(-1))
563 + // In case of error, in order to stop at the exact place we
564 + // have to start again from the beginning with a series of
566 + for (;; ++__to_next, __from += __conv)
568 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
570 + if (__conv == static_cast<size_t>(-1)
571 + || __conv == static_cast<size_t>(-2))
574 + __from_next = __from;
575 + __state = __tmp_state;
578 + else if (__from_next && __from_next < __from_chunk_end)
580 + // It is unclear what to return in this case (see DR 382).
581 + __to_next += __conv;
586 + __from_next = __from_chunk_end;
587 + __to_next += __conv;
590 + if (__from_next < __from_end && __ret == ok)
592 + if (__to_next < __to_end)
594 + // XXX Probably wrong for stateful encodings
595 + __tmp_state = __state;
597 + *__to_next++ = L'\0';
604 +#ifdef __UCLIBC_HAS_XLOCALE__
605 + __uselocale(__old);
612 + codecvt<wchar_t, char, mbstate_t>::
613 + do_encoding() const throw()
615 + // XXX This implementation assumes that the encoding is
616 + // stateless and is either single-byte or variable-width.
618 +#ifdef __UCLIBC_HAS_XLOCALE__
619 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
621 + if (MB_CUR_MAX == 1)
623 +#ifdef __UCLIBC_HAS_XLOCALE__
624 + __uselocale(__old);
630 + codecvt<wchar_t, char, mbstate_t>::
631 + do_max_length() const throw()
633 +#ifdef __UCLIBC_HAS_XLOCALE__
634 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
636 + // XXX Probably wrong for stateful encodings.
637 + int __ret = MB_CUR_MAX;
638 +#ifdef __UCLIBC_HAS_XLOCALE__
639 + __uselocale(__old);
645 + codecvt<wchar_t, char, mbstate_t>::
646 + do_length(state_type& __state, const extern_type* __from,
647 + const extern_type* __end, size_t __max) const
650 + state_type __tmp_state(__state);
652 +#ifdef __UCLIBC_HAS_XLOCALE__
653 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
656 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
657 + // in case we advance past it and then continue, in a loop.
658 + // NB: mbsnrtowcs is a GNU extension
660 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
661 + // its fourth parameter (it wouldn't with NULL as first parameter).
662 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
664 + while (__from < __end && __max)
666 + const extern_type* __from_chunk_end;
667 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
670 + if (!__from_chunk_end)
671 + __from_chunk_end = __end;
673 + const extern_type* __tmp_from = __from;
674 + size_t __conv = mbsnrtowcs(__to, &__from,
675 + __from_chunk_end - __from,
677 + if (__conv == static_cast<size_t>(-1))
679 + // In case of error, in order to stop at the exact place we
680 + // have to start again from the beginning with a series of
682 + for (__from = __tmp_from;; __from += __conv)
684 + __conv = mbrtowc(NULL, __from, __end - __from,
686 + if (__conv == static_cast<size_t>(-1)
687 + || __conv == static_cast<size_t>(-2))
690 + __state = __tmp_state;
691 + __ret += __from - __tmp_from;
695 + __from = __from_chunk_end;
697 + __ret += __from - __tmp_from;
700 + if (__from < __end && __max)
702 + // XXX Probably wrong for stateful encodings
703 + __tmp_state = __state;
710 +#ifdef __UCLIBC_HAS_XLOCALE__
711 + __uselocale(__old);
718 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
719 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 17:00:00.000000000 -0700
720 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2006-03-25 22:18:37.000000000 -0700
722 +// std::collate implementation details, GNU version -*- C++ -*-
724 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
726 +// This file is part of the GNU ISO C++ Library. This library is free
727 +// software; you can redistribute it and/or modify it under the
728 +// terms of the GNU General Public License as published by the
729 +// Free Software Foundation; either version 2, or (at your option)
730 +// any later version.
732 +// This library is distributed in the hope that it will be useful,
733 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
734 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
735 +// GNU General Public License for more details.
737 +// You should have received a copy of the GNU General Public License along
738 +// with this library; see the file COPYING. If not, write to the Free
739 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
742 +// As a special exception, you may use this file as part of a free software
743 +// library without restriction. Specifically, if other files instantiate
744 +// templates or use macros or inline functions from this file, or you compile
745 +// this file and link it with other files to produce an executable, this
746 +// file does not by itself cause the resulting executable to be covered by
747 +// the GNU General Public License. This exception does not however
748 +// invalidate any other reasons why the executable file might be covered by
749 +// the GNU General Public License.
752 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
755 +// Written by Benjamin Kosnik <bkoz@redhat.com>
758 +#include <bits/c++locale_internal.h>
760 +#ifndef __UCLIBC_HAS_XLOCALE__
761 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
762 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
763 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
764 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
769 + // These are basically extensions to char_traits, and perhaps should
770 + // be put there instead of here.
773 + collate<char>::_M_compare(const char* __one, const char* __two) const
775 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
776 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
781 + collate<char>::_M_transform(char* __to, const char* __from,
783 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
785 +#ifdef _GLIBCXX_USE_WCHAR_T
788 + collate<wchar_t>::_M_compare(const wchar_t* __one,
789 + const wchar_t* __two) const
791 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
792 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
797 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
799 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
802 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
803 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 17:00:00.000000000 -0700
804 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2006-03-25 22:18:37.000000000 -0700
806 +// std::ctype implementation details, GNU version -*- C++ -*-
808 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
810 +// This file is part of the GNU ISO C++ Library. This library is free
811 +// software; you can redistribute it and/or modify it under the
812 +// terms of the GNU General Public License as published by the
813 +// Free Software Foundation; either version 2, or (at your option)
814 +// any later version.
816 +// This library is distributed in the hope that it will be useful,
817 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
818 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
819 +// GNU General Public License for more details.
821 +// You should have received a copy of the GNU General Public License along
822 +// with this library; see the file COPYING. If not, write to the Free
823 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
826 +// As a special exception, you may use this file as part of a free software
827 +// library without restriction. Specifically, if other files instantiate
828 +// templates or use macros or inline functions from this file, or you compile
829 +// this file and link it with other files to produce an executable, this
830 +// file does not by itself cause the resulting executable to be covered by
831 +// the GNU General Public License. This exception does not however
832 +// invalidate any other reasons why the executable file might be covered by
833 +// the GNU General Public License.
836 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
839 +// Written by Benjamin Kosnik <bkoz@redhat.com>
844 +#include <bits/c++locale_internal.h>
846 +#ifndef __UCLIBC_HAS_XLOCALE__
847 +#define __wctype_l(S, L) wctype((S))
848 +#define __towupper_l(C, L) towupper((C))
849 +#define __towlower_l(C, L) towlower((C))
850 +#define __iswctype_l(C, M, L) iswctype((C), (M))
855 + // NB: The other ctype<char> specializations are in src/locale.cc and
856 + // various /config/os/* files.
858 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
859 + : ctype<char>(0, false, __refs)
861 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
863 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
864 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
865 +#ifdef __UCLIBC_HAS_XLOCALE__
866 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
867 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
868 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
873 +#ifdef _GLIBCXX_USE_WCHAR_T
874 + ctype<wchar_t>::__wmask_type
875 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
877 + __wmask_type __ret;
881 + __ret = __wctype_l("space", _M_c_locale_ctype);
884 + __ret = __wctype_l("print", _M_c_locale_ctype);
887 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
890 + __ret = __wctype_l("upper", _M_c_locale_ctype);
893 + __ret = __wctype_l("lower", _M_c_locale_ctype);
896 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
899 + __ret = __wctype_l("digit", _M_c_locale_ctype);
902 + __ret = __wctype_l("punct", _M_c_locale_ctype);
905 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
908 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
911 + __ret = __wctype_l("graph", _M_c_locale_ctype);
914 + __ret = __wmask_type();
920 + ctype<wchar_t>::do_toupper(wchar_t __c) const
921 + { return __towupper_l(__c, _M_c_locale_ctype); }
924 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
926 + while (__lo < __hi)
928 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
935 + ctype<wchar_t>::do_tolower(wchar_t __c) const
936 + { return __towlower_l(__c, _M_c_locale_ctype); }
939 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
941 + while (__lo < __hi)
943 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
951 + do_is(mask __m, wchar_t __c) const
953 + // The case of __m == ctype_base::space is particularly important,
954 + // due to its use in many istream functions. Therefore we deal with
955 + // it first, exploiting the knowledge that on GNU systems _M_bit[5]
956 + // is the mask corresponding to ctype_base::space. NB: an encoding
957 + // change would not affect correctness!
958 + bool __ret = false;
959 + if (__m == _M_bit[5])
960 + __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
963 + // Highest bitmask in ctype_base == 10, but extra in "C"
964 + // library for blank.
965 + const size_t __bitmasksize = 11;
966 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
967 + if (__m & _M_bit[__bitcur])
969 + if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
974 + else if (__m == _M_bit[__bitcur])
983 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
985 + for (; __lo < __hi; ++__vec, ++__lo)
987 + // Highest bitmask in ctype_base == 10, but extra in "C"
988 + // library for blank.
989 + const size_t __bitmasksize = 11;
991 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
992 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
993 + __m |= _M_bit[__bitcur];
1001 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1003 + while (__lo < __hi && !this->do_is(__m, *__lo))
1010 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1012 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1019 + do_widen(char __c) const
1020 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1024 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1026 + while (__lo < __hi)
1028 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1037 + do_narrow(wchar_t __wc, char __dfault) const
1039 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1040 + return _M_narrow[__wc];
1041 +#ifdef __UCLIBC_HAS_XLOCALE__
1042 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1044 + const int __c = wctob(__wc);
1045 +#ifdef __UCLIBC_HAS_XLOCALE__
1046 + __uselocale(__old);
1048 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1053 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1054 + char* __dest) const
1056 +#ifdef __UCLIBC_HAS_XLOCALE__
1057 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1060 + while (__lo < __hi)
1062 + if (*__lo >= 0 && *__lo < 128)
1063 + *__dest = _M_narrow[*__lo];
1066 + const int __c = wctob(*__lo);
1067 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1073 + while (__lo < __hi)
1075 + const int __c = wctob(*__lo);
1076 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1080 +#ifdef __UCLIBC_HAS_XLOCALE__
1081 + __uselocale(__old);
1087 + ctype<wchar_t>::_M_initialize_ctype()
1089 +#ifdef __UCLIBC_HAS_XLOCALE__
1090 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1093 + for (__i = 0; __i < 128; ++__i)
1095 + const int __c = wctob(__i);
1099 + _M_narrow[__i] = static_cast<char>(__c);
1102 + _M_narrow_ok = true;
1104 + _M_narrow_ok = false;
1105 + for (size_t __j = 0;
1106 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1107 + _M_widen[__j] = btowc(__j);
1109 + for (size_t __k = 0; __k <= 11; ++__k)
1111 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1112 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1114 +#ifdef __UCLIBC_HAS_XLOCALE__
1115 + __uselocale(__old);
1118 +#endif // _GLIBCXX_USE_WCHAR_T
1120 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
1121 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 17:00:00.000000000 -0700
1122 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2006-03-25 22:18:37.000000000 -0700
1124 +// std::messages implementation details, GNU version -*- C++ -*-
1126 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1128 +// This file is part of the GNU ISO C++ Library. This library is free
1129 +// software; you can redistribute it and/or modify it under the
1130 +// terms of the GNU General Public License as published by the
1131 +// Free Software Foundation; either version 2, or (at your option)
1132 +// any later version.
1134 +// This library is distributed in the hope that it will be useful,
1135 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1136 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1137 +// GNU General Public License for more details.
1139 +// You should have received a copy of the GNU General Public License along
1140 +// with this library; see the file COPYING. If not, write to the Free
1141 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1144 +// As a special exception, you may use this file as part of a free software
1145 +// library without restriction. Specifically, if other files instantiate
1146 +// templates or use macros or inline functions from this file, or you compile
1147 +// this file and link it with other files to produce an executable, this
1148 +// file does not by itself cause the resulting executable to be covered by
1149 +// the GNU General Public License. This exception does not however
1150 +// invalidate any other reasons why the executable file might be covered by
1151 +// the GNU General Public License.
1154 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1157 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1160 +#include <bits/c++locale_internal.h>
1162 +#ifdef __UCLIBC_MJN3_ONLY__
1163 +#warning fix gettext stuff
1165 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1166 +extern "C" char *__dcgettext(const char *domainname,
1167 + const char *msgid, int category);
1169 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1172 +#define gettext(msgid) (msgid)
1177 + // Specializations.
1180 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1182 +#ifdef __UCLIBC_HAS_XLOCALE__
1183 + __c_locale __old = __uselocale(_M_c_locale_messages);
1184 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1185 + __uselocale(__old);
1186 + return string(__msg);
1187 +#elif defined __UCLIBC_HAS_LOCALE__
1188 + char* __old = strdup(setlocale(LC_ALL, NULL));
1189 + setlocale(LC_ALL, _M_name_messages);
1190 + const char* __msg = gettext(__dfault.c_str());
1191 + setlocale(LC_ALL, __old);
1193 + return string(__msg);
1195 + const char* __msg = gettext(__dfault.c_str());
1196 + return string(__msg);
1200 +#ifdef _GLIBCXX_USE_WCHAR_T
1203 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1205 +# ifdef __UCLIBC_HAS_XLOCALE__
1206 + __c_locale __old = __uselocale(_M_c_locale_messages);
1207 + char* __msg = gettext(_M_convert_to_char(__dfault));
1208 + __uselocale(__old);
1209 + return _M_convert_from_char(__msg);
1210 +# elif defined __UCLIBC_HAS_LOCALE__
1211 + char* __old = strdup(setlocale(LC_ALL, NULL));
1212 + setlocale(LC_ALL, _M_name_messages);
1213 + char* __msg = gettext(_M_convert_to_char(__dfault));
1214 + setlocale(LC_ALL, __old);
1216 + return _M_convert_from_char(__msg);
1218 + char* __msg = gettext(_M_convert_to_char(__dfault));
1219 + return _M_convert_from_char(__msg);
1224 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h
1225 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 17:00:00.000000000 -0700
1226 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2006-03-25 22:18:37.000000000 -0700
1228 +// std::messages implementation details, GNU version -*- C++ -*-
1230 +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
1232 +// This file is part of the GNU ISO C++ Library. This library is free
1233 +// software; you can redistribute it and/or modify it under the
1234 +// terms of the GNU General Public License as published by the
1235 +// Free Software Foundation; either version 2, or (at your option)
1236 +// any later version.
1238 +// This library is distributed in the hope that it will be useful,
1239 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1240 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1241 +// GNU General Public License for more details.
1243 +// You should have received a copy of the GNU General Public License along
1244 +// with this library; see the file COPYING. If not, write to the Free
1245 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1248 +// As a special exception, you may use this file as part of a free software
1249 +// library without restriction. Specifically, if other files instantiate
1250 +// templates or use macros or inline functions from this file, or you compile
1251 +// this file and link it with other files to produce an executable, this
1252 +// file does not by itself cause the resulting executable to be covered by
1253 +// the GNU General Public License. This exception does not however
1254 +// invalidate any other reasons why the executable file might be covered by
1255 +// the GNU General Public License.
1258 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1261 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1263 +#ifdef __UCLIBC_MJN3_ONLY__
1264 +#warning fix prototypes for *textdomain funcs
1266 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1267 +extern "C" char *__textdomain(const char *domainname);
1268 +extern "C" char *__bindtextdomain(const char *domainname,
1269 + const char *dirname);
1271 +#undef __textdomain
1272 +#undef __bindtextdomain
1273 +#define __textdomain(D) ((void)0)
1274 +#define __bindtextdomain(D,P) ((void)0)
1277 + // Non-virtual member functions.
1278 + template<typename _CharT>
1279 + messages<_CharT>::messages(size_t __refs)
1280 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1281 + _M_name_messages(_S_get_c_name())
1284 + template<typename _CharT>
1285 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1287 + : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
1289 + const size_t __len = std::strlen(__s) + 1;
1290 + char* __tmp = new char[__len];
1291 + std::memcpy(__tmp, __s, __len);
1292 + _M_name_messages = __tmp;
1294 + // Last to avoid leaking memory if new throws.
1295 + _M_c_locale_messages = _S_clone_c_locale(__cloc);
1298 + template<typename _CharT>
1299 + typename messages<_CharT>::catalog
1300 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1301 + const char* __dir) const
1303 + __bindtextdomain(__s.c_str(), __dir);
1304 + return this->do_open(__s, __loc);
1307 + // Virtual member functions.
1308 + template<typename _CharT>
1309 + messages<_CharT>::~messages()
1311 + if (_M_name_messages != _S_get_c_name())
1312 + delete [] _M_name_messages;
1313 + _S_destroy_c_locale(_M_c_locale_messages);
1316 + template<typename _CharT>
1317 + typename messages<_CharT>::catalog
1318 + messages<_CharT>::do_open(const basic_string<char>& __s,
1319 + const locale&) const
1321 + // No error checking is done, assume the catalog exists and can
1323 + __textdomain(__s.c_str());
1327 + template<typename _CharT>
1329 + messages<_CharT>::do_close(catalog) const
1332 + // messages_byname
1333 + template<typename _CharT>
1334 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1335 + : messages<_CharT>(__refs)
1337 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1338 + delete [] this->_M_name_messages;
1339 + char* __tmp = new char[std::strlen(__s) + 1];
1340 + std::strcpy(__tmp, __s);
1341 + this->_M_name_messages = __tmp;
1343 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1345 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1346 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1349 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1350 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 17:00:00.000000000 -0700
1351 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2006-03-25 22:18:37.000000000 -0700
1353 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1355 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1357 +// This file is part of the GNU ISO C++ Library. This library is free
1358 +// software; you can redistribute it and/or modify it under the
1359 +// terms of the GNU General Public License as published by the
1360 +// Free Software Foundation; either version 2, or (at your option)
1361 +// any later version.
1363 +// This library is distributed in the hope that it will be useful,
1364 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1365 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1366 +// GNU General Public License for more details.
1368 +// You should have received a copy of the GNU General Public License along
1369 +// with this library; see the file COPYING. If not, write to the Free
1370 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
1373 +// As a special exception, you may use this file as part of a free software
1374 +// library without restriction. Specifically, if other files instantiate
1375 +// templates or use macros or inline functions from this file, or you compile
1376 +// this file and link it with other files to produce an executable, this
1377 +// file does not by itself cause the resulting executable to be covered by
1378 +// the GNU General Public License. This exception does not however
1379 +// invalidate any other reasons why the executable file might be covered by
1380 +// the GNU General Public License.
1383 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1386 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1391 +#include <bits/c++locale_internal.h>
1393 +#ifdef __UCLIBC_MJN3_ONLY__
1394 +#warning optimize this for uclibc
1395 +#warning tailor for stub locale support
1398 +#ifndef __UCLIBC_HAS_XLOCALE__
1399 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1404 + // Construct and return valid pattern consisting of some combination of:
1405 + // space none symbol sign value
1406 + money_base::pattern
1407 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1411 + // This insanely complicated routine attempts to construct a valid
1412 + // pattern for use with monyepunct. A couple of invariants:
1414 + // if (__precedes) symbol -> value
1415 + // else value -> symbol
1417 + // if (__space) space
1420 + // none == never first
1421 + // space never first or last
1423 + // Any elegant implementations of this are welcome.
1428 + // 1 The sign precedes the value and symbol.
1429 + __ret.field[0] = sign;
1432 + // Pattern starts with sign.
1435 + __ret.field[1] = symbol;
1436 + __ret.field[3] = value;
1440 + __ret.field[1] = value;
1441 + __ret.field[3] = symbol;
1443 + __ret.field[2] = space;
1447 + // Pattern starts with sign and ends with none.
1450 + __ret.field[1] = symbol;
1451 + __ret.field[2] = value;
1455 + __ret.field[1] = value;
1456 + __ret.field[2] = symbol;
1458 + __ret.field[3] = none;
1462 + // 2 The sign follows the value and symbol.
1465 + // Pattern either ends with sign.
1468 + __ret.field[0] = symbol;
1469 + __ret.field[2] = value;
1473 + __ret.field[0] = value;
1474 + __ret.field[2] = symbol;
1476 + __ret.field[1] = space;
1477 + __ret.field[3] = sign;
1481 + // Pattern ends with sign then none.
1484 + __ret.field[0] = symbol;
1485 + __ret.field[1] = value;
1489 + __ret.field[0] = value;
1490 + __ret.field[1] = symbol;
1492 + __ret.field[2] = sign;
1493 + __ret.field[3] = none;
1497 + // 3 The sign immediately precedes the symbol.
1500 + __ret.field[0] = sign;
1501 + __ret.field[1] = symbol;
1504 + __ret.field[2] = space;
1505 + __ret.field[3] = value;
1509 + __ret.field[2] = value;
1510 + __ret.field[3] = none;
1515 + __ret.field[0] = value;
1518 + __ret.field[1] = space;
1519 + __ret.field[2] = sign;
1520 + __ret.field[3] = symbol;
1524 + __ret.field[1] = sign;
1525 + __ret.field[2] = symbol;
1526 + __ret.field[3] = none;
1531 + // 4 The sign immediately follows the symbol.
1534 + __ret.field[0] = symbol;
1535 + __ret.field[1] = sign;
1538 + __ret.field[2] = space;
1539 + __ret.field[3] = value;
1543 + __ret.field[2] = value;
1544 + __ret.field[3] = none;
1549 + __ret.field[0] = value;
1552 + __ret.field[1] = space;
1553 + __ret.field[2] = symbol;
1554 + __ret.field[3] = sign;
1558 + __ret.field[1] = symbol;
1559 + __ret.field[2] = sign;
1560 + __ret.field[3] = none;
1565 + __ret = pattern();
1572 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1576 + _M_data = new __moneypunct_cache<char, true>;
1581 + _M_data->_M_decimal_point = '.';
1582 + _M_data->_M_thousands_sep = ',';
1583 + _M_data->_M_grouping = "";
1584 + _M_data->_M_grouping_size = 0;
1585 + _M_data->_M_curr_symbol = "";
1586 + _M_data->_M_curr_symbol_size = 0;
1587 + _M_data->_M_positive_sign = "";
1588 + _M_data->_M_positive_sign_size = 0;
1589 + _M_data->_M_negative_sign = "";
1590 + _M_data->_M_negative_sign_size = 0;
1591 + _M_data->_M_frac_digits = 0;
1592 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1593 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1595 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1596 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1601 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1603 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1605 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1606 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1607 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1608 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1610 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1612 + _M_data->_M_negative_sign = "()";
1614 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1616 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1619 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1620 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1621 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1623 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1624 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1625 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1626 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1628 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1629 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1630 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1637 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1641 + _M_data = new __moneypunct_cache<char, false>;
1646 + _M_data->_M_decimal_point = '.';
1647 + _M_data->_M_thousands_sep = ',';
1648 + _M_data->_M_grouping = "";
1649 + _M_data->_M_grouping_size = 0;
1650 + _M_data->_M_curr_symbol = "";
1651 + _M_data->_M_curr_symbol_size = 0;
1652 + _M_data->_M_positive_sign = "";
1653 + _M_data->_M_positive_sign_size = 0;
1654 + _M_data->_M_negative_sign = "";
1655 + _M_data->_M_negative_sign_size = 0;
1656 + _M_data->_M_frac_digits = 0;
1657 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1658 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1660 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1661 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1666 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1668 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1670 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1671 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1672 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1673 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1675 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1677 + _M_data->_M_negative_sign = "()";
1679 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1681 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1684 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1685 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1686 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1687 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1688 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1689 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1690 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1692 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1693 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1694 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1700 + moneypunct<char, true>::~moneypunct()
1701 + { delete _M_data; }
1704 + moneypunct<char, false>::~moneypunct()
1705 + { delete _M_data; }
1707 +#ifdef _GLIBCXX_USE_WCHAR_T
1710 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1711 +#ifdef __UCLIBC_HAS_XLOCALE__
1714 + const char* __name)
1718 + _M_data = new __moneypunct_cache<wchar_t, true>;
1723 + _M_data->_M_decimal_point = L'.';
1724 + _M_data->_M_thousands_sep = L',';
1725 + _M_data->_M_grouping = "";
1726 + _M_data->_M_grouping_size = 0;
1727 + _M_data->_M_curr_symbol = L"";
1728 + _M_data->_M_curr_symbol_size = 0;
1729 + _M_data->_M_positive_sign = L"";
1730 + _M_data->_M_positive_sign_size = 0;
1731 + _M_data->_M_negative_sign = L"";
1732 + _M_data->_M_negative_sign_size = 0;
1733 + _M_data->_M_frac_digits = 0;
1734 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1735 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1737 + // Use ctype::widen code without the facet...
1738 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1739 + _M_data->_M_atoms[__i] =
1740 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1745 +#ifdef __UCLIBC_HAS_XLOCALE__
1746 + __c_locale __old = __uselocale(__cloc);
1748 + // Switch to named locale so that mbsrtowcs will work.
1749 + char* __old = strdup(setlocale(LC_ALL, NULL));
1750 + setlocale(LC_ALL, __name);
1753 +#ifdef __UCLIBC_MJN3_ONLY__
1754 +#warning fix this... should be monetary
1757 +# ifdef __UCLIBC_HAS_XLOCALE__
1758 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1759 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1761 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1762 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1765 + union { char *__s; wchar_t __w; } __u;
1766 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1767 + _M_data->_M_decimal_point = __u.__w;
1769 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1770 + _M_data->_M_thousands_sep = __u.__w;
1772 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1773 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1775 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1776 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1777 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1779 + wchar_t* __wcs_ps = 0;
1780 + wchar_t* __wcs_ns = 0;
1781 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1784 + mbstate_t __state;
1785 + size_t __len = strlen(__cpossign);
1789 + memset(&__state, 0, sizeof(mbstate_t));
1790 + __wcs_ps = new wchar_t[__len];
1791 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1792 + _M_data->_M_positive_sign = __wcs_ps;
1795 + _M_data->_M_positive_sign = L"";
1796 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1798 + __len = strlen(__cnegsign);
1800 + _M_data->_M_negative_sign = L"()";
1804 + memset(&__state, 0, sizeof(mbstate_t));
1805 + __wcs_ns = new wchar_t[__len];
1806 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1807 + _M_data->_M_negative_sign = __wcs_ns;
1810 + _M_data->_M_negative_sign = L"";
1811 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1814 + __len = strlen(__ccurr);
1818 + memset(&__state, 0, sizeof(mbstate_t));
1819 + wchar_t* __wcs = new wchar_t[__len];
1820 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1821 + _M_data->_M_curr_symbol = __wcs;
1824 + _M_data->_M_curr_symbol = L"";
1825 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1833 +#ifdef __UCLIBC_HAS_XLOCALE__
1834 + __uselocale(__old);
1836 + setlocale(LC_ALL, __old);
1839 + __throw_exception_again;
1842 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1844 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1845 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1846 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1847 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1849 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1850 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1851 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1854 +#ifdef __UCLIBC_HAS_XLOCALE__
1855 + __uselocale(__old);
1857 + setlocale(LC_ALL, __old);
1865 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1866 +#ifdef __UCLIBC_HAS_XLOCALE__
1869 + const char* __name)
1873 + _M_data = new __moneypunct_cache<wchar_t, false>;
1878 + _M_data->_M_decimal_point = L'.';
1879 + _M_data->_M_thousands_sep = L',';
1880 + _M_data->_M_grouping = "";
1881 + _M_data->_M_grouping_size = 0;
1882 + _M_data->_M_curr_symbol = L"";
1883 + _M_data->_M_curr_symbol_size = 0;
1884 + _M_data->_M_positive_sign = L"";
1885 + _M_data->_M_positive_sign_size = 0;
1886 + _M_data->_M_negative_sign = L"";
1887 + _M_data->_M_negative_sign_size = 0;
1888 + _M_data->_M_frac_digits = 0;
1889 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1890 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1892 + // Use ctype::widen code without the facet...
1893 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1894 + _M_data->_M_atoms[__i] =
1895 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1900 +#ifdef __UCLIBC_HAS_XLOCALE__
1901 + __c_locale __old = __uselocale(__cloc);
1903 + // Switch to named locale so that mbsrtowcs will work.
1904 + char* __old = strdup(setlocale(LC_ALL, NULL));
1905 + setlocale(LC_ALL, __name);
1908 +#ifdef __UCLIBC_MJN3_ONLY__
1909 +#warning fix this... should be monetary
1912 +# ifdef __UCLIBC_HAS_XLOCALE__
1913 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1914 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1916 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1917 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1920 + union { char *__s; wchar_t __w; } __u;
1921 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1922 + _M_data->_M_decimal_point = __u.__w;
1924 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1925 + _M_data->_M_thousands_sep = __u.__w;
1927 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1928 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1930 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1931 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1932 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1934 + wchar_t* __wcs_ps = 0;
1935 + wchar_t* __wcs_ns = 0;
1936 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1939 + mbstate_t __state;
1941 + __len = strlen(__cpossign);
1945 + memset(&__state, 0, sizeof(mbstate_t));
1946 + __wcs_ps = new wchar_t[__len];
1947 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1948 + _M_data->_M_positive_sign = __wcs_ps;
1951 + _M_data->_M_positive_sign = L"";
1952 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1954 + __len = strlen(__cnegsign);
1956 + _M_data->_M_negative_sign = L"()";
1960 + memset(&__state, 0, sizeof(mbstate_t));
1961 + __wcs_ns = new wchar_t[__len];
1962 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1963 + _M_data->_M_negative_sign = __wcs_ns;
1966 + _M_data->_M_negative_sign = L"";
1967 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1970 + __len = strlen(__ccurr);
1974 + memset(&__state, 0, sizeof(mbstate_t));
1975 + wchar_t* __wcs = new wchar_t[__len];
1976 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1977 + _M_data->_M_curr_symbol = __wcs;
1980 + _M_data->_M_curr_symbol = L"";
1981 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1989 +#ifdef __UCLIBC_HAS_XLOCALE__
1990 + __uselocale(__old);
1992 + setlocale(LC_ALL, __old);
1995 + __throw_exception_again;
1998 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1999 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2000 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2001 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2002 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2004 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2005 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2006 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2009 +#ifdef __UCLIBC_HAS_XLOCALE__
2010 + __uselocale(__old);
2012 + setlocale(LC_ALL, __old);
2019 + moneypunct<wchar_t, true>::~moneypunct()
2021 + if (_M_data->_M_positive_sign_size)
2022 + delete [] _M_data->_M_positive_sign;
2023 + if (_M_data->_M_negative_sign_size
2024 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2025 + delete [] _M_data->_M_negative_sign;
2026 + if (_M_data->_M_curr_symbol_size)
2027 + delete [] _M_data->_M_curr_symbol;
2032 + moneypunct<wchar_t, false>::~moneypunct()
2034 + if (_M_data->_M_positive_sign_size)
2035 + delete [] _M_data->_M_positive_sign;
2036 + if (_M_data->_M_negative_sign_size
2037 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2038 + delete [] _M_data->_M_negative_sign;
2039 + if (_M_data->_M_curr_symbol_size)
2040 + delete [] _M_data->_M_curr_symbol;
2045 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2046 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 17:00:00.000000000 -0700
2047 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2006-03-25 22:18:37.000000000 -0700
2049 +// std::numpunct implementation details, GNU version -*- C++ -*-
2051 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2053 +// This file is part of the GNU ISO C++ Library. This library is free
2054 +// software; you can redistribute it and/or modify it under the
2055 +// terms of the GNU General Public License as published by the
2056 +// Free Software Foundation; either version 2, or (at your option)
2057 +// any later version.
2059 +// This library is distributed in the hope that it will be useful,
2060 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2061 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2062 +// GNU General Public License for more details.
2064 +// You should have received a copy of the GNU General Public License along
2065 +// with this library; see the file COPYING. If not, write to the Free
2066 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2069 +// As a special exception, you may use this file as part of a free software
2070 +// library without restriction. Specifically, if other files instantiate
2071 +// templates or use macros or inline functions from this file, or you compile
2072 +// this file and link it with other files to produce an executable, this
2073 +// file does not by itself cause the resulting executable to be covered by
2074 +// the GNU General Public License. This exception does not however
2075 +// invalidate any other reasons why the executable file might be covered by
2076 +// the GNU General Public License.
2079 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2082 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2087 +#include <bits/c++locale_internal.h>
2089 +#ifdef __UCLIBC_MJN3_ONLY__
2090 +#warning tailor for stub locale support
2092 +#ifndef __UCLIBC_HAS_XLOCALE__
2093 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2100 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2103 + _M_data = new __numpunct_cache<char>;
2108 + _M_data->_M_grouping = "";
2109 + _M_data->_M_grouping_size = 0;
2110 + _M_data->_M_use_grouping = false;
2112 + _M_data->_M_decimal_point = '.';
2113 + _M_data->_M_thousands_sep = ',';
2115 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2116 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2118 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2119 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2124 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2126 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2129 + // Check for NULL, which implies no grouping.
2130 + if (_M_data->_M_thousands_sep == '\0')
2131 + _M_data->_M_grouping = "";
2133 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2134 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2137 + // NB: There is no way to extact this info from posix locales.
2138 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2139 + _M_data->_M_truename = "true";
2140 + _M_data->_M_truename_size = 4;
2141 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2142 + _M_data->_M_falsename = "false";
2143 + _M_data->_M_falsename_size = 5;
2147 + numpunct<char>::~numpunct()
2148 + { delete _M_data; }
2150 +#ifdef _GLIBCXX_USE_WCHAR_T
2153 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2156 + _M_data = new __numpunct_cache<wchar_t>;
2161 + _M_data->_M_grouping = "";
2162 + _M_data->_M_grouping_size = 0;
2163 + _M_data->_M_use_grouping = false;
2165 + _M_data->_M_decimal_point = L'.';
2166 + _M_data->_M_thousands_sep = L',';
2168 + // Use ctype::widen code without the facet...
2169 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2170 + _M_data->_M_atoms_out[__i] =
2171 + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2173 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2174 + _M_data->_M_atoms_in[__j] =
2175 + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2180 + // NB: In the GNU model wchar_t is always 32 bit wide.
2181 +#ifdef __UCLIBC_MJN3_ONLY__
2185 +# ifdef __UCLIBC_HAS_XLOCALE__
2186 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2187 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2189 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2190 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2193 + union { char *__s; wchar_t __w; } __u;
2194 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2195 + _M_data->_M_decimal_point = __u.__w;
2197 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2198 + _M_data->_M_thousands_sep = __u.__w;
2201 + if (_M_data->_M_thousands_sep == L'\0')
2202 + _M_data->_M_grouping = "";
2204 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2205 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2208 + // NB: There is no way to extact this info from posix locales.
2209 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2210 + _M_data->_M_truename = L"true";
2211 + _M_data->_M_truename_size = 4;
2212 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2213 + _M_data->_M_falsename = L"false";
2214 + _M_data->_M_falsename_size = 5;
2218 + numpunct<wchar_t>::~numpunct()
2219 + { delete _M_data; }
2222 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2223 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 17:00:00.000000000 -0700
2224 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2006-03-25 22:18:37.000000000 -0700
2226 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2228 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2230 +// This file is part of the GNU ISO C++ Library. This library is free
2231 +// software; you can redistribute it and/or modify it under the
2232 +// terms of the GNU General Public License as published by the
2233 +// Free Software Foundation; either version 2, or (at your option)
2234 +// any later version.
2236 +// This library is distributed in the hope that it will be useful,
2237 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2238 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2239 +// GNU General Public License for more details.
2241 +// You should have received a copy of the GNU General Public License along
2242 +// with this library; see the file COPYING. If not, write to the Free
2243 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2246 +// As a special exception, you may use this file as part of a free software
2247 +// library without restriction. Specifically, if other files instantiate
2248 +// templates or use macros or inline functions from this file, or you compile
2249 +// this file and link it with other files to produce an executable, this
2250 +// file does not by itself cause the resulting executable to be covered by
2251 +// the GNU General Public License. This exception does not however
2252 +// invalidate any other reasons why the executable file might be covered by
2253 +// the GNU General Public License.
2256 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2257 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2260 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2263 +#include <bits/c++locale_internal.h>
2265 +#ifdef __UCLIBC_MJN3_ONLY__
2266 +#warning tailor for stub locale support
2268 +#ifndef __UCLIBC_HAS_XLOCALE__
2269 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2276 + __timepunct<char>::
2277 + _M_put(char* __s, size_t __maxlen, const char* __format,
2278 + const tm* __tm) const
2280 +#ifdef __UCLIBC_HAS_XLOCALE__
2281 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2282 + _M_c_locale_timepunct);
2284 + char* __old = strdup(setlocale(LC_ALL, NULL));
2285 + setlocale(LC_ALL, _M_name_timepunct);
2286 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2287 + setlocale(LC_ALL, __old);
2290 + // Make sure __s is null terminated.
2297 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2300 + _M_data = new __timepunct_cache<char>;
2305 + _M_c_locale_timepunct = _S_get_c_locale();
2307 + _M_data->_M_date_format = "%m/%d/%y";
2308 + _M_data->_M_date_era_format = "%m/%d/%y";
2309 + _M_data->_M_time_format = "%H:%M:%S";
2310 + _M_data->_M_time_era_format = "%H:%M:%S";
2311 + _M_data->_M_date_time_format = "";
2312 + _M_data->_M_date_time_era_format = "";
2313 + _M_data->_M_am = "AM";
2314 + _M_data->_M_pm = "PM";
2315 + _M_data->_M_am_pm_format = "";
2317 + // Day names, starting with "C"'s Sunday.
2318 + _M_data->_M_day1 = "Sunday";
2319 + _M_data->_M_day2 = "Monday";
2320 + _M_data->_M_day3 = "Tuesday";
2321 + _M_data->_M_day4 = "Wednesday";
2322 + _M_data->_M_day5 = "Thursday";
2323 + _M_data->_M_day6 = "Friday";
2324 + _M_data->_M_day7 = "Saturday";
2326 + // Abbreviated day names, starting with "C"'s Sun.
2327 + _M_data->_M_aday1 = "Sun";
2328 + _M_data->_M_aday2 = "Mon";
2329 + _M_data->_M_aday3 = "Tue";
2330 + _M_data->_M_aday4 = "Wed";
2331 + _M_data->_M_aday5 = "Thu";
2332 + _M_data->_M_aday6 = "Fri";
2333 + _M_data->_M_aday7 = "Sat";
2335 + // Month names, starting with "C"'s January.
2336 + _M_data->_M_month01 = "January";
2337 + _M_data->_M_month02 = "February";
2338 + _M_data->_M_month03 = "March";
2339 + _M_data->_M_month04 = "April";
2340 + _M_data->_M_month05 = "May";
2341 + _M_data->_M_month06 = "June";
2342 + _M_data->_M_month07 = "July";
2343 + _M_data->_M_month08 = "August";
2344 + _M_data->_M_month09 = "September";
2345 + _M_data->_M_month10 = "October";
2346 + _M_data->_M_month11 = "November";
2347 + _M_data->_M_month12 = "December";
2349 + // Abbreviated month names, starting with "C"'s Jan.
2350 + _M_data->_M_amonth01 = "Jan";
2351 + _M_data->_M_amonth02 = "Feb";
2352 + _M_data->_M_amonth03 = "Mar";
2353 + _M_data->_M_amonth04 = "Apr";
2354 + _M_data->_M_amonth05 = "May";
2355 + _M_data->_M_amonth06 = "Jun";
2356 + _M_data->_M_amonth07 = "Jul";
2357 + _M_data->_M_amonth08 = "Aug";
2358 + _M_data->_M_amonth09 = "Sep";
2359 + _M_data->_M_amonth10 = "Oct";
2360 + _M_data->_M_amonth11 = "Nov";
2361 + _M_data->_M_amonth12 = "Dec";
2365 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2367 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2368 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2369 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2370 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2371 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2372 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2374 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2375 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2376 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2378 + // Day names, starting with "C"'s Sunday.
2379 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2380 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2381 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2382 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2383 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2384 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2385 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2387 + // Abbreviated day names, starting with "C"'s Sun.
2388 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2389 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2390 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2391 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2392 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2393 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2394 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2396 + // Month names, starting with "C"'s January.
2397 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2398 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2399 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2400 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2401 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2402 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2403 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2404 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2405 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2406 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2407 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2408 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2410 + // Abbreviated month names, starting with "C"'s Jan.
2411 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2412 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2413 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2414 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2415 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2416 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2417 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2418 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2419 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2420 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2421 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2422 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2426 +#ifdef _GLIBCXX_USE_WCHAR_T
2429 + __timepunct<wchar_t>::
2430 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2431 + const tm* __tm) const
2433 +#ifdef __UCLIBC_HAS_XLOCALE__
2434 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2435 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2436 + _M_c_locale_timepunct);
2438 + char* __old = strdup(setlocale(LC_ALL, NULL));
2439 + setlocale(LC_ALL, _M_name_timepunct);
2440 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2441 + setlocale(LC_ALL, __old);
2444 + // Make sure __s is null terminated.
2451 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2454 + _M_data = new __timepunct_cache<wchar_t>;
2456 +#warning wide time stuff
2460 + _M_c_locale_timepunct = _S_get_c_locale();
2462 + _M_data->_M_date_format = L"%m/%d/%y";
2463 + _M_data->_M_date_era_format = L"%m/%d/%y";
2464 + _M_data->_M_time_format = L"%H:%M:%S";
2465 + _M_data->_M_time_era_format = L"%H:%M:%S";
2466 + _M_data->_M_date_time_format = L"";
2467 + _M_data->_M_date_time_era_format = L"";
2468 + _M_data->_M_am = L"AM";
2469 + _M_data->_M_pm = L"PM";
2470 + _M_data->_M_am_pm_format = L"";
2472 + // Day names, starting with "C"'s Sunday.
2473 + _M_data->_M_day1 = L"Sunday";
2474 + _M_data->_M_day2 = L"Monday";
2475 + _M_data->_M_day3 = L"Tuesday";
2476 + _M_data->_M_day4 = L"Wednesday";
2477 + _M_data->_M_day5 = L"Thursday";
2478 + _M_data->_M_day6 = L"Friday";
2479 + _M_data->_M_day7 = L"Saturday";
2481 + // Abbreviated day names, starting with "C"'s Sun.
2482 + _M_data->_M_aday1 = L"Sun";
2483 + _M_data->_M_aday2 = L"Mon";
2484 + _M_data->_M_aday3 = L"Tue";
2485 + _M_data->_M_aday4 = L"Wed";
2486 + _M_data->_M_aday5 = L"Thu";
2487 + _M_data->_M_aday6 = L"Fri";
2488 + _M_data->_M_aday7 = L"Sat";
2490 + // Month names, starting with "C"'s January.
2491 + _M_data->_M_month01 = L"January";
2492 + _M_data->_M_month02 = L"February";
2493 + _M_data->_M_month03 = L"March";
2494 + _M_data->_M_month04 = L"April";
2495 + _M_data->_M_month05 = L"May";
2496 + _M_data->_M_month06 = L"June";
2497 + _M_data->_M_month07 = L"July";
2498 + _M_data->_M_month08 = L"August";
2499 + _M_data->_M_month09 = L"September";
2500 + _M_data->_M_month10 = L"October";
2501 + _M_data->_M_month11 = L"November";
2502 + _M_data->_M_month12 = L"December";
2504 + // Abbreviated month names, starting with "C"'s Jan.
2505 + _M_data->_M_amonth01 = L"Jan";
2506 + _M_data->_M_amonth02 = L"Feb";
2507 + _M_data->_M_amonth03 = L"Mar";
2508 + _M_data->_M_amonth04 = L"Apr";
2509 + _M_data->_M_amonth05 = L"May";
2510 + _M_data->_M_amonth06 = L"Jun";
2511 + _M_data->_M_amonth07 = L"Jul";
2512 + _M_data->_M_amonth08 = L"Aug";
2513 + _M_data->_M_amonth09 = L"Sep";
2514 + _M_data->_M_amonth10 = L"Oct";
2515 + _M_data->_M_amonth11 = L"Nov";
2516 + _M_data->_M_amonth12 = L"Dec";
2521 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2523 + union { char *__s; wchar_t *__w; } __u;
2525 + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2526 + _M_data->_M_date_format = __u.__w;
2527 + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2528 + _M_data->_M_date_era_format = __u.__w;
2529 + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2530 + _M_data->_M_time_format = __u.__w;
2531 + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2532 + _M_data->_M_time_era_format = __u.__w;
2533 + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2534 + _M_data->_M_date_time_format = __u.__w;
2535 + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2536 + _M_data->_M_date_time_era_format = __u.__w;
2537 + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2538 + _M_data->_M_am = __u.__w;
2539 + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2540 + _M_data->_M_pm = __u.__w;
2541 + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2542 + _M_data->_M_am_pm_format = __u.__w;
2544 + // Day names, starting with "C"'s Sunday.
2545 + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2546 + _M_data->_M_day1 = __u.__w;
2547 + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2548 + _M_data->_M_day2 = __u.__w;
2549 + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2550 + _M_data->_M_day3 = __u.__w;
2551 + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2552 + _M_data->_M_day4 = __u.__w;
2553 + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2554 + _M_data->_M_day5 = __u.__w;
2555 + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2556 + _M_data->_M_day6 = __u.__w;
2557 + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2558 + _M_data->_M_day7 = __u.__w;
2560 + // Abbreviated day names, starting with "C"'s Sun.
2561 + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2562 + _M_data->_M_aday1 = __u.__w;
2563 + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2564 + _M_data->_M_aday2 = __u.__w;
2565 + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2566 + _M_data->_M_aday3 = __u.__w;
2567 + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2568 + _M_data->_M_aday4 = __u.__w;
2569 + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2570 + _M_data->_M_aday5 = __u.__w;
2571 + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2572 + _M_data->_M_aday6 = __u.__w;
2573 + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2574 + _M_data->_M_aday7 = __u.__w;
2576 + // Month names, starting with "C"'s January.
2577 + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2578 + _M_data->_M_month01 = __u.__w;
2579 + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2580 + _M_data->_M_month02 = __u.__w;
2581 + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2582 + _M_data->_M_month03 = __u.__w;
2583 + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2584 + _M_data->_M_month04 = __u.__w;
2585 + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2586 + _M_data->_M_month05 = __u.__w;
2587 + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2588 + _M_data->_M_month06 = __u.__w;
2589 + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2590 + _M_data->_M_month07 = __u.__w;
2591 + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2592 + _M_data->_M_month08 = __u.__w;
2593 + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2594 + _M_data->_M_month09 = __u.__w;
2595 + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2596 + _M_data->_M_month10 = __u.__w;
2597 + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2598 + _M_data->_M_month11 = __u.__w;
2599 + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2600 + _M_data->_M_month12 = __u.__w;
2602 + // Abbreviated month names, starting with "C"'s Jan.
2603 + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2604 + _M_data->_M_amonth01 = __u.__w;
2605 + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2606 + _M_data->_M_amonth02 = __u.__w;
2607 + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2608 + _M_data->_M_amonth03 = __u.__w;
2609 + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2610 + _M_data->_M_amonth04 = __u.__w;
2611 + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2612 + _M_data->_M_amonth05 = __u.__w;
2613 + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2614 + _M_data->_M_amonth06 = __u.__w;
2615 + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2616 + _M_data->_M_amonth07 = __u.__w;
2617 + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2618 + _M_data->_M_amonth08 = __u.__w;
2619 + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2620 + _M_data->_M_amonth09 = __u.__w;
2621 + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2622 + _M_data->_M_amonth10 = __u.__w;
2623 + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2624 + _M_data->_M_amonth11 = __u.__w;
2625 + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2626 + _M_data->_M_amonth12 = __u.__w;
2632 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h
2633 --- gcc-4.1.0-dist/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 17:00:00.000000000 -0700
2634 +++ gcc-4.1.0/libstdc++-v3/config/locale/uclibc/time_members.h 2005-10-21 02:34:06.000000000 -0600
2636 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2638 +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2640 +// This file is part of the GNU ISO C++ Library. This library is free
2641 +// software; you can redistribute it and/or modify it under the
2642 +// terms of the GNU General Public License as published by the
2643 +// Free Software Foundation; either version 2, or (at your option)
2644 +// any later version.
2646 +// This library is distributed in the hope that it will be useful,
2647 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2648 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2649 +// GNU General Public License for more details.
2651 +// You should have received a copy of the GNU General Public License along
2652 +// with this library; see the file COPYING. If not, write to the Free
2653 +// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
2656 +// As a special exception, you may use this file as part of a free software
2657 +// library without restriction. Specifically, if other files instantiate
2658 +// templates or use macros or inline functions from this file, or you compile
2659 +// this file and link it with other files to produce an executable, this
2660 +// file does not by itself cause the resulting executable to be covered by
2661 +// the GNU General Public License. This exception does not however
2662 +// invalidate any other reasons why the executable file might be covered by
2663 +// the GNU General Public License.
2666 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2667 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2670 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2672 + template<typename _CharT>
2673 + __timepunct<_CharT>::__timepunct(size_t __refs)
2674 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2675 + _M_name_timepunct(_S_get_c_name())
2676 + { _M_initialize_timepunct(); }
2678 + template<typename _CharT>
2679 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2680 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2681 + _M_name_timepunct(_S_get_c_name())
2682 + { _M_initialize_timepunct(); }
2684 + template<typename _CharT>
2685 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2687 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2688 + _M_name_timepunct(NULL)
2690 + const size_t __len = std::strlen(__s) + 1;
2691 + char* __tmp = new char[__len];
2692 + std::memcpy(__tmp, __s, __len);
2693 + _M_name_timepunct = __tmp;
2696 + { _M_initialize_timepunct(__cloc); }
2699 + delete [] _M_name_timepunct;
2700 + __throw_exception_again;
2704 + template<typename _CharT>
2705 + __timepunct<_CharT>::~__timepunct()
2707 + if (_M_name_timepunct != _S_get_c_name())
2708 + delete [] _M_name_timepunct;
2710 + _S_destroy_c_locale(_M_c_locale_timepunct);
2712 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h
2713 --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 17:00:00.000000000 -0700
2714 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2006-03-25 22:06:30.000000000 -0700
2716 +// Locale support -*- C++ -*-
2718 +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004
2719 +// Free Software Foundation, Inc.
2721 +// This file is part of the GNU ISO C++ Library. This library is free
2722 +// software; you can redistribute it and/or modify it under the
2723 +// terms of the GNU General Public License as published by the
2724 +// Free Software Foundation; either version 2, or (at your option)
2725 +// any later version.
2727 +// This library is distributed in the hope that it will be useful,
2728 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2729 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2730 +// GNU General Public License for more details.
2732 +// You should have received a copy of the GNU General Public License along
2733 +// with this library; see the file COPYING. If not, write to the Free
2734 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2737 +// As a special exception, you may use this file as part of a free software
2738 +// library without restriction. Specifically, if other files instantiate
2739 +// templates or use macros or inline functions from this file, or you compile
2740 +// this file and link it with other files to produce an executable, this
2741 +// file does not by itself cause the resulting executable to be covered by
2742 +// the GNU General Public License. This exception does not however
2743 +// invalidate any other reasons why the executable file might be covered by
2744 +// the GNU General Public License.
2747 +// ISO C++ 14882: 22.1 Locales
2750 +/** @file ctype_base.h
2751 + * This is an internal header file, included by other library headers.
2752 + * You should not attempt to use it directly.
2755 +// Information as gleaned from /usr/include/ctype.h
2757 + /// @brief Base class for ctype.
2760 + // Note: In uClibc, the following two types depend on configuration.
2762 + // Non-standard typedefs.
2763 + typedef const __ctype_touplow_t* __to_type;
2765 + // NB: Offsets into ctype<char>::_M_table force a particular size
2766 + // on the mask type. Because of this, we don't use an enum.
2767 + typedef __ctype_mask_t mask;
2768 + static const mask upper = _ISupper;
2769 + static const mask lower = _ISlower;
2770 + static const mask alpha = _ISalpha;
2771 + static const mask digit = _ISdigit;
2772 + static const mask xdigit = _ISxdigit;
2773 + static const mask space = _ISspace;
2774 + static const mask print = _ISprint;
2775 + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2776 + static const mask cntrl = _IScntrl;
2777 + static const mask punct = _ISpunct;
2778 + static const mask alnum = _ISalpha | _ISdigit;
2780 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h
2781 --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 17:00:00.000000000 -0700
2782 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2006-03-25 22:06:30.000000000 -0700
2784 +// Locale support -*- C++ -*-
2786 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2788 +// This file is part of the GNU ISO C++ Library. This library is free
2789 +// software; you can redistribute it and/or modify it under the
2790 +// terms of the GNU General Public License as published by the
2791 +// Free Software Foundation; either version 2, or (at your option)
2792 +// any later version.
2794 +// This library is distributed in the hope that it will be useful,
2795 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2796 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2797 +// GNU General Public License for more details.
2799 +// You should have received a copy of the GNU General Public License along
2800 +// with this library; see the file COPYING. If not, write to the Free
2801 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2804 +// As a special exception, you may use this file as part of a free software
2805 +// library without restriction. Specifically, if other files instantiate
2806 +// templates or use macros or inline functions from this file, or you compile
2807 +// this file and link it with other files to produce an executable, this
2808 +// file does not by itself cause the resulting executable to be covered by
2809 +// the GNU General Public License. This exception does not however
2810 +// invalidate any other reasons why the executable file might be covered by
2811 +// the GNU General Public License.
2814 +// ISO C++ 14882: 22.1 Locales
2817 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2818 +// functions go in ctype.cc
2822 + is(mask __m, char __c) const
2823 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2827 + is(const char* __low, const char* __high, mask* __vec) const
2829 + while (__low < __high)
2830 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2836 + scan_is(mask __m, const char* __low, const char* __high) const
2838 + while (__low < __high
2839 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2846 + scan_not(mask __m, const char* __low, const char* __high) const
2848 + while (__low < __high
2849 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2853 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2854 --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 17:00:00.000000000 -0700
2855 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2006-03-25 22:06:30.000000000 -0700
2857 +// Locale support -*- C++ -*-
2859 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
2860 +// Free Software Foundation, Inc.
2862 +// This file is part of the GNU ISO C++ Library. This library is free
2863 +// software; you can redistribute it and/or modify it under the
2864 +// terms of the GNU General Public License as published by the
2865 +// Free Software Foundation; either version 2, or (at your option)
2866 +// any later version.
2868 +// This library is distributed in the hope that it will be useful,
2869 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2870 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2871 +// GNU General Public License for more details.
2873 +// You should have received a copy of the GNU General Public License along
2874 +// with this library; see the file COPYING. If not, write to the Free
2875 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2878 +// As a special exception, you may use this file as part of a free software
2879 +// library without restriction. Specifically, if other files instantiate
2880 +// templates or use macros or inline functions from this file, or you compile
2881 +// this file and link it with other files to produce an executable, this
2882 +// file does not by itself cause the resulting executable to be covered by
2883 +// the GNU General Public License. This exception does not however
2884 +// invalidate any other reasons why the executable file might be covered by
2885 +// the GNU General Public License.
2888 +// ISO C++ 14882: 22.1 Locales
2891 +// Information as gleaned from /usr/include/ctype.h
2893 + const ctype_base::mask*
2894 + ctype<char>::classic_table() throw()
2895 + { return __C_ctype_b; }
2897 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2899 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2900 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2902 + _M_toupper = __C_ctype_toupper;
2903 + _M_tolower = __C_ctype_tolower;
2904 + _M_table = __table ? __table : __C_ctype_b;
2905 + memset(_M_widen, 0, sizeof(_M_widen));
2906 + memset(_M_narrow, 0, sizeof(_M_narrow));
2909 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2910 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2911 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2913 + _M_toupper = __C_ctype_toupper;
2914 + _M_tolower = __C_ctype_tolower;
2915 + _M_table = __table ? __table : __C_ctype_b;
2916 + memset(_M_widen, 0, sizeof(_M_widen));
2917 + memset(_M_narrow, 0, sizeof(_M_narrow));
2921 + ctype<char>::do_toupper(char __c) const
2922 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2925 + ctype<char>::do_toupper(char* __low, const char* __high) const
2927 + while (__low < __high)
2929 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2936 + ctype<char>::do_tolower(char __c) const
2937 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2940 + ctype<char>::do_tolower(char* __low, const char* __high) const
2942 + while (__low < __high)
2944 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2949 diff -urN gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h
2950 --- gcc-4.1.0-dist/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 17:00:00.000000000 -0700
2951 +++ gcc-4.1.0/libstdc++-v3/config/os/uclibc/os_defines.h 2006-03-25 22:06:30.000000000 -0700
2953 +// Specific definitions for GNU/Linux -*- C++ -*-
2955 +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2957 +// This file is part of the GNU ISO C++ Library. This library is free
2958 +// software; you can redistribute it and/or modify it under the
2959 +// terms of the GNU General Public License as published by the
2960 +// Free Software Foundation; either version 2, or (at your option)
2961 +// any later version.
2963 +// This library is distributed in the hope that it will be useful,
2964 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2965 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2966 +// GNU General Public License for more details.
2968 +// You should have received a copy of the GNU General Public License along
2969 +// with this library; see the file COPYING. If not, write to the Free
2970 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2973 +// As a special exception, you may use this file as part of a free software
2974 +// library without restriction. Specifically, if other files instantiate
2975 +// templates or use macros or inline functions from this file, or you compile
2976 +// this file and link it with other files to produce an executable, this
2977 +// file does not by itself cause the resulting executable to be covered by
2978 +// the GNU General Public License. This exception does not however
2979 +// invalidate any other reasons why the executable file might be covered by
2980 +// the GNU General Public License.
2982 +#ifndef _GLIBCXX_OS_DEFINES
2983 +#define _GLIBCXX_OS_DEFINES 1
2985 +// System-specific #define, typedefs, corrections, etc, go here. This
2986 +// file will come before all others.
2988 +// This keeps isanum, et al from being propagated as macros.
2989 +#define __NO_CTYPE 1
2991 +#include <features.h>
2993 +// We must not see the optimized string functions GNU libc defines.
2994 +#define __NO_STRING_INLINES
2997 diff -urN gcc-4.1.0-dist/libstdc++-v3/configure gcc-4.1.0/libstdc++-v3/configure
2998 --- gcc-4.1.0-dist/libstdc++-v3/configure 2006-03-26 12:08:28.000000000 -0700
2999 +++ gcc-4.1.0/libstdc++-v3/configure 2006-03-25 22:06:30.000000000 -0700
3000 @@ -4005,6 +4005,11 @@
3001 lt_cv_deplibs_check_method=pass_all
3005 + lt_cv_deplibs_check_method=pass_all
3006 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
3009 netbsd* | knetbsd*-gnu)
3010 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
3011 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
3012 @@ -5740,7 +5745,7 @@
3013 enableval="$enable_clocale"
3015 case "$enableval" in
3016 - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
3017 + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
3018 *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
3019 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
3020 { (exit 1); exit 1; }; } ;;
3021 @@ -5765,6 +5770,9 @@
3022 # Default to "generic".
3023 if test $enable_clocale_flag = auto; then
3024 case ${target_os} in
3026 + enable_clocale_flag=uclibc
3028 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
3029 cat >conftest.$ac_ext <<_ACEOF
3031 @@ -5995,6 +6003,76 @@
3032 CTIME_CC=config/locale/generic/time_members.cc
3033 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
3036 + echo "$as_me:$LINENO: result: uclibc" >&5
3037 +echo "${ECHO_T}uclibc" >&6
3039 + # Declare intention to use gettext, and add support for specific
3041 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
3042 + ALL_LINGUAS="de fr"
3044 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
3045 + # Extract the first word of "msgfmt", so it can be a program name with args.
3046 +set dummy msgfmt; ac_word=$2
3047 +echo "$as_me:$LINENO: checking for $ac_word" >&5
3048 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3049 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
3050 + echo $ECHO_N "(cached) $ECHO_C" >&6
3052 + if test -n "$check_msgfmt"; then
3053 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
3055 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3056 +for as_dir in $PATH
3059 + test -z "$as_dir" && as_dir=.
3060 + for ac_exec_ext in '' $ac_executable_extensions; do
3061 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3062 + ac_cv_prog_check_msgfmt="yes"
3063 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
3069 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3072 +check_msgfmt=$ac_cv_prog_check_msgfmt
3073 +if test -n "$check_msgfmt"; then
3074 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3075 +echo "${ECHO_T}$check_msgfmt" >&6
3077 + echo "$as_me:$LINENO: result: no" >&5
3078 +echo "${ECHO_T}no" >&6
3081 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3084 + # Export the build objects.
3085 + for ling in $ALL_LINGUAS; do \
3086 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3087 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3092 + CLOCALE_H=config/locale/uclibc/c_locale.h
3093 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
3094 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3095 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3096 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3097 + CMESSAGES_H=config/locale/uclibc/messages_members.h
3098 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3099 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
3100 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3101 + CTIME_H=config/locale/uclibc/time_members.h
3102 + CTIME_CC=config/locale/uclibc/time_members.cc
3103 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3107 # This is where the testsuite looks for locale catalogs, using the
3108 diff -urN gcc-4.1.0-dist/libstdc++-v3/configure.host gcc-4.1.0/libstdc++-v3/configure.host
3109 --- gcc-4.1.0-dist/libstdc++-v3/configure.host 2006-03-26 12:08:28.000000000 -0700
3110 +++ gcc-4.1.0/libstdc++-v3/configure.host 2006-03-25 22:06:30.000000000 -0700
3111 @@ -261,6 +261,12 @@
3115 +# Override for uClibc since linux-uclibc gets mishandled above.
3116 +case "${host_os}" in
3118 + os_include_dir="os/uclibc"
3122 # Set any OS-dependent and CPU-dependent bits.
3123 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3124 diff -urN gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4 gcc-4.1.0/libstdc++-v3/crossconfig.m4
3125 --- gcc-4.1.0-dist/libstdc++-v3/crossconfig.m4 2006-03-26 12:08:28.000000000 -0700
3126 +++ gcc-4.1.0/libstdc++-v3/crossconfig.m4 2006-03-25 22:06:30.000000000 -0700
3127 @@ -143,6 +143,99 @@
3132 +# Temporary hack until we implement the float versions of the libm funcs
3133 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3134 + machine/endian.h machine/param.h sys/machine.h sys/types.h \
3135 + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3136 + SECTION_FLAGS='-ffunction-sections -fdata-sections'
3137 + AC_SUBST(SECTION_FLAGS)
3138 + GLIBCXX_CHECK_LINKER_FEATURES
3139 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3140 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
3143 + AC_DEFINE(HAVE_INT64_T)
3146 + # Don't enable LFS with uClinux
3149 + AC_DEFINE(_GLIBCXX_USE_LFS)
3152 + # For showmanyc_helper().
3153 + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3154 + GLIBCXX_CHECK_POLL
3155 + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3158 + AC_CHECK_HEADERS(sys/uio.h)
3159 + GLIBCXX_CHECK_WRITEV
3161 +# AC_DEFINE(HAVE_ACOSF)
3162 +# AC_DEFINE(HAVE_ASINF)
3163 +# AC_DEFINE(HAVE_ATANF)
3164 +# AC_DEFINE(HAVE_ATAN2F)
3165 + AC_DEFINE(HAVE_CEILF)
3166 + AC_DEFINE(HAVE_COPYSIGN)
3167 +# AC_DEFINE(HAVE_COPYSIGNF)
3168 +# AC_DEFINE(HAVE_COSF)
3169 +# AC_DEFINE(HAVE_COSHF)
3170 +# AC_DEFINE(HAVE_EXPF)
3171 +# AC_DEFINE(HAVE_FABSF)
3172 + AC_DEFINE(HAVE_FINITE)
3173 + AC_DEFINE(HAVE_FINITEF)
3174 + AC_DEFINE(HAVE_FLOORF)
3175 +# AC_DEFINE(HAVE_FMODF)
3176 +# AC_DEFINE(HAVE_FREXPF)
3177 + AC_DEFINE(HAVE_HYPOT)
3178 +# AC_DEFINE(HAVE_HYPOTF)
3179 + AC_DEFINE(HAVE_ISINF)
3180 + AC_DEFINE(HAVE_ISINFF)
3181 + AC_DEFINE(HAVE_ISNAN)
3182 + AC_DEFINE(HAVE_ISNANF)
3183 +# AC_DEFINE(HAVE_LOGF)
3184 +# AC_DEFINE(HAVE_LOG10F)
3185 +# AC_DEFINE(HAVE_MODFF)
3186 +# AC_DEFINE(HAVE_SINF)
3187 +# AC_DEFINE(HAVE_SINHF)
3188 +# AC_DEFINE(HAVE_SINCOS)
3189 +# AC_DEFINE(HAVE_SINCOSF)
3190 + AC_DEFINE(HAVE_SQRTF)
3191 +# AC_DEFINE(HAVE_TANF)
3192 +# AC_DEFINE(HAVE_TANHF)
3193 + if test x"long_double_math_on_this_cpu" = x"yes"; then
3194 + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3195 +# AC_DEFINE(HAVE_ACOSL)
3196 +# AC_DEFINE(HAVE_ASINL)
3197 +# AC_DEFINE(HAVE_ATANL)
3198 +# AC_DEFINE(HAVE_ATAN2L)
3199 +# AC_DEFINE(HAVE_CEILL)
3200 +# AC_DEFINE(HAVE_COPYSIGNL)
3201 +# AC_DEFINE(HAVE_COSL)
3202 +# AC_DEFINE(HAVE_COSHL)
3203 +# AC_DEFINE(HAVE_EXPL)
3204 +# AC_DEFINE(HAVE_FABSL)
3205 +# AC_DEFINE(HAVE_FINITEL)
3206 +# AC_DEFINE(HAVE_FLOORL)
3207 +# AC_DEFINE(HAVE_FMODL)
3208 +# AC_DEFINE(HAVE_FREXPL)
3209 +# AC_DEFINE(HAVE_HYPOTL)
3210 +# AC_DEFINE(HAVE_ISINFL)
3211 +# AC_DEFINE(HAVE_ISNANL)
3212 +# AC_DEFINE(HAVE_LOGL)
3213 +# AC_DEFINE(HAVE_LOG10L)
3214 +# AC_DEFINE(HAVE_MODFL)
3215 +# AC_DEFINE(HAVE_POWL)
3216 +# AC_DEFINE(HAVE_SINL)
3217 +# AC_DEFINE(HAVE_SINHL)
3218 +# AC_DEFINE(HAVE_SINCOSL)
3219 +# AC_DEFINE(HAVE_SQRTL)
3220 +# AC_DEFINE(HAVE_TANL)
3221 +# AC_DEFINE(HAVE_TANHL)
3224 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3225 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3226 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3228 AC_DEFINE(HAVE_INT64_T)
3231 - # Don't enable LFS with uClibc
3232 + # Don't enable LFS with uClinux
3235 AC_DEFINE(_GLIBCXX_USE_LFS)
3236 diff -urN gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h
3237 --- gcc-4.1.0-dist/libstdc++-v3/include/c_compatibility/wchar.h 2006-03-26 12:08:28.000000000 -0700
3238 +++ gcc-4.1.0/libstdc++-v3/include/c_compatibility/wchar.h 2006-03-25 22:06:30.000000000 -0700
3241 using std::wmemmove;
3243 +#if _GLIBCXX_HAVE_WCSFTIME
3244 using std::wcsftime;
3247 #if _GLIBCXX_USE_C99
3249 diff -urN gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h
3250 --- gcc-4.1.0-dist/libstdc++-v3/include/c_std/std_cwchar.h 2006-03-26 12:08:28.000000000 -0700
3251 +++ gcc-4.1.0/libstdc++-v3/include/c_std/std_cwchar.h 2006-03-25 22:06:30.000000000 -0700
3256 +#if _GLIBCXX_HAVE_WCSFTIME