1 --- a/libstdc++-v3/acinclude.m4
2 +++ b/libstdc++-v3/acinclude.m4
3 @@ -1015,7 +1015,7 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
4 AC_MSG_CHECKING([for C locale to use])
5 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
6 [use MODEL for target locale package],
7 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
8 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
10 # If they didn't use this option switch, or if they specified --enable
11 # with no specific model, we'll have to look for one. If they
12 @@ -1031,6 +1031,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
13 # Default to "generic".
14 if test $enable_clocale_flag = auto; then
17 + enable_clocale_flag=uclibc
19 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
20 AC_EGREP_CPP([_GLIBCXX_ok], [
22 @@ -1157,6 +1160,41 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
23 CTIME_CC=config/locale/generic/time_members.cc
24 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
27 + AC_MSG_RESULT(uclibc)
29 + # Declare intention to use gettext, and add support for specific
31 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
34 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
35 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
36 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
39 + # Export the build objects.
40 + for ling in $ALL_LINGUAS; do \
41 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
42 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
44 + AC_SUBST(glibcxx_MOFILES)
45 + AC_SUBST(glibcxx_POFILES)
47 + CLOCALE_H=config/locale/uclibc/c_locale.h
48 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
49 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
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 --- a/libstdc++-v3/aclocal.m4
65 +++ b/libstdc++-v3/aclocal.m4
66 @@ -1044,6 +1044,9 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
67 # Default to "generic".
68 if test $enable_clocale_flag = auto; then
71 + enable_clocale_flag=uclibc
73 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
74 AC_EGREP_CPP([_GLIBCXX_ok], [
76 @@ -1170,6 +1173,41 @@ AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
77 CTIME_CC=config/locale/generic/time_members.cc
78 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
81 + AC_MSG_RESULT(uclibc)
83 + # Declare intention to use gettext, and add support for specific
85 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
88 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
89 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
90 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
93 + # Export the build objects.
94 + for ling in $ALL_LINGUAS; do \
95 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
96 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
98 + AC_SUBST(glibcxx_MOFILES)
99 + AC_SUBST(glibcxx_POFILES)
101 + CLOCALE_H=config/locale/uclibc/c_locale.h
102 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
103 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
104 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
105 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
106 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
107 + CMESSAGES_H=config/locale/uclibc/messages_members.h
108 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
109 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
110 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
111 + CTIME_H=config/locale/uclibc/time_members.h
112 + CTIME_CC=config/locale/uclibc/time_members.cc
113 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
117 # This is where the testsuite looks for locale catalogs, using the
119 +++ b/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
121 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
123 +// Copyright (C) 2002, 2004 Free Software Foundation, Inc.
125 +// This file is part of the GNU ISO C++ Library. This library is free
126 +// software; you can redistribute it and/or modify it under the
127 +// terms of the GNU General Public License as published by the
128 +// Free Software Foundation; either version 2, or (at your option)
129 +// any later version.
131 +// This library is distributed in the hope that it will be useful,
132 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
133 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
134 +// GNU General Public License for more details.
136 +// You should have received a copy of the GNU General Public License along
137 +// with this library; see the file COPYING. If not, write to the Free
138 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
141 +// As a special exception, you may use this file as part of a free software
142 +// library without restriction. Specifically, if other files instantiate
143 +// templates or use macros or inline functions from this file, or you compile
144 +// this file and link it with other files to produce an executable, this
145 +// file does not by itself cause the resulting executable to be covered by
146 +// the GNU General Public License. This exception does not however
147 +// invalidate any other reasons why the executable file might be covered by
148 +// the GNU General Public License.
150 +// Written by Jakub Jelinek <jakub@redhat.com>
154 +#ifdef __UCLIBC_MJN3_ONLY__
155 +#warning clean this up
158 +#ifdef __UCLIBC_HAS_XLOCALE__
160 +extern "C" __typeof(iswctype_l) __iswctype_l;
161 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
162 +extern "C" __typeof(strcoll_l) __strcoll_l;
163 +extern "C" __typeof(strftime_l) __strftime_l;
164 +extern "C" __typeof(strtod_l) __strtod_l;
165 +extern "C" __typeof(strtof_l) __strtof_l;
166 +extern "C" __typeof(strtold_l) __strtold_l;
167 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
168 +extern "C" __typeof(towlower_l) __towlower_l;
169 +extern "C" __typeof(towupper_l) __towupper_l;
170 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
171 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
172 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
173 +extern "C" __typeof(wctype_l) __wctype_l;
174 +extern "C" __typeof(newlocale) __newlocale;
175 +extern "C" __typeof(freelocale) __freelocale;
176 +extern "C" __typeof(duplocale) __duplocale;
177 +extern "C" __typeof(uselocale) __uselocale;
179 +#endif // GLIBC 2.3 and later
181 +++ b/libstdc++-v3/config/locale/uclibc/c_locale.cc
183 +// Wrapper for underlying C-language localization -*- C++ -*-
185 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
187 +// This file is part of the GNU ISO C++ Library. This library is free
188 +// software; you can redistribute it and/or modify it under the
189 +// terms of the GNU General Public License as published by the
190 +// Free Software Foundation; either version 2, or (at your option)
191 +// any later version.
193 +// This library is distributed in the hope that it will be useful,
194 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
195 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
196 +// GNU General Public License for more details.
198 +// You should have received a copy of the GNU General Public License along
199 +// with this library; see the file COPYING. If not, write to the Free
200 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
203 +// As a special exception, you may use this file as part of a free software
204 +// library without restriction. Specifically, if other files instantiate
205 +// templates or use macros or inline functions from this file, or you compile
206 +// this file and link it with other files to produce an executable, this
207 +// file does not by itself cause the resulting executable to be covered by
208 +// the GNU General Public License. This exception does not however
209 +// invalidate any other reasons why the executable file might be covered by
210 +// the GNU General Public License.
213 +// ISO C++ 14882: 22.8 Standard locale categories.
216 +// Written by Benjamin Kosnik <bkoz@redhat.com>
218 +#include <cerrno> // For errno
220 +#include <stdexcept>
221 +#include <langinfo.h>
222 +#include <bits/c++locale_internal.h>
224 +#ifndef __UCLIBC_HAS_XLOCALE__
225 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
226 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
227 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
228 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
229 +#define __strtof_l(S, E, L) strtof((S), (E))
230 +#define __strtod_l(S, E, L) strtod((S), (E))
231 +#define __strtold_l(S, E, L) strtold((S), (E))
232 +#warning should dummy __newlocale check for C|POSIX ?
233 +#define __newlocale(a, b, c) NULL
234 +#define __freelocale(a) ((void)0)
235 +#define __duplocale(a) __c_locale()
242 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
243 + const __c_locale& __cloc)
245 + if (!(__err & ios_base::failbit))
249 + float __f = __strtof_l(__s, &__sanity, __cloc);
250 + if (__sanity != __s && errno != ERANGE)
253 + __err |= ios_base::failbit;
259 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
260 + const __c_locale& __cloc)
262 + if (!(__err & ios_base::failbit))
266 + double __d = __strtod_l(__s, &__sanity, __cloc);
267 + if (__sanity != __s && errno != ERANGE)
270 + __err |= ios_base::failbit;
276 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
277 + const __c_locale& __cloc)
279 + if (!(__err & ios_base::failbit))
283 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
284 + if (__sanity != __s && errno != ERANGE)
287 + __err |= ios_base::failbit;
292 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
295 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
296 +#ifdef __UCLIBC_HAS_XLOCALE__
299 + // This named locale is not supported by the underlying OS.
300 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
301 + "name not valid"));
307 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
309 + if (_S_get_c_locale() != __cloc)
310 + __freelocale(__cloc);
314 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
315 + { return __duplocale(__cloc); }
320 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
328 +#if _GLIBCXX_NUM_CATEGORIES != 0
334 + "LC_IDENTIFICATION"
341 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
344 +++ b/libstdc++-v3/config/locale/uclibc/c_locale.h
346 +// Wrapper for underlying C-language localization -*- C++ -*-
348 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
350 +// This file is part of the GNU ISO C++ Library. This library is free
351 +// software; you can redistribute it and/or modify it under the
352 +// terms of the GNU General Public License as published by the
353 +// Free Software Foundation; either version 2, or (at your option)
354 +// any later version.
356 +// This library is distributed in the hope that it will be useful,
357 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
358 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
359 +// GNU General Public License for more details.
361 +// You should have received a copy of the GNU General Public License along
362 +// with this library; see the file COPYING. If not, write to the Free
363 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
366 +// As a special exception, you may use this file as part of a free software
367 +// library without restriction. Specifically, if other files instantiate
368 +// templates or use macros or inline functions from this file, or you compile
369 +// this file and link it with other files to produce an executable, this
370 +// file does not by itself cause the resulting executable to be covered by
371 +// the GNU General Public License. This exception does not however
372 +// invalidate any other reasons why the executable file might be covered by
373 +// the GNU General Public License.
376 +// ISO C++ 14882: 22.8 Standard locale categories.
379 +// Written by Benjamin Kosnik <bkoz@redhat.com>
382 +#define _C_LOCALE_H 1
384 +#pragma GCC system_header
386 +#include <cstring> // get std::strlen
387 +#include <cstdio> // get std::snprintf or std::sprintf
389 +#include <langinfo.h> // For codecvt
390 +#ifdef __UCLIBC_MJN3_ONLY__
393 +#ifdef __UCLIBC_HAS_LOCALE__
394 +#include <iconv.h> // For codecvt using iconv, iconv_t
396 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
397 +#include <libintl.h> // For messages
400 +#ifdef __UCLIBC_MJN3_ONLY__
401 +#warning what is _GLIBCXX_C_LOCALE_GNU for
403 +#define _GLIBCXX_C_LOCALE_GNU 1
405 +#ifdef __UCLIBC_MJN3_ONLY__
406 +#warning fix categories
408 +// #define _GLIBCXX_NUM_CATEGORIES 6
409 +#define _GLIBCXX_NUM_CATEGORIES 0
411 +#ifdef __UCLIBC_HAS_XLOCALE__
414 + extern "C" __typeof(uselocale) __uselocale;
420 +#ifdef __UCLIBC_HAS_XLOCALE__
421 + typedef __locale_t __c_locale;
423 + typedef int* __c_locale;
426 + // Convert numeric value of type _Tv to string and return length of
427 + // string. If snprintf is available use it, otherwise fall back to
428 + // the unsafe sprintf which, in general, can be dangerous and should
430 + template<typename _Tv>
432 + __convert_from_v(char* __out, const int __size, const char* __fmt,
433 +#ifdef __UCLIBC_HAS_XLOCALE__
434 + _Tv __v, const __c_locale& __cloc, int __prec)
436 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
438 + _Tv __v, const __c_locale&, int __prec)
440 +# ifdef __UCLIBC_HAS_LOCALE__
441 + char* __old = std::setlocale(LC_ALL, NULL);
442 + char* __sav = new char[std::strlen(__old) + 1];
443 + std::strcpy(__sav, __old);
444 + std::setlocale(LC_ALL, "C");
448 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
450 +#ifdef __UCLIBC_HAS_XLOCALE__
451 + __gnu_cxx::__uselocale(__old);
452 +#elif defined __UCLIBC_HAS_LOCALE__
453 + std::setlocale(LC_ALL, __sav);
462 +++ b/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
464 +// std::codecvt implementation details, GNU version -*- C++ -*-
466 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
468 +// This file is part of the GNU ISO C++ Library. This library is free
469 +// software; you can redistribute it and/or modify it under the
470 +// terms of the GNU General Public License as published by the
471 +// Free Software Foundation; either version 2, or (at your option)
472 +// any later version.
474 +// This library is distributed in the hope that it will be useful,
475 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
476 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477 +// GNU General Public License for more details.
479 +// You should have received a copy of the GNU General Public License along
480 +// with this library; see the file COPYING. If not, write to the Free
481 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
484 +// As a special exception, you may use this file as part of a free software
485 +// library without restriction. Specifically, if other files instantiate
486 +// templates or use macros or inline functions from this file, or you compile
487 +// this file and link it with other files to produce an executable, this
488 +// file does not by itself cause the resulting executable to be covered by
489 +// the GNU General Public License. This exception does not however
490 +// invalidate any other reasons why the executable file might be covered by
491 +// the GNU General Public License.
494 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
497 +// Written by Benjamin Kosnik <bkoz@redhat.com>
500 +#include <bits/c++locale_internal.h>
504 + // Specializations.
505 +#ifdef _GLIBCXX_USE_WCHAR_T
506 + codecvt_base::result
507 + codecvt<wchar_t, char, mbstate_t>::
508 + do_out(state_type& __state, const intern_type* __from,
509 + const intern_type* __from_end, const intern_type*& __from_next,
510 + extern_type* __to, extern_type* __to_end,
511 + extern_type*& __to_next) const
514 + state_type __tmp_state(__state);
516 +#ifdef __UCLIBC_HAS_XLOCALE__
517 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
520 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
521 + // in case we fall back to wcrtomb and then continue, in a loop.
522 + // NB: wcsnrtombs is a GNU extension
523 + for (__from_next = __from, __to_next = __to;
524 + __from_next < __from_end && __to_next < __to_end
527 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
528 + __from_end - __from_next);
529 + if (!__from_chunk_end)
530 + __from_chunk_end = __from_end;
532 + __from = __from_next;
533 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
534 + __from_chunk_end - __from_next,
535 + __to_end - __to_next, &__state);
536 + if (__conv == static_cast<size_t>(-1))
538 + // In case of error, in order to stop at the exact place we
539 + // have to start again from the beginning with a series of
541 + for (; __from < __from_next; ++__from)
542 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
543 + __state = __tmp_state;
546 + else if (__from_next && __from_next < __from_chunk_end)
548 + __to_next += __conv;
553 + __from_next = __from_chunk_end;
554 + __to_next += __conv;
557 + if (__from_next < __from_end && __ret == ok)
559 + extern_type __buf[MB_LEN_MAX];
560 + __tmp_state = __state;
561 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
562 + if (__conv > static_cast<size_t>(__to_end - __to_next))
566 + memcpy(__to_next, __buf, __conv);
567 + __state = __tmp_state;
568 + __to_next += __conv;
574 +#ifdef __UCLIBC_HAS_XLOCALE__
575 + __uselocale(__old);
581 + codecvt_base::result
582 + codecvt<wchar_t, char, mbstate_t>::
583 + do_in(state_type& __state, const extern_type* __from,
584 + const extern_type* __from_end, const extern_type*& __from_next,
585 + intern_type* __to, intern_type* __to_end,
586 + intern_type*& __to_next) const
589 + state_type __tmp_state(__state);
591 +#ifdef __UCLIBC_HAS_XLOCALE__
592 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
595 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
596 + // in case we store a L'\0' and then continue, in a loop.
597 + // NB: mbsnrtowcs is a GNU extension
598 + for (__from_next = __from, __to_next = __to;
599 + __from_next < __from_end && __to_next < __to_end
602 + const extern_type* __from_chunk_end;
603 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
606 + if (!__from_chunk_end)
607 + __from_chunk_end = __from_end;
609 + __from = __from_next;
610 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
611 + __from_chunk_end - __from_next,
612 + __to_end - __to_next, &__state);
613 + if (__conv == static_cast<size_t>(-1))
615 + // In case of error, in order to stop at the exact place we
616 + // have to start again from the beginning with a series of
618 + for (;; ++__to_next, __from += __conv)
620 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
622 + if (__conv == static_cast<size_t>(-1)
623 + || __conv == static_cast<size_t>(-2))
626 + __from_next = __from;
627 + __state = __tmp_state;
630 + else if (__from_next && __from_next < __from_chunk_end)
632 + // It is unclear what to return in this case (see DR 382).
633 + __to_next += __conv;
638 + __from_next = __from_chunk_end;
639 + __to_next += __conv;
642 + if (__from_next < __from_end && __ret == ok)
644 + if (__to_next < __to_end)
646 + // XXX Probably wrong for stateful encodings
647 + __tmp_state = __state;
649 + *__to_next++ = L'\0';
656 +#ifdef __UCLIBC_HAS_XLOCALE__
657 + __uselocale(__old);
664 + codecvt<wchar_t, char, mbstate_t>::
665 + do_encoding() const throw()
667 + // XXX This implementation assumes that the encoding is
668 + // stateless and is either single-byte or variable-width.
670 +#ifdef __UCLIBC_HAS_XLOCALE__
671 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
673 + if (MB_CUR_MAX == 1)
675 +#ifdef __UCLIBC_HAS_XLOCALE__
676 + __uselocale(__old);
682 + codecvt<wchar_t, char, mbstate_t>::
683 + do_max_length() const throw()
685 +#ifdef __UCLIBC_HAS_XLOCALE__
686 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
688 + // XXX Probably wrong for stateful encodings.
689 + int __ret = MB_CUR_MAX;
690 +#ifdef __UCLIBC_HAS_XLOCALE__
691 + __uselocale(__old);
697 + codecvt<wchar_t, char, mbstate_t>::
698 + do_length(state_type& __state, const extern_type* __from,
699 + const extern_type* __end, size_t __max) const
702 + state_type __tmp_state(__state);
704 +#ifdef __UCLIBC_HAS_XLOCALE__
705 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
708 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
709 + // in case we advance past it and then continue, in a loop.
710 + // NB: mbsnrtowcs is a GNU extension
712 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
713 + // its fourth parameter (it wouldn't with NULL as first parameter).
714 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
716 + while (__from < __end && __max)
718 + const extern_type* __from_chunk_end;
719 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
722 + if (!__from_chunk_end)
723 + __from_chunk_end = __end;
725 + const extern_type* __tmp_from = __from;
726 + size_t __conv = mbsnrtowcs(__to, &__from,
727 + __from_chunk_end - __from,
729 + if (__conv == static_cast<size_t>(-1))
731 + // In case of error, in order to stop at the exact place we
732 + // have to start again from the beginning with a series of
734 + for (__from = __tmp_from;; __from += __conv)
736 + __conv = mbrtowc(NULL, __from, __end - __from,
738 + if (__conv == static_cast<size_t>(-1)
739 + || __conv == static_cast<size_t>(-2))
742 + __state = __tmp_state;
743 + __ret += __from - __tmp_from;
747 + __from = __from_chunk_end;
749 + __ret += __from - __tmp_from;
752 + if (__from < __end && __max)
754 + // XXX Probably wrong for stateful encodings
755 + __tmp_state = __state;
762 +#ifdef __UCLIBC_HAS_XLOCALE__
763 + __uselocale(__old);
771 +++ b/libstdc++-v3/config/locale/uclibc/collate_members.cc
773 +// std::collate implementation details, GNU version -*- C++ -*-
775 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
777 +// This file is part of the GNU ISO C++ Library. This library is free
778 +// software; you can redistribute it and/or modify it under the
779 +// terms of the GNU General Public License as published by the
780 +// Free Software Foundation; either version 2, or (at your option)
781 +// any later version.
783 +// This library is distributed in the hope that it will be useful,
784 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
785 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
786 +// GNU General Public License for more details.
788 +// You should have received a copy of the GNU General Public License along
789 +// with this library; see the file COPYING. If not, write to the Free
790 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
793 +// As a special exception, you may use this file as part of a free software
794 +// library without restriction. Specifically, if other files instantiate
795 +// templates or use macros or inline functions from this file, or you compile
796 +// this file and link it with other files to produce an executable, this
797 +// file does not by itself cause the resulting executable to be covered by
798 +// the GNU General Public License. This exception does not however
799 +// invalidate any other reasons why the executable file might be covered by
800 +// the GNU General Public License.
803 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
806 +// Written by Benjamin Kosnik <bkoz@redhat.com>
809 +#include <bits/c++locale_internal.h>
811 +#ifndef __UCLIBC_HAS_XLOCALE__
812 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
813 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
814 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
815 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
820 + // These are basically extensions to char_traits, and perhaps should
821 + // be put there instead of here.
824 + collate<char>::_M_compare(const char* __one, const char* __two) const
826 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
827 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
832 + collate<char>::_M_transform(char* __to, const char* __from,
834 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
836 +#ifdef _GLIBCXX_USE_WCHAR_T
839 + collate<wchar_t>::_M_compare(const wchar_t* __one,
840 + const wchar_t* __two) const
842 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
843 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
848 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
850 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
854 +++ b/libstdc++-v3/config/locale/uclibc/ctype_members.cc
856 +// std::ctype implementation details, GNU version -*- C++ -*-
858 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
860 +// This file is part of the GNU ISO C++ Library. This library is free
861 +// software; you can redistribute it and/or modify it under the
862 +// terms of the GNU General Public License as published by the
863 +// Free Software Foundation; either version 2, or (at your option)
864 +// any later version.
866 +// This library is distributed in the hope that it will be useful,
867 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
868 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
869 +// GNU General Public License for more details.
871 +// You should have received a copy of the GNU General Public License along
872 +// with this library; see the file COPYING. If not, write to the Free
873 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
876 +// As a special exception, you may use this file as part of a free software
877 +// library without restriction. Specifically, if other files instantiate
878 +// templates or use macros or inline functions from this file, or you compile
879 +// this file and link it with other files to produce an executable, this
880 +// file does not by itself cause the resulting executable to be covered by
881 +// the GNU General Public License. This exception does not however
882 +// invalidate any other reasons why the executable file might be covered by
883 +// the GNU General Public License.
886 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
889 +// Written by Benjamin Kosnik <bkoz@redhat.com>
894 +#include <bits/c++locale_internal.h>
896 +#ifndef __UCLIBC_HAS_XLOCALE__
897 +#define __wctype_l(S, L) wctype((S))
898 +#define __towupper_l(C, L) towupper((C))
899 +#define __towlower_l(C, L) towlower((C))
900 +#define __iswctype_l(C, M, L) iswctype((C), (M))
905 + // NB: The other ctype<char> specializations are in src/locale.cc and
906 + // various /config/os/* files.
908 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
909 + : ctype<char>(0, false, __refs)
911 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
913 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
914 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
915 +#ifdef __UCLIBC_HAS_XLOCALE__
916 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
917 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
918 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
923 +#ifdef _GLIBCXX_USE_WCHAR_T
924 + ctype<wchar_t>::__wmask_type
925 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
927 + __wmask_type __ret;
931 + __ret = __wctype_l("space", _M_c_locale_ctype);
934 + __ret = __wctype_l("print", _M_c_locale_ctype);
937 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
940 + __ret = __wctype_l("upper", _M_c_locale_ctype);
943 + __ret = __wctype_l("lower", _M_c_locale_ctype);
946 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
949 + __ret = __wctype_l("digit", _M_c_locale_ctype);
952 + __ret = __wctype_l("punct", _M_c_locale_ctype);
955 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
958 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
961 + __ret = __wctype_l("graph", _M_c_locale_ctype);
970 + ctype<wchar_t>::do_toupper(wchar_t __c) const
971 + { return __towupper_l(__c, _M_c_locale_ctype); }
974 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
976 + while (__lo < __hi)
978 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
985 + ctype<wchar_t>::do_tolower(wchar_t __c) const
986 + { return __towlower_l(__c, _M_c_locale_ctype); }
989 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
991 + while (__lo < __hi)
993 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
1001 + do_is(mask __m, wchar_t __c) const
1003 + // Highest bitmask in ctype_base == 10, but extra in "C"
1004 + // library for blank.
1005 + bool __ret = false;
1006 + const size_t __bitmasksize = 11;
1007 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1008 + if (__m & _M_bit[__bitcur]
1009 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
1019 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
1021 + for (; __lo < __hi; ++__vec, ++__lo)
1023 + // Highest bitmask in ctype_base == 10, but extra in "C"
1024 + // library for blank.
1025 + const size_t __bitmasksize = 11;
1027 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1028 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
1029 + __m |= _M_bit[__bitcur];
1037 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1039 + while (__lo < __hi && !this->do_is(__m, *__lo))
1046 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1048 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1055 + do_widen(char __c) const
1056 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1060 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1062 + while (__lo < __hi)
1064 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1073 + do_narrow(wchar_t __wc, char __dfault) const
1075 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1076 + return _M_narrow[__wc];
1077 +#ifdef __UCLIBC_HAS_XLOCALE__
1078 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1080 + const int __c = wctob(__wc);
1081 +#ifdef __UCLIBC_HAS_XLOCALE__
1082 + __uselocale(__old);
1084 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1089 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1090 + char* __dest) const
1092 +#ifdef __UCLIBC_HAS_XLOCALE__
1093 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1096 + while (__lo < __hi)
1098 + if (*__lo >= 0 && *__lo < 128)
1099 + *__dest = _M_narrow[*__lo];
1102 + const int __c = wctob(*__lo);
1103 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1109 + while (__lo < __hi)
1111 + const int __c = wctob(*__lo);
1112 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1116 +#ifdef __UCLIBC_HAS_XLOCALE__
1117 + __uselocale(__old);
1123 + ctype<wchar_t>::_M_initialize_ctype()
1125 +#ifdef __UCLIBC_HAS_XLOCALE__
1126 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1129 + for (__i = 0; __i < 128; ++__i)
1131 + const int __c = wctob(__i);
1135 + _M_narrow[__i] = static_cast<char>(__c);
1138 + _M_narrow_ok = true;
1140 + _M_narrow_ok = false;
1141 + for (size_t __j = 0;
1142 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1143 + _M_widen[__j] = btowc(__j);
1145 + for (size_t __k = 0; __k <= 11; ++__k)
1147 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1148 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1150 +#ifdef __UCLIBC_HAS_XLOCALE__
1151 + __uselocale(__old);
1154 +#endif // _GLIBCXX_USE_WCHAR_T
1157 +++ b/libstdc++-v3/config/locale/uclibc/messages_members.cc
1159 +// std::messages implementation details, GNU version -*- C++ -*-
1161 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1163 +// This file is part of the GNU ISO C++ Library. This library is free
1164 +// software; you can redistribute it and/or modify it under the
1165 +// terms of the GNU General Public License as published by the
1166 +// Free Software Foundation; either version 2, or (at your option)
1167 +// any later version.
1169 +// This library is distributed in the hope that it will be useful,
1170 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1171 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1172 +// GNU General Public License for more details.
1174 +// You should have received a copy of the GNU General Public License along
1175 +// with this library; see the file COPYING. If not, write to the Free
1176 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1179 +// As a special exception, you may use this file as part of a free software
1180 +// library without restriction. Specifically, if other files instantiate
1181 +// templates or use macros or inline functions from this file, or you compile
1182 +// this file and link it with other files to produce an executable, this
1183 +// file does not by itself cause the resulting executable to be covered by
1184 +// the GNU General Public License. This exception does not however
1185 +// invalidate any other reasons why the executable file might be covered by
1186 +// the GNU General Public License.
1189 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1192 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1195 +#include <bits/c++locale_internal.h>
1197 +#ifdef __UCLIBC_MJN3_ONLY__
1198 +#warning fix gettext stuff
1200 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1201 +extern "C" char *__dcgettext(const char *domainname,
1202 + const char *msgid, int category);
1204 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1207 +#define gettext(msgid) (msgid)
1212 + // Specializations.
1215 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1217 +#ifdef __UCLIBC_HAS_XLOCALE__
1218 + __c_locale __old = __uselocale(_M_c_locale_messages);
1219 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1220 + __uselocale(__old);
1221 + return string(__msg);
1222 +#elif defined __UCLIBC_HAS_LOCALE__
1223 + char* __old = strdup(setlocale(LC_ALL, NULL));
1224 + setlocale(LC_ALL, _M_name_messages);
1225 + const char* __msg = gettext(__dfault.c_str());
1226 + setlocale(LC_ALL, __old);
1228 + return string(__msg);
1230 + const char* __msg = gettext(__dfault.c_str());
1231 + return string(__msg);
1235 +#ifdef _GLIBCXX_USE_WCHAR_T
1238 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1240 +# ifdef __UCLIBC_HAS_XLOCALE__
1241 + __c_locale __old = __uselocale(_M_c_locale_messages);
1242 + char* __msg = gettext(_M_convert_to_char(__dfault));
1243 + __uselocale(__old);
1244 + return _M_convert_from_char(__msg);
1245 +# elif defined __UCLIBC_HAS_LOCALE__
1246 + char* __old = strdup(setlocale(LC_ALL, NULL));
1247 + setlocale(LC_ALL, _M_name_messages);
1248 + char* __msg = gettext(_M_convert_to_char(__dfault));
1249 + setlocale(LC_ALL, __old);
1251 + return _M_convert_from_char(__msg);
1253 + char* __msg = gettext(_M_convert_to_char(__dfault));
1254 + return _M_convert_from_char(__msg);
1260 +++ b/libstdc++-v3/config/locale/uclibc/messages_members.h
1262 +// std::messages implementation details, GNU version -*- C++ -*-
1264 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1266 +// This file is part of the GNU ISO C++ Library. This library is free
1267 +// software; you can redistribute it and/or modify it under the
1268 +// terms of the GNU General Public License as published by the
1269 +// Free Software Foundation; either version 2, or (at your option)
1270 +// any later version.
1272 +// This library is distributed in the hope that it will be useful,
1273 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1274 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1275 +// GNU General Public License for more details.
1277 +// You should have received a copy of the GNU General Public License along
1278 +// with this library; see the file COPYING. If not, write to the Free
1279 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1282 +// As a special exception, you may use this file as part of a free software
1283 +// library without restriction. Specifically, if other files instantiate
1284 +// templates or use macros or inline functions from this file, or you compile
1285 +// this file and link it with other files to produce an executable, this
1286 +// file does not by itself cause the resulting executable to be covered by
1287 +// the GNU General Public License. This exception does not however
1288 +// invalidate any other reasons why the executable file might be covered by
1289 +// the GNU General Public License.
1292 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1295 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1297 +#ifdef __UCLIBC_MJN3_ONLY__
1298 +#warning fix prototypes for *textdomain funcs
1300 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1301 +extern "C" char *__textdomain(const char *domainname);
1302 +extern "C" char *__bindtextdomain(const char *domainname,
1303 + const char *dirname);
1305 +#undef __textdomain
1306 +#undef __bindtextdomain
1307 +#define __textdomain(D) ((void)0)
1308 +#define __bindtextdomain(D,P) ((void)0)
1311 + // Non-virtual member functions.
1312 + template<typename _CharT>
1313 + messages<_CharT>::messages(size_t __refs)
1314 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1315 + _M_name_messages(_S_get_c_name())
1318 + template<typename _CharT>
1319 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1321 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1322 + _M_name_messages(__s)
1324 + char* __tmp = new char[std::strlen(__s) + 1];
1325 + std::strcpy(__tmp, __s);
1326 + _M_name_messages = __tmp;
1329 + template<typename _CharT>
1330 + typename messages<_CharT>::catalog
1331 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1332 + const char* __dir) const
1334 + __bindtextdomain(__s.c_str(), __dir);
1335 + return this->do_open(__s, __loc);
1338 + // Virtual member functions.
1339 + template<typename _CharT>
1340 + messages<_CharT>::~messages()
1342 + if (_M_name_messages != _S_get_c_name())
1343 + delete [] _M_name_messages;
1344 + _S_destroy_c_locale(_M_c_locale_messages);
1347 + template<typename _CharT>
1348 + typename messages<_CharT>::catalog
1349 + messages<_CharT>::do_open(const basic_string<char>& __s,
1350 + const locale&) const
1352 + // No error checking is done, assume the catalog exists and can
1354 + __textdomain(__s.c_str());
1358 + template<typename _CharT>
1360 + messages<_CharT>::do_close(catalog) const
1363 + // messages_byname
1364 + template<typename _CharT>
1365 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1366 + : messages<_CharT>(__refs)
1368 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1369 + delete [] this->_M_name_messages;
1370 + char* __tmp = new char[std::strlen(__s) + 1];
1371 + std::strcpy(__tmp, __s);
1372 + this->_M_name_messages = __tmp;
1374 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1376 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1377 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1381 +++ b/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1383 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1385 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1387 +// This file is part of the GNU ISO C++ Library. This library is free
1388 +// software; you can redistribute it and/or modify it under the
1389 +// terms of the GNU General Public License as published by the
1390 +// Free Software Foundation; either version 2, or (at your option)
1391 +// any later version.
1393 +// This library is distributed in the hope that it will be useful,
1394 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1395 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1396 +// GNU General Public License for more details.
1398 +// You should have received a copy of the GNU General Public License along
1399 +// with this library; see the file COPYING. If not, write to the Free
1400 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1403 +// As a special exception, you may use this file as part of a free software
1404 +// library without restriction. Specifically, if other files instantiate
1405 +// templates or use macros or inline functions from this file, or you compile
1406 +// this file and link it with other files to produce an executable, this
1407 +// file does not by itself cause the resulting executable to be covered by
1408 +// the GNU General Public License. This exception does not however
1409 +// invalidate any other reasons why the executable file might be covered by
1410 +// the GNU General Public License.
1413 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1416 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1421 +#include <bits/c++locale_internal.h>
1423 +#ifdef __UCLIBC_MJN3_ONLY__
1424 +#warning optimize this for uclibc
1425 +#warning tailor for stub locale support
1428 +#ifndef __UCLIBC_HAS_XLOCALE__
1429 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1434 + // Construct and return valid pattern consisting of some combination of:
1435 + // space none symbol sign value
1436 + money_base::pattern
1437 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1441 + // This insanely complicated routine attempts to construct a valid
1442 + // pattern for use with monyepunct. A couple of invariants:
1444 + // if (__precedes) symbol -> value
1445 + // else value -> symbol
1447 + // if (__space) space
1450 + // none == never first
1451 + // space never first or last
1453 + // Any elegant implementations of this are welcome.
1458 + // 1 The sign precedes the value and symbol.
1459 + __ret.field[0] = sign;
1462 + // Pattern starts with sign.
1465 + __ret.field[1] = symbol;
1466 + __ret.field[3] = value;
1470 + __ret.field[1] = value;
1471 + __ret.field[3] = symbol;
1473 + __ret.field[2] = space;
1477 + // Pattern starts with sign and ends with none.
1480 + __ret.field[1] = symbol;
1481 + __ret.field[2] = value;
1485 + __ret.field[1] = value;
1486 + __ret.field[2] = symbol;
1488 + __ret.field[3] = none;
1492 + // 2 The sign follows the value and symbol.
1495 + // Pattern either ends with sign.
1498 + __ret.field[0] = symbol;
1499 + __ret.field[2] = value;
1503 + __ret.field[0] = value;
1504 + __ret.field[2] = symbol;
1506 + __ret.field[1] = space;
1507 + __ret.field[3] = sign;
1511 + // Pattern ends with sign then none.
1514 + __ret.field[0] = symbol;
1515 + __ret.field[1] = value;
1519 + __ret.field[0] = value;
1520 + __ret.field[1] = symbol;
1522 + __ret.field[2] = sign;
1523 + __ret.field[3] = none;
1527 + // 3 The sign immediately precedes the symbol.
1530 + __ret.field[0] = sign;
1531 + __ret.field[1] = symbol;
1534 + __ret.field[2] = space;
1535 + __ret.field[3] = value;
1539 + __ret.field[2] = value;
1540 + __ret.field[3] = none;
1545 + __ret.field[0] = value;
1548 + __ret.field[1] = space;
1549 + __ret.field[2] = sign;
1550 + __ret.field[3] = symbol;
1554 + __ret.field[1] = sign;
1555 + __ret.field[2] = symbol;
1556 + __ret.field[3] = none;
1561 + // 4 The sign immediately follows the symbol.
1564 + __ret.field[0] = symbol;
1565 + __ret.field[1] = sign;
1568 + __ret.field[2] = space;
1569 + __ret.field[3] = value;
1573 + __ret.field[2] = value;
1574 + __ret.field[3] = none;
1579 + __ret.field[0] = value;
1582 + __ret.field[1] = space;
1583 + __ret.field[2] = symbol;
1584 + __ret.field[3] = sign;
1588 + __ret.field[1] = symbol;
1589 + __ret.field[2] = sign;
1590 + __ret.field[3] = none;
1602 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1606 + _M_data = new __moneypunct_cache<char, true>;
1611 + _M_data->_M_decimal_point = '.';
1612 + _M_data->_M_thousands_sep = ',';
1613 + _M_data->_M_grouping = "";
1614 + _M_data->_M_grouping_size = 0;
1615 + _M_data->_M_curr_symbol = "";
1616 + _M_data->_M_curr_symbol_size = 0;
1617 + _M_data->_M_positive_sign = "";
1618 + _M_data->_M_positive_sign_size = 0;
1619 + _M_data->_M_negative_sign = "";
1620 + _M_data->_M_negative_sign_size = 0;
1621 + _M_data->_M_frac_digits = 0;
1622 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1623 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1625 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1626 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1631 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1633 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1635 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1636 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1637 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1638 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1640 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1642 + _M_data->_M_negative_sign = "()";
1644 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1646 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1649 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1650 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1651 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1653 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1654 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1655 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1656 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1658 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1659 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1660 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1667 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1671 + _M_data = new __moneypunct_cache<char, false>;
1676 + _M_data->_M_decimal_point = '.';
1677 + _M_data->_M_thousands_sep = ',';
1678 + _M_data->_M_grouping = "";
1679 + _M_data->_M_grouping_size = 0;
1680 + _M_data->_M_curr_symbol = "";
1681 + _M_data->_M_curr_symbol_size = 0;
1682 + _M_data->_M_positive_sign = "";
1683 + _M_data->_M_positive_sign_size = 0;
1684 + _M_data->_M_negative_sign = "";
1685 + _M_data->_M_negative_sign_size = 0;
1686 + _M_data->_M_frac_digits = 0;
1687 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1688 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1690 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1691 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1696 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1698 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1700 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1701 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1702 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1703 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1705 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1707 + _M_data->_M_negative_sign = "()";
1709 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1711 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1714 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1715 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1716 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1717 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1718 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1719 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1720 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1722 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1723 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1724 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1730 + moneypunct<char, true>::~moneypunct()
1731 + { delete _M_data; }
1734 + moneypunct<char, false>::~moneypunct()
1735 + { delete _M_data; }
1737 +#ifdef _GLIBCXX_USE_WCHAR_T
1740 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1741 +#ifdef __UCLIBC_HAS_XLOCALE__
1744 + const char* __name)
1748 + _M_data = new __moneypunct_cache<wchar_t, true>;
1753 + _M_data->_M_decimal_point = L'.';
1754 + _M_data->_M_thousands_sep = L',';
1755 + _M_data->_M_grouping = "";
1756 + _M_data->_M_grouping_size = 0;
1757 + _M_data->_M_curr_symbol = L"";
1758 + _M_data->_M_curr_symbol_size = 0;
1759 + _M_data->_M_positive_sign = L"";
1760 + _M_data->_M_positive_sign_size = 0;
1761 + _M_data->_M_negative_sign = L"";
1762 + _M_data->_M_negative_sign_size = 0;
1763 + _M_data->_M_frac_digits = 0;
1764 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1765 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1767 + // Use ctype::widen code without the facet...
1769 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1771 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1772 + _M_data->_M_atoms[__i] = btowc(uc);
1778 +#ifdef __UCLIBC_HAS_XLOCALE__
1779 + __c_locale __old = __uselocale(__cloc);
1781 + // Switch to named locale so that mbsrtowcs will work.
1782 + char* __old = strdup(setlocale(LC_ALL, NULL));
1783 + setlocale(LC_ALL, __name);
1786 +#ifdef __UCLIBC_MJN3_ONLY__
1787 +#warning fix this... should be monetary
1790 +# ifdef __UCLIBC_HAS_XLOCALE__
1791 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1792 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1794 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1795 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1798 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1799 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1800 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1802 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1803 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1805 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1806 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1808 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1809 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1810 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1812 + wchar_t* __wcs_ps = 0;
1813 + wchar_t* __wcs_ns = 0;
1814 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1817 + mbstate_t __state;
1818 + size_t __len = strlen(__cpossign);
1822 + memset(&__state, 0, sizeof(mbstate_t));
1823 + __wcs_ps = new wchar_t[__len];
1824 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1825 + _M_data->_M_positive_sign = __wcs_ps;
1828 + _M_data->_M_positive_sign = L"";
1829 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1831 + __len = strlen(__cnegsign);
1833 + _M_data->_M_negative_sign = L"()";
1837 + memset(&__state, 0, sizeof(mbstate_t));
1838 + __wcs_ns = new wchar_t[__len];
1839 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1840 + _M_data->_M_negative_sign = __wcs_ns;
1843 + _M_data->_M_negative_sign = L"";
1844 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1847 + __len = strlen(__ccurr);
1851 + memset(&__state, 0, sizeof(mbstate_t));
1852 + wchar_t* __wcs = new wchar_t[__len];
1853 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1854 + _M_data->_M_curr_symbol = __wcs;
1857 + _M_data->_M_curr_symbol = L"";
1858 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1866 +#ifdef __UCLIBC_HAS_XLOCALE__
1867 + __uselocale(__old);
1869 + setlocale(LC_ALL, __old);
1872 + __throw_exception_again;
1875 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1877 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1878 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1879 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1880 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1882 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1883 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1884 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1887 +#ifdef __UCLIBC_HAS_XLOCALE__
1888 + __uselocale(__old);
1890 + setlocale(LC_ALL, __old);
1898 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1899 +#ifdef __UCLIBC_HAS_XLOCALE__
1902 + const char* __name)
1906 + _M_data = new __moneypunct_cache<wchar_t, false>;
1911 + _M_data->_M_decimal_point = L'.';
1912 + _M_data->_M_thousands_sep = L',';
1913 + _M_data->_M_grouping = "";
1914 + _M_data->_M_grouping_size = 0;
1915 + _M_data->_M_curr_symbol = L"";
1916 + _M_data->_M_curr_symbol_size = 0;
1917 + _M_data->_M_positive_sign = L"";
1918 + _M_data->_M_positive_sign_size = 0;
1919 + _M_data->_M_negative_sign = L"";
1920 + _M_data->_M_negative_sign_size = 0;
1921 + _M_data->_M_frac_digits = 0;
1922 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1923 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1925 + // Use ctype::widen code without the facet...
1927 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1929 + uc = static_cast<unsigned char>(money_base::_S_atoms[__i]);
1930 + _M_data->_M_atoms[__i] = btowc(uc);
1936 +#ifdef __UCLIBC_HAS_XLOCALE__
1937 + __c_locale __old = __uselocale(__cloc);
1939 + // Switch to named locale so that mbsrtowcs will work.
1940 + char* __old = strdup(setlocale(LC_ALL, NULL));
1941 + setlocale(LC_ALL, __name);
1944 +#ifdef __UCLIBC_MJN3_ONLY__
1945 +#warning fix this... should be monetary
1948 +# ifdef __UCLIBC_HAS_XLOCALE__
1949 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1950 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1952 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1953 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1956 + union __s_and_w { const char *__s; unsigned int __w; } __u;
1957 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1958 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
1960 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1961 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
1963 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1964 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1966 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1967 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1968 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1970 + wchar_t* __wcs_ps = 0;
1971 + wchar_t* __wcs_ns = 0;
1972 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1975 + mbstate_t __state;
1977 + __len = strlen(__cpossign);
1981 + memset(&__state, 0, sizeof(mbstate_t));
1982 + __wcs_ps = new wchar_t[__len];
1983 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1984 + _M_data->_M_positive_sign = __wcs_ps;
1987 + _M_data->_M_positive_sign = L"";
1988 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1990 + __len = strlen(__cnegsign);
1992 + _M_data->_M_negative_sign = L"()";
1996 + memset(&__state, 0, sizeof(mbstate_t));
1997 + __wcs_ns = new wchar_t[__len];
1998 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1999 + _M_data->_M_negative_sign = __wcs_ns;
2002 + _M_data->_M_negative_sign = L"";
2003 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
2006 + __len = strlen(__ccurr);
2010 + memset(&__state, 0, sizeof(mbstate_t));
2011 + wchar_t* __wcs = new wchar_t[__len];
2012 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2013 + _M_data->_M_curr_symbol = __wcs;
2016 + _M_data->_M_curr_symbol = L"";
2017 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
2025 +#ifdef __UCLIBC_HAS_XLOCALE__
2026 + __uselocale(__old);
2028 + setlocale(LC_ALL, __old);
2031 + __throw_exception_again;
2034 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2035 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2036 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2037 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2038 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2040 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2041 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2042 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2045 +#ifdef __UCLIBC_HAS_XLOCALE__
2046 + __uselocale(__old);
2048 + setlocale(LC_ALL, __old);
2055 + moneypunct<wchar_t, true>::~moneypunct()
2057 + if (_M_data->_M_positive_sign_size)
2058 + delete [] _M_data->_M_positive_sign;
2059 + if (_M_data->_M_negative_sign_size
2060 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2061 + delete [] _M_data->_M_negative_sign;
2062 + if (_M_data->_M_curr_symbol_size)
2063 + delete [] _M_data->_M_curr_symbol;
2068 + moneypunct<wchar_t, false>::~moneypunct()
2070 + if (_M_data->_M_positive_sign_size)
2071 + delete [] _M_data->_M_positive_sign;
2072 + if (_M_data->_M_negative_sign_size
2073 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2074 + delete [] _M_data->_M_negative_sign;
2075 + if (_M_data->_M_curr_symbol_size)
2076 + delete [] _M_data->_M_curr_symbol;
2082 +++ b/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2084 +// std::numpunct implementation details, GNU version -*- C++ -*-
2086 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2088 +// This file is part of the GNU ISO C++ Library. This library is free
2089 +// software; you can redistribute it and/or modify it under the
2090 +// terms of the GNU General Public License as published by the
2091 +// Free Software Foundation; either version 2, or (at your option)
2092 +// any later version.
2094 +// This library is distributed in the hope that it will be useful,
2095 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2096 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2097 +// GNU General Public License for more details.
2099 +// You should have received a copy of the GNU General Public License along
2100 +// with this library; see the file COPYING. If not, write to the Free
2101 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2104 +// As a special exception, you may use this file as part of a free software
2105 +// library without restriction. Specifically, if other files instantiate
2106 +// templates or use macros or inline functions from this file, or you compile
2107 +// this file and link it with other files to produce an executable, this
2108 +// file does not by itself cause the resulting executable to be covered by
2109 +// the GNU General Public License. This exception does not however
2110 +// invalidate any other reasons why the executable file might be covered by
2111 +// the GNU General Public License.
2114 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2117 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2122 +#include <bits/c++locale_internal.h>
2124 +#ifdef __UCLIBC_MJN3_ONLY__
2125 +#warning tailor for stub locale support
2127 +#ifndef __UCLIBC_HAS_XLOCALE__
2128 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2135 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2138 + _M_data = new __numpunct_cache<char>;
2143 + _M_data->_M_grouping = "";
2144 + _M_data->_M_grouping_size = 0;
2145 + _M_data->_M_use_grouping = false;
2147 + _M_data->_M_decimal_point = '.';
2148 + _M_data->_M_thousands_sep = ',';
2150 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2151 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2153 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2154 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2159 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2161 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2164 + // Check for NULL, which implies no grouping.
2165 + if (_M_data->_M_thousands_sep == '\0')
2166 + _M_data->_M_grouping = "";
2168 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2169 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2172 + // NB: There is no way to extact this info from posix locales.
2173 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2174 + _M_data->_M_truename = "true";
2175 + _M_data->_M_truename_size = strlen(_M_data->_M_truename);
2176 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2177 + _M_data->_M_falsename = "false";
2178 + _M_data->_M_falsename_size = strlen(_M_data->_M_falsename);
2182 + numpunct<char>::~numpunct()
2183 + { delete _M_data; }
2185 +#ifdef _GLIBCXX_USE_WCHAR_T
2188 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2191 + _M_data = new __numpunct_cache<wchar_t>;
2196 + _M_data->_M_grouping = "";
2197 + _M_data->_M_grouping_size = 0;
2198 + _M_data->_M_use_grouping = false;
2200 + _M_data->_M_decimal_point = L'.';
2201 + _M_data->_M_thousands_sep = L',';
2203 +#ifdef __UCLIBC_HAS_XLOCALE__
2204 + __c_locale __old = __uselocale(_S_get_c_locale());
2206 + // Use ctype::widen code without the facet...
2208 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2210 + uc = static_cast<unsigned char>(__num_base::_S_atoms_out[__i]);
2211 + _M_data->_M_atoms_out[__i] = btowc(uc);
2214 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2216 + uc = static_cast<unsigned char>(__num_base::_S_atoms_in[__j]);
2217 + _M_data->_M_atoms_in[__j] = btowc(uc);
2219 +#ifdef __UCLIBC_HAS_XLOCALE__
2220 + __uselocale(__old);
2226 +#ifdef __UCLIBC_MJN3_ONLY__
2230 +# ifdef __UCLIBC_HAS_XLOCALE__
2231 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2232 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2234 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2235 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2238 + union __s_and_w { const char *__s; unsigned int __w; } __u;
2239 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2240 + _M_data->_M_decimal_point = static_cast<wchar_t>(__u.__w);
2242 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2243 + _M_data->_M_thousands_sep = static_cast<wchar_t>(__u.__w);
2246 + if (_M_data->_M_thousands_sep == L'\0')
2247 + _M_data->_M_grouping = "";
2249 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2250 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2253 + // NB: There is no way to extact this info from posix locales.
2254 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2255 + _M_data->_M_truename = L"true";
2256 + _M_data->_M_truename_size = wcslen(_M_data->_M_truename);
2257 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2258 + _M_data->_M_falsename = L"false";
2259 + _M_data->_M_falsename_size = wcslen(_M_data->_M_falsename);
2263 + numpunct<wchar_t>::~numpunct()
2264 + { delete _M_data; }
2268 +++ b/libstdc++-v3/config/locale/uclibc/time_members.cc
2270 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2272 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2274 +// This file is part of the GNU ISO C++ Library. This library is free
2275 +// software; you can redistribute it and/or modify it under the
2276 +// terms of the GNU General Public License as published by the
2277 +// Free Software Foundation; either version 2, or (at your option)
2278 +// any later version.
2280 +// This library is distributed in the hope that it will be useful,
2281 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2282 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2283 +// GNU General Public License for more details.
2285 +// You should have received a copy of the GNU General Public License along
2286 +// with this library; see the file COPYING. If not, write to the Free
2287 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2290 +// As a special exception, you may use this file as part of a free software
2291 +// library without restriction. Specifically, if other files instantiate
2292 +// templates or use macros or inline functions from this file, or you compile
2293 +// this file and link it with other files to produce an executable, this
2294 +// file does not by itself cause the resulting executable to be covered by
2295 +// the GNU General Public License. This exception does not however
2296 +// invalidate any other reasons why the executable file might be covered by
2297 +// the GNU General Public License.
2300 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2301 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2304 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2307 +#include <bits/c++locale_internal.h>
2309 +#ifdef __UCLIBC_MJN3_ONLY__
2310 +#warning tailor for stub locale support
2312 +#ifndef __UCLIBC_HAS_XLOCALE__
2313 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2320 + __timepunct<char>::
2321 + _M_put(char* __s, size_t __maxlen, const char* __format,
2322 + const tm* __tm) const
2324 +#ifdef __UCLIBC_HAS_XLOCALE__
2325 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2326 + _M_c_locale_timepunct);
2328 + char* __old = strdup(setlocale(LC_ALL, NULL));
2329 + setlocale(LC_ALL, _M_name_timepunct);
2330 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2331 + setlocale(LC_ALL, __old);
2334 + // Make sure __s is null terminated.
2341 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2344 + _M_data = new __timepunct_cache<char>;
2349 + _M_c_locale_timepunct = _S_get_c_locale();
2351 + _M_data->_M_date_format = "%m/%d/%y";
2352 + _M_data->_M_date_era_format = "%m/%d/%y";
2353 + _M_data->_M_time_format = "%H:%M:%S";
2354 + _M_data->_M_time_era_format = "%H:%M:%S";
2355 + _M_data->_M_date_time_format = "";
2356 + _M_data->_M_date_time_era_format = "";
2357 + _M_data->_M_am = "AM";
2358 + _M_data->_M_pm = "PM";
2359 + _M_data->_M_am_pm_format = "";
2361 + // Day names, starting with "C"'s Sunday.
2362 + _M_data->_M_day1 = "Sunday";
2363 + _M_data->_M_day2 = "Monday";
2364 + _M_data->_M_day3 = "Tuesday";
2365 + _M_data->_M_day4 = "Wednesday";
2366 + _M_data->_M_day5 = "Thursday";
2367 + _M_data->_M_day6 = "Friday";
2368 + _M_data->_M_day7 = "Saturday";
2370 + // Abbreviated day names, starting with "C"'s Sun.
2371 + _M_data->_M_aday1 = "Sun";
2372 + _M_data->_M_aday2 = "Mon";
2373 + _M_data->_M_aday3 = "Tue";
2374 + _M_data->_M_aday4 = "Wed";
2375 + _M_data->_M_aday5 = "Thu";
2376 + _M_data->_M_aday6 = "Fri";
2377 + _M_data->_M_aday7 = "Sat";
2379 + // Month names, starting with "C"'s January.
2380 + _M_data->_M_month01 = "January";
2381 + _M_data->_M_month02 = "February";
2382 + _M_data->_M_month03 = "March";
2383 + _M_data->_M_month04 = "April";
2384 + _M_data->_M_month05 = "May";
2385 + _M_data->_M_month06 = "June";
2386 + _M_data->_M_month07 = "July";
2387 + _M_data->_M_month08 = "August";
2388 + _M_data->_M_month09 = "September";
2389 + _M_data->_M_month10 = "October";
2390 + _M_data->_M_month11 = "November";
2391 + _M_data->_M_month12 = "December";
2393 + // Abbreviated month names, starting with "C"'s Jan.
2394 + _M_data->_M_amonth01 = "Jan";
2395 + _M_data->_M_amonth02 = "Feb";
2396 + _M_data->_M_amonth03 = "Mar";
2397 + _M_data->_M_amonth04 = "Apr";
2398 + _M_data->_M_amonth05 = "May";
2399 + _M_data->_M_amonth06 = "Jun";
2400 + _M_data->_M_amonth07 = "Jul";
2401 + _M_data->_M_amonth08 = "Aug";
2402 + _M_data->_M_amonth09 = "Sep";
2403 + _M_data->_M_amonth10 = "Oct";
2404 + _M_data->_M_amonth11 = "Nov";
2405 + _M_data->_M_amonth12 = "Dec";
2409 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2411 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2412 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2413 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2414 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2415 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2416 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
2417 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2418 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2419 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2421 + // Day names, starting with "C"'s Sunday.
2422 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2423 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2424 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2425 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2426 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2427 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2428 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2430 + // Abbreviated day names, starting with "C"'s Sun.
2431 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2432 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2433 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2434 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2435 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2436 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2437 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2439 + // Month names, starting with "C"'s January.
2440 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2441 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2442 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2443 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2444 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2445 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2446 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2447 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2448 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2449 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2450 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2451 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2453 + // Abbreviated month names, starting with "C"'s Jan.
2454 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2455 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2456 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2457 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2458 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2459 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2460 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2461 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2462 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2463 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2464 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2465 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2469 +#ifdef _GLIBCXX_USE_WCHAR_T
2472 + __timepunct<wchar_t>::
2473 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2474 + const tm* __tm) const
2476 +#ifdef __UCLIBC_HAS_XLOCALE__
2477 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2478 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2479 + _M_c_locale_timepunct);
2481 + char* __old = strdup(setlocale(LC_ALL, NULL));
2482 + setlocale(LC_ALL, _M_name_timepunct);
2483 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2484 + setlocale(LC_ALL, __old);
2487 + // Make sure __s is null terminated.
2494 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2497 + _M_data = new __timepunct_cache<wchar_t>;
2499 +#warning wide time stuff
2503 + _M_c_locale_timepunct = _S_get_c_locale();
2505 + _M_data->_M_date_format = L"%m/%d/%y";
2506 + _M_data->_M_date_era_format = L"%m/%d/%y";
2507 + _M_data->_M_time_format = L"%H:%M:%S";
2508 + _M_data->_M_time_era_format = L"%H:%M:%S";
2509 + _M_data->_M_date_time_format = L"";
2510 + _M_data->_M_date_time_era_format = L"";
2511 + _M_data->_M_am = L"AM";
2512 + _M_data->_M_pm = L"PM";
2513 + _M_data->_M_am_pm_format = L"";
2515 + // Day names, starting with "C"'s Sunday.
2516 + _M_data->_M_day1 = L"Sunday";
2517 + _M_data->_M_day2 = L"Monday";
2518 + _M_data->_M_day3 = L"Tuesday";
2519 + _M_data->_M_day4 = L"Wednesday";
2520 + _M_data->_M_day5 = L"Thursday";
2521 + _M_data->_M_day6 = L"Friday";
2522 + _M_data->_M_day7 = L"Saturday";
2524 + // Abbreviated day names, starting with "C"'s Sun.
2525 + _M_data->_M_aday1 = L"Sun";
2526 + _M_data->_M_aday2 = L"Mon";
2527 + _M_data->_M_aday3 = L"Tue";
2528 + _M_data->_M_aday4 = L"Wed";
2529 + _M_data->_M_aday5 = L"Thu";
2530 + _M_data->_M_aday6 = L"Fri";
2531 + _M_data->_M_aday7 = L"Sat";
2533 + // Month names, starting with "C"'s January.
2534 + _M_data->_M_month01 = L"January";
2535 + _M_data->_M_month02 = L"February";
2536 + _M_data->_M_month03 = L"March";
2537 + _M_data->_M_month04 = L"April";
2538 + _M_data->_M_month05 = L"May";
2539 + _M_data->_M_month06 = L"June";
2540 + _M_data->_M_month07 = L"July";
2541 + _M_data->_M_month08 = L"August";
2542 + _M_data->_M_month09 = L"September";
2543 + _M_data->_M_month10 = L"October";
2544 + _M_data->_M_month11 = L"November";
2545 + _M_data->_M_month12 = L"December";
2547 + // Abbreviated month names, starting with "C"'s Jan.
2548 + _M_data->_M_amonth01 = L"Jan";
2549 + _M_data->_M_amonth02 = L"Feb";
2550 + _M_data->_M_amonth03 = L"Mar";
2551 + _M_data->_M_amonth04 = L"Apr";
2552 + _M_data->_M_amonth05 = L"May";
2553 + _M_data->_M_amonth06 = L"Jun";
2554 + _M_data->_M_amonth07 = L"Jul";
2555 + _M_data->_M_amonth08 = L"Aug";
2556 + _M_data->_M_amonth09 = L"Sep";
2557 + _M_data->_M_amonth10 = L"Oct";
2558 + _M_data->_M_amonth11 = L"Nov";
2559 + _M_data->_M_amonth12 = L"Dec";
2564 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2566 + _M_data->_M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
2567 + _M_data->_M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
2568 + _M_data->_M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
2569 + _M_data->_M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
2570 + _M_data->_M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
2571 + _M_data->_M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
2572 + _M_data->_M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
2573 + _M_data->_M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
2574 + _M_data->_M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
2576 + // Day names, starting with "C"'s Sunday.
2577 + _M_data->_M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
2578 + _M_data->_M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
2579 + _M_data->_M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
2580 + _M_data->_M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
2581 + _M_data->_M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
2582 + _M_data->_M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
2583 + _M_data->_M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
2585 + // Abbreviated day names, starting with "C"'s Sun.
2586 + _M_data->_M_aday1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
2587 + _M_data->_M_aday2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
2588 + _M_data->_M_aday3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
2589 + _M_data->_M_aday4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
2590 + _M_data->_M_aday5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
2591 + _M_data->_M_aday6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
2592 + _M_data->_M_aday7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
2594 + // Month names, starting with "C"'s January.
2595 + _M_data->_M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
2596 + _M_data->_M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
2597 + _M_data->_M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
2598 + _M_data->_M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
2599 + _M_data->_M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
2600 + _M_data->_M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
2601 + _M_data->_M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
2602 + _M_data->_M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
2603 + _M_data->_M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
2604 + _M_data->_M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
2605 + _M_data->_M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
2606 + _M_data->_M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
2608 + // Abbreviated month names, starting with "C"'s Jan.
2609 + _M_data->_M_amonth01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
2610 + _M_data->_M_amonth02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
2611 + _M_data->_M_amonth03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
2612 + _M_data->_M_amonth04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
2613 + _M_data->_M_amonth05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
2614 + _M_data->_M_amonth06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
2615 + _M_data->_M_amonth07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
2616 + _M_data->_M_amonth08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
2617 + _M_data->_M_amonth09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
2618 + _M_data->_M_amonth10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
2619 + _M_data->_M_amonth11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
2620 + _M_data->_M_amonth12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
2627 +++ b/libstdc++-v3/config/locale/uclibc/time_members.h
2629 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2631 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2633 +// This file is part of the GNU ISO C++ Library. This library is free
2634 +// software; you can redistribute it and/or modify it under the
2635 +// terms of the GNU General Public License as published by the
2636 +// Free Software Foundation; either version 2, or (at your option)
2637 +// any later version.
2639 +// This library is distributed in the hope that it will be useful,
2640 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2641 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2642 +// GNU General Public License for more details.
2644 +// You should have received a copy of the GNU General Public License along
2645 +// with this library; see the file COPYING. If not, write to the Free
2646 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2649 +// As a special exception, you may use this file as part of a free software
2650 +// library without restriction. Specifically, if other files instantiate
2651 +// templates or use macros or inline functions from this file, or you compile
2652 +// this file and link it with other files to produce an executable, this
2653 +// file does not by itself cause the resulting executable to be covered by
2654 +// the GNU General Public License. This exception does not however
2655 +// invalidate any other reasons why the executable file might be covered by
2656 +// the GNU General Public License.
2659 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2660 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2663 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2665 + template<typename _CharT>
2666 + __timepunct<_CharT>::__timepunct(size_t __refs)
2667 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2668 + _M_name_timepunct(_S_get_c_name())
2669 + { _M_initialize_timepunct(); }
2671 + template<typename _CharT>
2672 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2673 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2674 + _M_name_timepunct(_S_get_c_name())
2675 + { _M_initialize_timepunct(); }
2677 + template<typename _CharT>
2678 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2680 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2681 + _M_name_timepunct(__s)
2683 + char* __tmp = new char[std::strlen(__s) + 1];
2684 + std::strcpy(__tmp, __s);
2685 + _M_name_timepunct = __tmp;
2686 + _M_initialize_timepunct(__cloc);
2689 + template<typename _CharT>
2690 + __timepunct<_CharT>::~__timepunct()
2692 + if (_M_name_timepunct != _S_get_c_name())
2693 + delete [] _M_name_timepunct;
2695 + _S_destroy_c_locale(_M_c_locale_timepunct);
2698 +++ b/libstdc++-v3/config/os/uclibc/ctype_base.h
2700 +// Locale support -*- C++ -*-
2702 +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003
2703 +// Free Software Foundation, Inc.
2705 +// This file is part of the GNU ISO C++ Library. This library is free
2706 +// software; you can redistribute it and/or modify it under the
2707 +// terms of the GNU General Public License as published by the
2708 +// Free Software Foundation; either version 2, or (at your option)
2709 +// any later version.
2711 +// This library is distributed in the hope that it will be useful,
2712 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2713 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2714 +// GNU General Public License for more details.
2716 +// You should have received a copy of the GNU General Public License along
2717 +// with this library; see the file COPYING. If not, write to the Free
2718 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2721 +// As a special exception, you may use this file as part of a free software
2722 +// library without restriction. Specifically, if other files instantiate
2723 +// templates or use macros or inline functions from this file, or you compile
2724 +// this file and link it with other files to produce an executable, this
2725 +// file does not by itself cause the resulting executable to be covered by
2726 +// the GNU General Public License. This exception does not however
2727 +// invalidate any other reasons why the executable file might be covered by
2728 +// the GNU General Public License.
2731 +// ISO C++ 14882: 22.1 Locales
2734 +// Information as gleaned from /usr/include/ctype.h
2738 + // Note: In uClibc, the following two types depend on configuration.
2740 + // Non-standard typedefs.
2741 + typedef const __ctype_touplow_t* __to_type;
2743 + // NB: Offsets into ctype<char>::_M_table force a particular size
2744 + // on the mask type. Because of this, we don't use an enum.
2745 + typedef __ctype_mask_t mask;
2746 + static const mask upper = _ISupper;
2747 + static const mask lower = _ISlower;
2748 + static const mask alpha = _ISalpha;
2749 + static const mask digit = _ISdigit;
2750 + static const mask xdigit = _ISxdigit;
2751 + static const mask space = _ISspace;
2752 + static const mask print = _ISprint;
2753 + static const mask graph = _ISalpha | _ISdigit | _ISpunct;
2754 + static const mask cntrl = _IScntrl;
2755 + static const mask punct = _ISpunct;
2756 + static const mask alnum = _ISalpha | _ISdigit;
2759 +++ b/libstdc++-v3/config/os/uclibc/ctype_inline.h
2761 +// Locale support -*- C++ -*-
2763 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2765 +// This file is part of the GNU ISO C++ Library. This library is free
2766 +// software; you can redistribute it and/or modify it under the
2767 +// terms of the GNU General Public License as published by the
2768 +// Free Software Foundation; either version 2, or (at your option)
2769 +// any later version.
2771 +// This library is distributed in the hope that it will be useful,
2772 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2773 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2774 +// GNU General Public License for more details.
2776 +// You should have received a copy of the GNU General Public License along
2777 +// with this library; see the file COPYING. If not, write to the Free
2778 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2781 +// As a special exception, you may use this file as part of a free software
2782 +// library without restriction. Specifically, if other files instantiate
2783 +// templates or use macros or inline functions from this file, or you compile
2784 +// this file and link it with other files to produce an executable, this
2785 +// file does not by itself cause the resulting executable to be covered by
2786 +// the GNU General Public License. This exception does not however
2787 +// invalidate any other reasons why the executable file might be covered by
2788 +// the GNU General Public License.
2791 +// ISO C++ 14882: 22.1 Locales
2794 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2795 +// functions go in ctype.cc
2799 + is(mask __m, char __c) const
2800 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2804 + is(const char* __low, const char* __high, mask* __vec) const
2806 + while (__low < __high)
2807 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2813 + scan_is(mask __m, const char* __low, const char* __high) const
2815 + while (__low < __high
2816 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2823 + scan_not(mask __m, const char* __low, const char* __high) const
2825 + while (__low < __high
2826 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2831 +++ b/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2833 +// Locale support -*- C++ -*-
2835 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
2836 +// Free Software Foundation, Inc.
2838 +// This file is part of the GNU ISO C++ Library. This library is free
2839 +// software; you can redistribute it and/or modify it under the
2840 +// terms of the GNU General Public License as published by the
2841 +// Free Software Foundation; either version 2, or (at your option)
2842 +// any later version.
2844 +// This library is distributed in the hope that it will be useful,
2845 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2846 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2847 +// GNU General Public License for more details.
2849 +// You should have received a copy of the GNU General Public License along
2850 +// with this library; see the file COPYING. If not, write to the Free
2851 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2854 +// As a special exception, you may use this file as part of a free software
2855 +// library without restriction. Specifically, if other files instantiate
2856 +// templates or use macros or inline functions from this file, or you compile
2857 +// this file and link it with other files to produce an executable, this
2858 +// file does not by itself cause the resulting executable to be covered by
2859 +// the GNU General Public License. This exception does not however
2860 +// invalidate any other reasons why the executable file might be covered by
2861 +// the GNU General Public License.
2864 +// ISO C++ 14882: 22.1 Locales
2867 +// Information as gleaned from /usr/include/ctype.h
2869 + const ctype_base::mask*
2870 + ctype<char>::classic_table() throw()
2871 + { return __C_ctype_b; }
2873 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2875 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2876 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2878 + _M_toupper = __C_ctype_toupper;
2879 + _M_tolower = __C_ctype_tolower;
2880 + _M_table = __table ? __table : __C_ctype_b;
2881 + memset(_M_widen, 0, sizeof(_M_widen));
2882 + memset(_M_narrow, 0, sizeof(_M_narrow));
2885 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
2886 + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
2887 + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
2889 + _M_toupper = __C_ctype_toupper;
2890 + _M_tolower = __C_ctype_tolower;
2891 + _M_table = __table ? __table : __C_ctype_b;
2892 + memset(_M_widen, 0, sizeof(_M_widen));
2893 + memset(_M_narrow, 0, sizeof(_M_narrow));
2897 + ctype<char>::do_toupper(char __c) const
2898 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2901 + ctype<char>::do_toupper(char* __low, const char* __high) const
2903 + while (__low < __high)
2905 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2912 + ctype<char>::do_tolower(char __c) const
2913 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2916 + ctype<char>::do_tolower(char* __low, const char* __high) const
2918 + while (__low < __high)
2920 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2926 +++ b/libstdc++-v3/config/os/uclibc/os_defines.h
2928 +// Specific definitions for GNU/Linux -*- C++ -*-
2930 +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
2932 +// This file is part of the GNU ISO C++ Library. This library is free
2933 +// software; you can redistribute it and/or modify it under the
2934 +// terms of the GNU General Public License as published by the
2935 +// Free Software Foundation; either version 2, or (at your option)
2936 +// any later version.
2938 +// This library is distributed in the hope that it will be useful,
2939 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2940 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2941 +// GNU General Public License for more details.
2943 +// You should have received a copy of the GNU General Public License along
2944 +// with this library; see the file COPYING. If not, write to the Free
2945 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2948 +// As a special exception, you may use this file as part of a free software
2949 +// library without restriction. Specifically, if other files instantiate
2950 +// templates or use macros or inline functions from this file, or you compile
2951 +// this file and link it with other files to produce an executable, this
2952 +// file does not by itself cause the resulting executable to be covered by
2953 +// the GNU General Public License. This exception does not however
2954 +// invalidate any other reasons why the executable file might be covered by
2955 +// the GNU General Public License.
2957 +#ifndef _GLIBCXX_OS_DEFINES
2958 +#define _GLIBCXX_OS_DEFINES 1
2960 +// System-specific #define, typedefs, corrections, etc, go here. This
2961 +// file will come before all others.
2963 +// This keeps isanum, et al from being propagated as macros.
2964 +#define __NO_CTYPE 1
2966 +#include <features.h>
2968 +// We must not see the optimized string functions GNU libc defines.
2969 +#define __NO_STRING_INLINES
2972 --- a/libstdc++-v3/configure
2973 +++ b/libstdc++-v3/configure
2974 @@ -4012,6 +4012,11 @@ linux-gnu*)
2975 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
2979 + lt_cv_deplibs_check_method=pass_all
2980 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
2984 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
2985 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
2986 @@ -5704,6 +5709,9 @@ fi;
2987 # Default to "generic".
2988 if test $enable_clocale_flag = auto; then
2989 case x${target_os} in
2991 + enable_clocale_flag=uclibc
2993 xlinux* | xgnu* | xkfreebsd*-gnu | xknetbsd*-gnu)
2994 cat >conftest.$ac_ext <<_ACEOF
2996 @@ -5916,6 +5924,77 @@ echo "${ECHO_T}IEEE 1003.1" >&6
2997 CTIME_CC=config/locale/generic/time_members.cc
2998 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
3001 + echo "$as_me:$LINENO: result: uclibc" >&5
3002 +echo "${ECHO_T}uclibc" >&6
3004 + # Declare intention to use gettext, and add support for specific
3006 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
3007 + ALL_LINGUAS="de fr"
3009 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
3010 + # Extract the first word of "msgfmt", so it can be a program name with args.
3011 +set dummy msgfmt; ac_word=$2
3012 +echo "$as_me:$LINENO: checking for $ac_word" >&5
3013 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
3014 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
3015 + echo $ECHO_N "(cached) $ECHO_C" >&6
3017 + if test -n "$check_msgfmt"; then
3018 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
3020 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
3021 +for as_dir in $PATH
3024 + test -z "$as_dir" && as_dir=.
3025 + for ac_exec_ext in '' $ac_executable_extensions; do
3026 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
3027 + ac_cv_prog_check_msgfmt="yes"
3028 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
3034 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
3037 +check_msgfmt=$ac_cv_prog_check_msgfmt
3038 +if test -n "$check_msgfmt"; then
3039 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
3040 +echo "${ECHO_T}$check_msgfmt" >&6
3042 + echo "$as_me:$LINENO: result: no" >&5
3043 +echo "${ECHO_T}no" >&6
3046 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
3049 + # Export the build objects.
3050 + for ling in $ALL_LINGUAS; do \
3051 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
3052 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
3057 + CLOCALE_H=config/locale/uclibc/c_locale.h
3058 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
3059 + CCODECVT_H=config/locale/ieee_1003.1-2001/codecvt_specializations.h
3060 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
3061 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
3062 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
3063 + CMESSAGES_H=config/locale/uclibc/messages_members.h
3064 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
3065 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
3066 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
3067 + CTIME_H=config/locale/uclibc/time_members.h
3068 + CTIME_CC=config/locale/uclibc/time_members.cc
3069 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
3073 # This is where the testsuite looks for locale catalogs, using the
3074 --- a/libstdc++-v3/configure.host
3075 +++ b/libstdc++-v3/configure.host
3076 @@ -217,6 +217,12 @@ case "${host_os}" in
3080 +# Override for uClibc since linux-uclibc gets mishandled above.
3081 +case "${host_os}" in
3083 + os_include_dir="os/uclibc"
3087 # Set any OS-dependent and CPU-dependent bits.
3088 # THIS TABLE IS SORTED. KEEP IT THAT WAY.
3089 --- a/libstdc++-v3/crossconfig.m4
3090 +++ b/libstdc++-v3/crossconfig.m4
3091 @@ -138,6 +138,99 @@ case "${host}" in
3096 +# Temporary hack until we implement the float versions of the libm funcs
3097 + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3098 + machine/endian.h machine/param.h sys/machine.h sys/types.h \
3099 + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h])
3100 + SECTION_FLAGS='-ffunction-sections -fdata-sections'
3101 + AC_SUBST(SECTION_FLAGS)
3102 + GLIBCXX_CHECK_LINKER_FEATURES
3103 + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
3104 + GLIBCXX_CHECK_WCHAR_T_SUPPORT
3107 + GLIBCXX_CHECK_INT64_T
3110 + # Don't enable LFS with uClinux
3116 + # For showmanyc_helper().
3117 + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h)
3118 + GLIBCXX_CHECK_POLL
3119 + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG
3122 + AC_CHECK_HEADERS(sys/uio.h)
3123 + GLIBCXX_CHECK_WRITEV
3125 +# AC_DEFINE(HAVE_ACOSF)
3126 +# AC_DEFINE(HAVE_ASINF)
3127 +# AC_DEFINE(HAVE_ATANF)
3128 +# AC_DEFINE(HAVE_ATAN2F)
3129 + AC_DEFINE(HAVE_CEILF)
3130 + AC_DEFINE(HAVE_COPYSIGN)
3131 +# AC_DEFINE(HAVE_COPYSIGNF)
3132 +# AC_DEFINE(HAVE_COSF)
3133 +# AC_DEFINE(HAVE_COSHF)
3134 +# AC_DEFINE(HAVE_EXPF)
3135 +# AC_DEFINE(HAVE_FABSF)
3136 + AC_DEFINE(HAVE_FINITE)
3137 + AC_DEFINE(HAVE_FINITEF)
3138 + AC_DEFINE(HAVE_FLOORF)
3139 +# AC_DEFINE(HAVE_FMODF)
3140 +# AC_DEFINE(HAVE_FREXPF)
3141 + AC_DEFINE(HAVE_HYPOT)
3142 +# AC_DEFINE(HAVE_HYPOTF)
3143 + AC_DEFINE(HAVE_ISINF)
3144 + AC_DEFINE(HAVE_ISINFF)
3145 + AC_DEFINE(HAVE_ISNAN)
3146 + AC_DEFINE(HAVE_ISNANF)
3147 +# AC_DEFINE(HAVE_LOGF)
3148 +# AC_DEFINE(HAVE_LOG10F)
3149 +# AC_DEFINE(HAVE_MODFF)
3150 +# AC_DEFINE(HAVE_SINF)
3151 +# AC_DEFINE(HAVE_SINHF)
3152 +# AC_DEFINE(HAVE_SINCOS)
3153 +# AC_DEFINE(HAVE_SINCOSF)
3154 + AC_DEFINE(HAVE_SQRTF)
3155 +# AC_DEFINE(HAVE_TANF)
3156 +# AC_DEFINE(HAVE_TANHF)
3157 + if test x"long_double_math_on_this_cpu" = x"yes"; then
3158 + AC_MSG_ERROR([long_double_math_on_this_cpu is yes!])
3159 +# AC_DEFINE(HAVE_ACOSL)
3160 +# AC_DEFINE(HAVE_ASINL)
3161 +# AC_DEFINE(HAVE_ATANL)
3162 +# AC_DEFINE(HAVE_ATAN2L)
3163 +# AC_DEFINE(HAVE_CEILL)
3164 +# AC_DEFINE(HAVE_COPYSIGNL)
3165 +# AC_DEFINE(HAVE_COSL)
3166 +# AC_DEFINE(HAVE_COSHL)
3167 +# AC_DEFINE(HAVE_EXPL)
3168 +# AC_DEFINE(HAVE_FABSL)
3169 +# AC_DEFINE(HAVE_FINITEL)
3170 +# AC_DEFINE(HAVE_FLOORL)
3171 +# AC_DEFINE(HAVE_FMODL)
3172 +# AC_DEFINE(HAVE_FREXPL)
3173 +# AC_DEFINE(HAVE_HYPOTL)
3174 +# AC_DEFINE(HAVE_ISINFL)
3175 +# AC_DEFINE(HAVE_ISNANL)
3176 +# AC_DEFINE(HAVE_LOGL)
3177 +# AC_DEFINE(HAVE_LOG10L)
3178 +# AC_DEFINE(HAVE_MODFL)
3179 +# AC_DEFINE(HAVE_POWL)
3180 +# AC_DEFINE(HAVE_SINL)
3181 +# AC_DEFINE(HAVE_SINHL)
3182 +# AC_DEFINE(HAVE_SINCOSL)
3183 +# AC_DEFINE(HAVE_SQRTL)
3184 +# AC_DEFINE(HAVE_TANL)
3185 +# AC_DEFINE(HAVE_TANHL)
3188 *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
3189 AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
3190 machine/endian.h machine/param.h sys/machine.h sys/types.h \
3191 @@ -152,7 +245,7 @@ case "${host}" in
3192 AC_DEFINE(HAVE_INT64_T)
3195 - # Don't enable LFS with uClibc
3196 + # Don't enable LFS with uClinux
3199 AC_DEFINE(_GLIBCXX_USE_LFS)
3200 --- a/libstdc++-v3/include/c_compatibility/wchar.h
3201 +++ b/libstdc++-v3/include/c_compatibility/wchar.h
3202 @@ -101,7 +101,9 @@ using std::wmemcmp;
3204 using std::wmemmove;
3206 +#if _GLIBCXX_HAVE_WCSFTIME
3207 using std::wcsftime;
3210 #if _GLIBCXX_USE_C99
3212 --- a/libstdc++-v3/include/c_std/std_cwchar.h
3213 +++ b/libstdc++-v3/include/c_std/std_cwchar.h
3214 @@ -179,7 +179,9 @@ namespace std
3218 +#if _GLIBCXX_HAVE_WCSFTIME