1 Index: gcc-4.3.2/libstdc++-v3/acinclude.m4
2 ===================================================================
3 --- gcc-4.3.2.orig/libstdc++-v3/acinclude.m4 2008-04-25 09:52:57.000000000 -0700
4 +++ gcc-4.3.2/libstdc++-v3/acinclude.m4 2008-08-28 17:55:56.000000000 -0700
6 AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
7 GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
8 [use MODEL for target locale package],
9 - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
10 + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
12 # Deal with gettext issues. Default to not using it (=no) until we detect
13 # support for it later. Let the user turn it off via --e/d, but let that
15 # Default to "generic".
16 if test $enable_clocale_flag = auto; then
19 + enable_clocale_flag=uclibc
21 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
22 enable_clocale_flag=gnu
24 @@ -1541,6 +1544,40 @@
25 CTIME_CC=config/locale/generic/time_members.cc
26 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
29 + AC_MSG_RESULT(uclibc)
31 + # Declare intention to use gettext, and add support for specific
33 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
36 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
37 + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
38 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
41 + # Export the build objects.
42 + for ling in $ALL_LINGUAS; do \
43 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
44 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
46 + AC_SUBST(glibcxx_MOFILES)
47 + AC_SUBST(glibcxx_POFILES)
49 + CLOCALE_H=config/locale/uclibc/c_locale.h
50 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
51 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
52 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
53 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
54 + CMESSAGES_H=config/locale/uclibc/messages_members.h
55 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
56 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
57 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
58 + CTIME_H=config/locale/uclibc/time_members.h
59 + CTIME_CC=config/locale/uclibc/time_members.cc
60 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
64 # This is where the testsuite looks for locale catalogs, using the
65 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
66 ===================================================================
67 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
68 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-08-28 17:55:56.000000000 -0700
70 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
72 +// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
74 +// This file is part of the GNU ISO C++ Library. This library is free
75 +// software; you can redistribute it and/or modify it under the
76 +// terms of the GNU General Public License as published by the
77 +// Free Software Foundation; either version 2, or (at your option)
78 +// any later version.
80 +// This library is distributed in the hope that it will be useful,
81 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
82 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
83 +// GNU General Public License for more details.
85 +// You should have received a copy of the GNU General Public License along
86 +// with this library; see the file COPYING. If not, write to the Free
87 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
90 +// As a special exception, you may use this file as part of a free software
91 +// library without restriction. Specifically, if other files instantiate
92 +// templates or use macros or inline functions from this file, or you compile
93 +// this file and link it with other files to produce an executable, this
94 +// file does not by itself cause the resulting executable to be covered by
95 +// the GNU General Public License. This exception does not however
96 +// invalidate any other reasons why the executable file might be covered by
97 +// the GNU General Public License.
99 +// Written by Jakub Jelinek <jakub@redhat.com>
101 +#include <bits/c++config.h>
104 +#ifdef __UCLIBC_MJN3_ONLY__
105 +#warning clean this up
108 +#ifdef __UCLIBC_HAS_XLOCALE__
110 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
111 +extern "C" __typeof(strcoll_l) __strcoll_l;
112 +extern "C" __typeof(strftime_l) __strftime_l;
113 +extern "C" __typeof(strtod_l) __strtod_l;
114 +extern "C" __typeof(strtof_l) __strtof_l;
115 +extern "C" __typeof(strtold_l) __strtold_l;
116 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
117 +extern "C" __typeof(newlocale) __newlocale;
118 +extern "C" __typeof(freelocale) __freelocale;
119 +extern "C" __typeof(duplocale) __duplocale;
120 +extern "C" __typeof(uselocale) __uselocale;
122 +#ifdef _GLIBCXX_USE_WCHAR_T
123 +extern "C" __typeof(iswctype_l) __iswctype_l;
124 +extern "C" __typeof(towlower_l) __towlower_l;
125 +extern "C" __typeof(towupper_l) __towupper_l;
126 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
127 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
128 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
129 +extern "C" __typeof(wctype_l) __wctype_l;
132 +#endif // GLIBC 2.3 and later
133 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc
134 ===================================================================
135 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
136 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-08-28 17:55:56.000000000 -0700
138 +// Wrapper for underlying C-language localization -*- C++ -*-
140 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
142 +// This file is part of the GNU ISO C++ Library. This library is free
143 +// software; you can redistribute it and/or modify it under the
144 +// terms of the GNU General Public License as published by the
145 +// Free Software Foundation; either version 2, or (at your option)
146 +// any later version.
148 +// This library is distributed in the hope that it will be useful,
149 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
150 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
151 +// GNU General Public License for more details.
153 +// You should have received a copy of the GNU General Public License along
154 +// with this library; see the file COPYING. If not, write to the Free
155 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
158 +// As a special exception, you may use this file as part of a free software
159 +// library without restriction. Specifically, if other files instantiate
160 +// templates or use macros or inline functions from this file, or you compile
161 +// this file and link it with other files to produce an executable, this
162 +// file does not by itself cause the resulting executable to be covered by
163 +// the GNU General Public License. This exception does not however
164 +// invalidate any other reasons why the executable file might be covered by
165 +// the GNU General Public License.
168 +// ISO C++ 14882: 22.8 Standard locale categories.
171 +// Written by Benjamin Kosnik <bkoz@redhat.com>
173 +#include <cerrno> // For errno
175 +#include <stdexcept>
176 +#include <langinfo.h>
177 +#include <bits/c++locale_internal.h>
179 +#ifndef __UCLIBC_HAS_XLOCALE__
180 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
181 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
182 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
183 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
184 +#define __strtof_l(S, E, L) strtof((S), (E))
185 +#define __strtod_l(S, E, L) strtod((S), (E))
186 +#define __strtold_l(S, E, L) strtold((S), (E))
187 +#warning should dummy __newlocale check for C|POSIX ?
188 +#define __newlocale(a, b, c) NULL
189 +#define __freelocale(a) ((void)0)
190 +#define __duplocale(a) __c_locale()
197 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
198 + const __c_locale& __cloc)
200 + if (!(__err & ios_base::failbit))
204 + float __f = __strtof_l(__s, &__sanity, __cloc);
205 + if (__sanity != __s && errno != ERANGE)
208 + __err |= ios_base::failbit;
214 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
215 + const __c_locale& __cloc)
217 + if (!(__err & ios_base::failbit))
221 + double __d = __strtod_l(__s, &__sanity, __cloc);
222 + if (__sanity != __s && errno != ERANGE)
225 + __err |= ios_base::failbit;
231 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
232 + const __c_locale& __cloc)
234 + if (!(__err & ios_base::failbit))
238 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
239 + if (__sanity != __s && errno != ERANGE)
242 + __err |= ios_base::failbit;
247 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
250 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
251 +#ifdef __UCLIBC_HAS_XLOCALE__
254 + // This named locale is not supported by the underlying OS.
255 + __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
256 + "name not valid"));
262 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
264 + if (_S_get_c_locale() != __cloc)
265 + __freelocale(__cloc);
269 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
270 + { return __duplocale(__cloc); }
275 + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
283 +#if _GLIBCXX_NUM_CATEGORIES != 0
289 + "LC_IDENTIFICATION"
296 + const char* const* const locale::_S_categories = __gnu_cxx::category_names;
298 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h
299 ===================================================================
300 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
301 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-08-28 17:55:56.000000000 -0700
303 +// Wrapper for underlying C-language localization -*- C++ -*-
305 +// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
307 +// This file is part of the GNU ISO C++ Library. This library is free
308 +// software; you can redistribute it and/or modify it under the
309 +// terms of the GNU General Public License as published by the
310 +// Free Software Foundation; either version 2, or (at your option)
311 +// any later version.
313 +// This library is distributed in the hope that it will be useful,
314 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
315 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
316 +// GNU General Public License for more details.
318 +// You should have received a copy of the GNU General Public License along
319 +// with this library; see the file COPYING. If not, write to the Free
320 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
323 +// As a special exception, you may use this file as part of a free software
324 +// library without restriction. Specifically, if other files instantiate
325 +// templates or use macros or inline functions from this file, or you compile
326 +// this file and link it with other files to produce an executable, this
327 +// file does not by itself cause the resulting executable to be covered by
328 +// the GNU General Public License. This exception does not however
329 +// invalidate any other reasons why the executable file might be covered by
330 +// the GNU General Public License.
333 +// ISO C++ 14882: 22.8 Standard locale categories.
336 +// Written by Benjamin Kosnik <bkoz@redhat.com>
339 +#define _C_LOCALE_H 1
341 +#pragma GCC system_header
343 +#include <cstring> // get std::strlen
344 +#include <cstdio> // get std::snprintf or std::sprintf
346 +#include <langinfo.h> // For codecvt
347 +#ifdef __UCLIBC_MJN3_ONLY__
350 +#ifdef __UCLIBC_HAS_LOCALE__
351 +#include <iconv.h> // For codecvt using iconv, iconv_t
353 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
354 +#include <libintl.h> // For messages
357 +#ifdef __UCLIBC_MJN3_ONLY__
358 +#warning what is _GLIBCXX_C_LOCALE_GNU for
360 +#define _GLIBCXX_C_LOCALE_GNU 1
362 +#ifdef __UCLIBC_MJN3_ONLY__
363 +#warning fix categories
365 +// #define _GLIBCXX_NUM_CATEGORIES 6
366 +#define _GLIBCXX_NUM_CATEGORIES 0
368 +#ifdef __UCLIBC_HAS_XLOCALE__
371 + extern "C" __typeof(uselocale) __uselocale;
377 +#ifdef __UCLIBC_HAS_XLOCALE__
378 + typedef __locale_t __c_locale;
380 + typedef int* __c_locale;
383 + // Convert numeric value of type _Tv to string and return length of
384 + // string. If snprintf is available use it, otherwise fall back to
385 + // the unsafe sprintf which, in general, can be dangerous and should
387 + template<typename _Tv>
389 + __convert_from_v(char* __out,
390 + const int __size __attribute__ ((__unused__)),
392 +#ifdef __UCLIBC_HAS_XCLOCALE__
393 + _Tv __v, const __c_locale& __cloc, int __prec)
395 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
397 + _Tv __v, const __c_locale&, int __prec)
399 +# ifdef __UCLIBC_HAS_LOCALE__
400 + char* __old = std::setlocale(LC_ALL, NULL);
401 + char* __sav = new char[std::strlen(__old) + 1];
402 + std::strcpy(__sav, __old);
403 + std::setlocale(LC_ALL, "C");
407 + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
409 +#ifdef __UCLIBC_HAS_XCLOCALE__
410 + __gnu_cxx::__uselocale(__old);
411 +#elif defined __UCLIBC_HAS_LOCALE__
412 + std::setlocale(LC_ALL, __sav);
420 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
421 ===================================================================
422 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
423 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-08-28 17:55:56.000000000 -0700
425 +// std::codecvt implementation details, GNU version -*- C++ -*-
427 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
429 +// This file is part of the GNU ISO C++ Library. This library is free
430 +// software; you can redistribute it and/or modify it under the
431 +// terms of the GNU General Public License as published by the
432 +// Free Software Foundation; either version 2, or (at your option)
433 +// any later version.
435 +// This library is distributed in the hope that it will be useful,
436 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
437 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
438 +// GNU General Public License for more details.
440 +// You should have received a copy of the GNU General Public License along
441 +// with this library; see the file COPYING. If not, write to the Free
442 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
445 +// As a special exception, you may use this file as part of a free software
446 +// library without restriction. Specifically, if other files instantiate
447 +// templates or use macros or inline functions from this file, or you compile
448 +// this file and link it with other files to produce an executable, this
449 +// file does not by itself cause the resulting executable to be covered by
450 +// the GNU General Public License. This exception does not however
451 +// invalidate any other reasons why the executable file might be covered by
452 +// the GNU General Public License.
455 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
458 +// Written by Benjamin Kosnik <bkoz@redhat.com>
461 +#include <cstdlib> // For MB_CUR_MAX
462 +#include <climits> // For MB_LEN_MAX
463 +#include <bits/c++locale_internal.h>
467 + // Specializations.
468 +#ifdef _GLIBCXX_USE_WCHAR_T
469 + codecvt_base::result
470 + codecvt<wchar_t, char, mbstate_t>::
471 + do_out(state_type& __state, const intern_type* __from,
472 + const intern_type* __from_end, const intern_type*& __from_next,
473 + extern_type* __to, extern_type* __to_end,
474 + extern_type*& __to_next) const
477 + state_type __tmp_state(__state);
479 +#ifdef __UCLIBC_HAS_XLOCALE__
480 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
483 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
484 + // in case we fall back to wcrtomb and then continue, in a loop.
485 + // NB: wcsnrtombs is a GNU extension
486 + for (__from_next = __from, __to_next = __to;
487 + __from_next < __from_end && __to_next < __to_end
490 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
491 + __from_end - __from_next);
492 + if (!__from_chunk_end)
493 + __from_chunk_end = __from_end;
495 + __from = __from_next;
496 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
497 + __from_chunk_end - __from_next,
498 + __to_end - __to_next, &__state);
499 + if (__conv == static_cast<size_t>(-1))
501 + // In case of error, in order to stop at the exact place we
502 + // have to start again from the beginning with a series of
504 + for (; __from < __from_next; ++__from)
505 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
506 + __state = __tmp_state;
509 + else if (__from_next && __from_next < __from_chunk_end)
511 + __to_next += __conv;
516 + __from_next = __from_chunk_end;
517 + __to_next += __conv;
520 + if (__from_next < __from_end && __ret == ok)
522 + extern_type __buf[MB_LEN_MAX];
523 + __tmp_state = __state;
524 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
525 + if (__conv > static_cast<size_t>(__to_end - __to_next))
529 + memcpy(__to_next, __buf, __conv);
530 + __state = __tmp_state;
531 + __to_next += __conv;
537 +#ifdef __UCLIBC_HAS_XLOCALE__
538 + __uselocale(__old);
544 + codecvt_base::result
545 + codecvt<wchar_t, char, mbstate_t>::
546 + do_in(state_type& __state, const extern_type* __from,
547 + const extern_type* __from_end, const extern_type*& __from_next,
548 + intern_type* __to, intern_type* __to_end,
549 + intern_type*& __to_next) const
552 + state_type __tmp_state(__state);
554 +#ifdef __UCLIBC_HAS_XLOCALE__
555 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
558 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
559 + // in case we store a L'\0' and then continue, in a loop.
560 + // NB: mbsnrtowcs is a GNU extension
561 + for (__from_next = __from, __to_next = __to;
562 + __from_next < __from_end && __to_next < __to_end
565 + const extern_type* __from_chunk_end;
566 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
569 + if (!__from_chunk_end)
570 + __from_chunk_end = __from_end;
572 + __from = __from_next;
573 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
574 + __from_chunk_end - __from_next,
575 + __to_end - __to_next, &__state);
576 + if (__conv == static_cast<size_t>(-1))
578 + // In case of error, in order to stop at the exact place we
579 + // have to start again from the beginning with a series of
581 + for (;; ++__to_next, __from += __conv)
583 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
585 + if (__conv == static_cast<size_t>(-1)
586 + || __conv == static_cast<size_t>(-2))
589 + __from_next = __from;
590 + __state = __tmp_state;
593 + else if (__from_next && __from_next < __from_chunk_end)
595 + // It is unclear what to return in this case (see DR 382).
596 + __to_next += __conv;
601 + __from_next = __from_chunk_end;
602 + __to_next += __conv;
605 + if (__from_next < __from_end && __ret == ok)
607 + if (__to_next < __to_end)
609 + // XXX Probably wrong for stateful encodings
610 + __tmp_state = __state;
612 + *__to_next++ = L'\0';
619 +#ifdef __UCLIBC_HAS_XLOCALE__
620 + __uselocale(__old);
627 + codecvt<wchar_t, char, mbstate_t>::
628 + do_encoding() const throw()
630 + // XXX This implementation assumes that the encoding is
631 + // stateless and is either single-byte or variable-width.
633 +#ifdef __UCLIBC_HAS_XLOCALE__
634 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
636 + if (MB_CUR_MAX == 1)
638 +#ifdef __UCLIBC_HAS_XLOCALE__
639 + __uselocale(__old);
645 + codecvt<wchar_t, char, mbstate_t>::
646 + do_max_length() const throw()
648 +#ifdef __UCLIBC_HAS_XLOCALE__
649 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
651 + // XXX Probably wrong for stateful encodings.
652 + int __ret = MB_CUR_MAX;
653 +#ifdef __UCLIBC_HAS_XLOCALE__
654 + __uselocale(__old);
660 + codecvt<wchar_t, char, mbstate_t>::
661 + do_length(state_type& __state, const extern_type* __from,
662 + const extern_type* __end, size_t __max) const
665 + state_type __tmp_state(__state);
667 +#ifdef __UCLIBC_HAS_XLOCALE__
668 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
671 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
672 + // in case we advance past it and then continue, in a loop.
673 + // NB: mbsnrtowcs is a GNU extension
675 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
676 + // its fourth parameter (it wouldn't with NULL as first parameter).
677 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
679 + while (__from < __end && __max)
681 + const extern_type* __from_chunk_end;
682 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
685 + if (!__from_chunk_end)
686 + __from_chunk_end = __end;
688 + const extern_type* __tmp_from = __from;
689 + size_t __conv = mbsnrtowcs(__to, &__from,
690 + __from_chunk_end - __from,
692 + if (__conv == static_cast<size_t>(-1))
694 + // In case of error, in order to stop at the exact place we
695 + // have to start again from the beginning with a series of
697 + for (__from = __tmp_from;; __from += __conv)
699 + __conv = mbrtowc(NULL, __from, __end - __from,
701 + if (__conv == static_cast<size_t>(-1)
702 + || __conv == static_cast<size_t>(-2))
705 + __state = __tmp_state;
706 + __ret += __from - __tmp_from;
710 + __from = __from_chunk_end;
712 + __ret += __from - __tmp_from;
715 + if (__from < __end && __max)
717 + // XXX Probably wrong for stateful encodings
718 + __tmp_state = __state;
725 +#ifdef __UCLIBC_HAS_XLOCALE__
726 + __uselocale(__old);
733 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc
734 ===================================================================
735 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
736 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-08-28 17:55:56.000000000 -0700
738 +// std::collate implementation details, GNU version -*- C++ -*-
740 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
742 +// This file is part of the GNU ISO C++ Library. This library is free
743 +// software; you can redistribute it and/or modify it under the
744 +// terms of the GNU General Public License as published by the
745 +// Free Software Foundation; either version 2, or (at your option)
746 +// any later version.
748 +// This library is distributed in the hope that it will be useful,
749 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
750 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
751 +// GNU General Public License for more details.
753 +// You should have received a copy of the GNU General Public License along
754 +// with this library; see the file COPYING. If not, write to the Free
755 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
758 +// As a special exception, you may use this file as part of a free software
759 +// library without restriction. Specifically, if other files instantiate
760 +// templates or use macros or inline functions from this file, or you compile
761 +// this file and link it with other files to produce an executable, this
762 +// file does not by itself cause the resulting executable to be covered by
763 +// the GNU General Public License. This exception does not however
764 +// invalidate any other reasons why the executable file might be covered by
765 +// the GNU General Public License.
768 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
771 +// Written by Benjamin Kosnik <bkoz@redhat.com>
774 +#include <bits/c++locale_internal.h>
776 +#ifndef __UCLIBC_HAS_XLOCALE__
777 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
778 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
779 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
780 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
785 + // These are basically extensions to char_traits, and perhaps should
786 + // be put there instead of here.
789 + collate<char>::_M_compare(const char* __one, const char* __two) const
791 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
792 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
797 + collate<char>::_M_transform(char* __to, const char* __from,
799 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
801 +#ifdef _GLIBCXX_USE_WCHAR_T
804 + collate<wchar_t>::_M_compare(const wchar_t* __one,
805 + const wchar_t* __two) const
807 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
808 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
813 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
815 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
818 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc
819 ===================================================================
820 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
821 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-08-28 17:55:56.000000000 -0700
823 +// std::ctype implementation details, GNU version -*- C++ -*-
825 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
827 +// This file is part of the GNU ISO C++ Library. This library is free
828 +// software; you can redistribute it and/or modify it under the
829 +// terms of the GNU General Public License as published by the
830 +// Free Software Foundation; either version 2, or (at your option)
831 +// any later version.
833 +// This library is distributed in the hope that it will be useful,
834 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
835 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
836 +// GNU General Public License for more details.
838 +// You should have received a copy of the GNU General Public License along
839 +// with this library; see the file COPYING. If not, write to the Free
840 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
843 +// As a special exception, you may use this file as part of a free software
844 +// library without restriction. Specifically, if other files instantiate
845 +// templates or use macros or inline functions from this file, or you compile
846 +// this file and link it with other files to produce an executable, this
847 +// file does not by itself cause the resulting executable to be covered by
848 +// the GNU General Public License. This exception does not however
849 +// invalidate any other reasons why the executable file might be covered by
850 +// the GNU General Public License.
853 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
856 +// Written by Benjamin Kosnik <bkoz@redhat.com>
861 +#include <bits/c++locale_internal.h>
863 +#ifndef __UCLIBC_HAS_XLOCALE__
864 +#define __wctype_l(S, L) wctype((S))
865 +#define __towupper_l(C, L) towupper((C))
866 +#define __towlower_l(C, L) towlower((C))
867 +#define __iswctype_l(C, M, L) iswctype((C), (M))
872 + // NB: The other ctype<char> specializations are in src/locale.cc and
873 + // various /config/os/* files.
875 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
876 + : ctype<char>(0, false, __refs)
878 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
880 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
881 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
882 +#ifdef __UCLIBC_HAS_XLOCALE__
883 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
884 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
885 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
890 +#ifdef _GLIBCXX_USE_WCHAR_T
891 + ctype<wchar_t>::__wmask_type
892 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
894 + __wmask_type __ret;
898 + __ret = __wctype_l("space", _M_c_locale_ctype);
901 + __ret = __wctype_l("print", _M_c_locale_ctype);
904 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
907 + __ret = __wctype_l("upper", _M_c_locale_ctype);
910 + __ret = __wctype_l("lower", _M_c_locale_ctype);
913 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
916 + __ret = __wctype_l("digit", _M_c_locale_ctype);
919 + __ret = __wctype_l("punct", _M_c_locale_ctype);
922 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
925 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
928 + __ret = __wctype_l("graph", _M_c_locale_ctype);
931 + __ret = __wmask_type();
937 + ctype<wchar_t>::do_toupper(wchar_t __c) const
938 + { return __towupper_l(__c, _M_c_locale_ctype); }
941 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
943 + while (__lo < __hi)
945 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
952 + ctype<wchar_t>::do_tolower(wchar_t __c) const
953 + { return __towlower_l(__c, _M_c_locale_ctype); }
956 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
958 + while (__lo < __hi)
960 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
968 + do_is(mask __m, wchar_t __c) const
970 + // Highest bitmask in ctype_base == 10, but extra in "C"
971 + // library for blank.
972 + bool __ret = false;
973 + const size_t __bitmasksize = 11;
974 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
975 + if (__m & _M_bit[__bitcur]
976 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
986 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
988 + for (; __lo < __hi; ++__vec, ++__lo)
990 + // Highest bitmask in ctype_base == 10, but extra in "C"
991 + // library for blank.
992 + const size_t __bitmasksize = 11;
994 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
995 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
996 + __m |= _M_bit[__bitcur];
1004 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1006 + while (__lo < __hi && !this->do_is(__m, *__lo))
1013 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1015 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1022 + do_widen(char __c) const
1023 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1027 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1029 + while (__lo < __hi)
1031 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1040 + do_narrow(wchar_t __wc, char __dfault) const
1042 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1043 + return _M_narrow[__wc];
1044 +#ifdef __UCLIBC_HAS_XLOCALE__
1045 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1047 + const int __c = wctob(__wc);
1048 +#ifdef __UCLIBC_HAS_XLOCALE__
1049 + __uselocale(__old);
1051 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1056 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1057 + char* __dest) const
1059 +#ifdef __UCLIBC_HAS_XLOCALE__
1060 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1063 + while (__lo < __hi)
1065 + if (*__lo >= 0 && *__lo < 128)
1066 + *__dest = _M_narrow[*__lo];
1069 + const int __c = wctob(*__lo);
1070 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1076 + while (__lo < __hi)
1078 + const int __c = wctob(*__lo);
1079 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1083 +#ifdef __UCLIBC_HAS_XLOCALE__
1084 + __uselocale(__old);
1090 + ctype<wchar_t>::_M_initialize_ctype()
1092 +#ifdef __UCLIBC_HAS_XLOCALE__
1093 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1096 + for (__i = 0; __i < 128; ++__i)
1098 + const int __c = wctob(__i);
1102 + _M_narrow[__i] = static_cast<char>(__c);
1105 + _M_narrow_ok = true;
1107 + _M_narrow_ok = false;
1108 + for (size_t __j = 0;
1109 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1110 + _M_widen[__j] = btowc(__j);
1112 + for (size_t __k = 0; __k <= 11; ++__k)
1114 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1115 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1117 +#ifdef __UCLIBC_HAS_XLOCALE__
1118 + __uselocale(__old);
1121 +#endif // _GLIBCXX_USE_WCHAR_T
1123 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc
1124 ===================================================================
1125 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1126 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-08-28 17:55:56.000000000 -0700
1128 +// std::messages implementation details, GNU version -*- C++ -*-
1130 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1132 +// This file is part of the GNU ISO C++ Library. This library is free
1133 +// software; you can redistribute it and/or modify it under the
1134 +// terms of the GNU General Public License as published by the
1135 +// Free Software Foundation; either version 2, or (at your option)
1136 +// any later version.
1138 +// This library is distributed in the hope that it will be useful,
1139 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1140 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1141 +// GNU General Public License for more details.
1143 +// You should have received a copy of the GNU General Public License along
1144 +// with this library; see the file COPYING. If not, write to the Free
1145 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1148 +// As a special exception, you may use this file as part of a free software
1149 +// library without restriction. Specifically, if other files instantiate
1150 +// templates or use macros or inline functions from this file, or you compile
1151 +// this file and link it with other files to produce an executable, this
1152 +// file does not by itself cause the resulting executable to be covered by
1153 +// the GNU General Public License. This exception does not however
1154 +// invalidate any other reasons why the executable file might be covered by
1155 +// the GNU General Public License.
1158 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1161 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1164 +#include <bits/c++locale_internal.h>
1166 +#ifdef __UCLIBC_MJN3_ONLY__
1167 +#warning fix gettext stuff
1169 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1170 +extern "C" char *__dcgettext(const char *domainname,
1171 + const char *msgid, int category);
1173 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1176 +#define gettext(msgid) (msgid)
1181 + // Specializations.
1184 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1186 +#ifdef __UCLIBC_HAS_XLOCALE__
1187 + __c_locale __old = __uselocale(_M_c_locale_messages);
1188 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1189 + __uselocale(__old);
1190 + return string(__msg);
1191 +#elif defined __UCLIBC_HAS_LOCALE__
1192 + char* __old = strdup(setlocale(LC_ALL, NULL));
1193 + setlocale(LC_ALL, _M_name_messages);
1194 + const char* __msg = gettext(__dfault.c_str());
1195 + setlocale(LC_ALL, __old);
1197 + return string(__msg);
1199 + const char* __msg = gettext(__dfault.c_str());
1200 + return string(__msg);
1204 +#ifdef _GLIBCXX_USE_WCHAR_T
1207 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1209 +# ifdef __UCLIBC_HAS_XLOCALE__
1210 + __c_locale __old = __uselocale(_M_c_locale_messages);
1211 + char* __msg = gettext(_M_convert_to_char(__dfault));
1212 + __uselocale(__old);
1213 + return _M_convert_from_char(__msg);
1214 +# elif defined __UCLIBC_HAS_LOCALE__
1215 + char* __old = strdup(setlocale(LC_ALL, NULL));
1216 + setlocale(LC_ALL, _M_name_messages);
1217 + char* __msg = gettext(_M_convert_to_char(__dfault));
1218 + setlocale(LC_ALL, __old);
1220 + return _M_convert_from_char(__msg);
1222 + char* __msg = gettext(_M_convert_to_char(__dfault));
1223 + return _M_convert_from_char(__msg);
1228 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h
1229 ===================================================================
1230 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1231 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-08-28 17:55:56.000000000 -0700
1233 +// std::messages implementation details, GNU version -*- C++ -*-
1235 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1237 +// This file is part of the GNU ISO C++ Library. This library is free
1238 +// software; you can redistribute it and/or modify it under the
1239 +// terms of the GNU General Public License as published by the
1240 +// Free Software Foundation; either version 2, or (at your option)
1241 +// any later version.
1243 +// This library is distributed in the hope that it will be useful,
1244 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1245 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1246 +// GNU General Public License for more details.
1248 +// You should have received a copy of the GNU General Public License along
1249 +// with this library; see the file COPYING. If not, write to the Free
1250 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1253 +// As a special exception, you may use this file as part of a free software
1254 +// library without restriction. Specifically, if other files instantiate
1255 +// templates or use macros or inline functions from this file, or you compile
1256 +// this file and link it with other files to produce an executable, this
1257 +// file does not by itself cause the resulting executable to be covered by
1258 +// the GNU General Public License. This exception does not however
1259 +// invalidate any other reasons why the executable file might be covered by
1260 +// the GNU General Public License.
1263 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1266 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1268 +#ifdef __UCLIBC_MJN3_ONLY__
1269 +#warning fix prototypes for *textdomain funcs
1271 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1272 +extern "C" char *__textdomain(const char *domainname);
1273 +extern "C" char *__bindtextdomain(const char *domainname,
1274 + const char *dirname);
1276 +#undef __textdomain
1277 +#undef __bindtextdomain
1278 +#define __textdomain(D) ((void)0)
1279 +#define __bindtextdomain(D,P) ((void)0)
1282 + // Non-virtual member functions.
1283 + template<typename _CharT>
1284 + messages<_CharT>::messages(size_t __refs)
1285 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1286 + _M_name_messages(_S_get_c_name())
1289 + template<typename _CharT>
1290 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1292 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1293 + _M_name_messages(__s)
1295 + char* __tmp = new char[std::strlen(__s) + 1];
1296 + std::strcpy(__tmp, __s);
1297 + _M_name_messages = __tmp;
1300 + template<typename _CharT>
1301 + typename messages<_CharT>::catalog
1302 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1303 + const char* __dir) const
1305 + __bindtextdomain(__s.c_str(), __dir);
1306 + return this->do_open(__s, __loc);
1309 + // Virtual member functions.
1310 + template<typename _CharT>
1311 + messages<_CharT>::~messages()
1313 + if (_M_name_messages != _S_get_c_name())
1314 + delete [] _M_name_messages;
1315 + _S_destroy_c_locale(_M_c_locale_messages);
1318 + template<typename _CharT>
1319 + typename messages<_CharT>::catalog
1320 + messages<_CharT>::do_open(const basic_string<char>& __s,
1321 + const locale&) const
1323 + // No error checking is done, assume the catalog exists and can
1325 + __textdomain(__s.c_str());
1329 + template<typename _CharT>
1331 + messages<_CharT>::do_close(catalog) const
1334 + // messages_byname
1335 + template<typename _CharT>
1336 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1337 + : messages<_CharT>(__refs)
1339 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1340 + delete [] this->_M_name_messages;
1341 + char* __tmp = new char[std::strlen(__s) + 1];
1342 + std::strcpy(__tmp, __s);
1343 + this->_M_name_messages = __tmp;
1345 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1347 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1348 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1351 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1352 ===================================================================
1353 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1354 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-08-28 17:55:56.000000000 -0700
1356 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1358 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1360 +// This file is part of the GNU ISO C++ Library. This library is free
1361 +// software; you can redistribute it and/or modify it under the
1362 +// terms of the GNU General Public License as published by the
1363 +// Free Software Foundation; either version 2, or (at your option)
1364 +// any later version.
1366 +// This library is distributed in the hope that it will be useful,
1367 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1368 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1369 +// GNU General Public License for more details.
1371 +// You should have received a copy of the GNU General Public License along
1372 +// with this library; see the file COPYING. If not, write to the Free
1373 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1376 +// As a special exception, you may use this file as part of a free software
1377 +// library without restriction. Specifically, if other files instantiate
1378 +// templates or use macros or inline functions from this file, or you compile
1379 +// this file and link it with other files to produce an executable, this
1380 +// file does not by itself cause the resulting executable to be covered by
1381 +// the GNU General Public License. This exception does not however
1382 +// invalidate any other reasons why the executable file might be covered by
1383 +// the GNU General Public License.
1386 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1389 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1394 +#include <bits/c++locale_internal.h>
1396 +#ifdef __UCLIBC_MJN3_ONLY__
1397 +#warning optimize this for uclibc
1398 +#warning tailor for stub locale support
1401 +#ifndef __UCLIBC_HAS_XLOCALE__
1402 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1407 + // Construct and return valid pattern consisting of some combination of:
1408 + // space none symbol sign value
1409 + money_base::pattern
1410 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1414 + // This insanely complicated routine attempts to construct a valid
1415 + // pattern for use with monyepunct. A couple of invariants:
1417 + // if (__precedes) symbol -> value
1418 + // else value -> symbol
1420 + // if (__space) space
1423 + // none == never first
1424 + // space never first or last
1426 + // Any elegant implementations of this are welcome.
1431 + // 1 The sign precedes the value and symbol.
1432 + __ret.field[0] = sign;
1435 + // Pattern starts with sign.
1438 + __ret.field[1] = symbol;
1439 + __ret.field[3] = value;
1443 + __ret.field[1] = value;
1444 + __ret.field[3] = symbol;
1446 + __ret.field[2] = space;
1450 + // Pattern starts with sign and ends with none.
1453 + __ret.field[1] = symbol;
1454 + __ret.field[2] = value;
1458 + __ret.field[1] = value;
1459 + __ret.field[2] = symbol;
1461 + __ret.field[3] = none;
1465 + // 2 The sign follows the value and symbol.
1468 + // Pattern either ends with sign.
1471 + __ret.field[0] = symbol;
1472 + __ret.field[2] = value;
1476 + __ret.field[0] = value;
1477 + __ret.field[2] = symbol;
1479 + __ret.field[1] = space;
1480 + __ret.field[3] = sign;
1484 + // Pattern ends with sign then none.
1487 + __ret.field[0] = symbol;
1488 + __ret.field[1] = value;
1492 + __ret.field[0] = value;
1493 + __ret.field[1] = symbol;
1495 + __ret.field[2] = sign;
1496 + __ret.field[3] = none;
1500 + // 3 The sign immediately precedes the symbol.
1503 + __ret.field[0] = sign;
1504 + __ret.field[1] = symbol;
1507 + __ret.field[2] = space;
1508 + __ret.field[3] = value;
1512 + __ret.field[2] = value;
1513 + __ret.field[3] = none;
1518 + __ret.field[0] = value;
1521 + __ret.field[1] = space;
1522 + __ret.field[2] = sign;
1523 + __ret.field[3] = symbol;
1527 + __ret.field[1] = sign;
1528 + __ret.field[2] = symbol;
1529 + __ret.field[3] = none;
1534 + // 4 The sign immediately follows the symbol.
1537 + __ret.field[0] = symbol;
1538 + __ret.field[1] = sign;
1541 + __ret.field[2] = space;
1542 + __ret.field[3] = value;
1546 + __ret.field[2] = value;
1547 + __ret.field[3] = none;
1552 + __ret.field[0] = value;
1555 + __ret.field[1] = space;
1556 + __ret.field[2] = symbol;
1557 + __ret.field[3] = sign;
1561 + __ret.field[1] = symbol;
1562 + __ret.field[2] = sign;
1563 + __ret.field[3] = none;
1575 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1579 + _M_data = new __moneypunct_cache<char, true>;
1584 + _M_data->_M_decimal_point = '.';
1585 + _M_data->_M_thousands_sep = ',';
1586 + _M_data->_M_grouping = "";
1587 + _M_data->_M_grouping_size = 0;
1588 + _M_data->_M_curr_symbol = "";
1589 + _M_data->_M_curr_symbol_size = 0;
1590 + _M_data->_M_positive_sign = "";
1591 + _M_data->_M_positive_sign_size = 0;
1592 + _M_data->_M_negative_sign = "";
1593 + _M_data->_M_negative_sign_size = 0;
1594 + _M_data->_M_frac_digits = 0;
1595 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1596 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1598 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1599 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1604 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1606 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1608 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1609 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1610 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1611 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1613 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1615 + _M_data->_M_negative_sign = "()";
1617 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1619 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1622 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1623 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1624 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1626 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1627 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1628 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1629 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1631 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1632 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1633 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1640 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1644 + _M_data = new __moneypunct_cache<char, false>;
1649 + _M_data->_M_decimal_point = '.';
1650 + _M_data->_M_thousands_sep = ',';
1651 + _M_data->_M_grouping = "";
1652 + _M_data->_M_grouping_size = 0;
1653 + _M_data->_M_curr_symbol = "";
1654 + _M_data->_M_curr_symbol_size = 0;
1655 + _M_data->_M_positive_sign = "";
1656 + _M_data->_M_positive_sign_size = 0;
1657 + _M_data->_M_negative_sign = "";
1658 + _M_data->_M_negative_sign_size = 0;
1659 + _M_data->_M_frac_digits = 0;
1660 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1661 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1663 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1664 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1669 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1671 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1673 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1674 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1675 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1676 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1678 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1680 + _M_data->_M_negative_sign = "()";
1682 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1684 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1687 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1688 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1689 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1690 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1691 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1692 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1693 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1695 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1696 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1697 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1703 + moneypunct<char, true>::~moneypunct()
1704 + { delete _M_data; }
1707 + moneypunct<char, false>::~moneypunct()
1708 + { delete _M_data; }
1710 +#ifdef _GLIBCXX_USE_WCHAR_T
1713 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1714 +#ifdef __UCLIBC_HAS_XLOCALE__
1717 + const char* __name)
1721 + _M_data = new __moneypunct_cache<wchar_t, true>;
1726 + _M_data->_M_decimal_point = L'.';
1727 + _M_data->_M_thousands_sep = L',';
1728 + _M_data->_M_grouping = "";
1729 + _M_data->_M_grouping_size = 0;
1730 + _M_data->_M_curr_symbol = L"";
1731 + _M_data->_M_curr_symbol_size = 0;
1732 + _M_data->_M_positive_sign = L"";
1733 + _M_data->_M_positive_sign_size = 0;
1734 + _M_data->_M_negative_sign = L"";
1735 + _M_data->_M_negative_sign_size = 0;
1736 + _M_data->_M_frac_digits = 0;
1737 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1738 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1740 + // Use ctype::widen code without the facet...
1741 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1742 + _M_data->_M_atoms[__i] =
1743 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1748 +#ifdef __UCLIBC_HAS_XLOCALE__
1749 + __c_locale __old = __uselocale(__cloc);
1751 + // Switch to named locale so that mbsrtowcs will work.
1752 + char* __old = strdup(setlocale(LC_ALL, NULL));
1753 + setlocale(LC_ALL, __name);
1756 +#ifdef __UCLIBC_MJN3_ONLY__
1757 +#warning fix this... should be monetary
1760 +# ifdef __UCLIBC_HAS_XLOCALE__
1761 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1762 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1764 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1765 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1768 + union { char *__s; wchar_t __w; } __u;
1769 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1770 + _M_data->_M_decimal_point = __u.__w;
1772 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1773 + _M_data->_M_thousands_sep = __u.__w;
1775 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1776 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1778 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1779 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1780 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1782 + wchar_t* __wcs_ps = 0;
1783 + wchar_t* __wcs_ns = 0;
1784 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1787 + mbstate_t __state;
1788 + size_t __len = strlen(__cpossign);
1792 + memset(&__state, 0, sizeof(mbstate_t));
1793 + __wcs_ps = new wchar_t[__len];
1794 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1795 + _M_data->_M_positive_sign = __wcs_ps;
1798 + _M_data->_M_positive_sign = L"";
1799 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1801 + __len = strlen(__cnegsign);
1803 + _M_data->_M_negative_sign = L"()";
1807 + memset(&__state, 0, sizeof(mbstate_t));
1808 + __wcs_ns = new wchar_t[__len];
1809 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1810 + _M_data->_M_negative_sign = __wcs_ns;
1813 + _M_data->_M_negative_sign = L"";
1814 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1817 + __len = strlen(__ccurr);
1821 + memset(&__state, 0, sizeof(mbstate_t));
1822 + wchar_t* __wcs = new wchar_t[__len];
1823 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1824 + _M_data->_M_curr_symbol = __wcs;
1827 + _M_data->_M_curr_symbol = L"";
1828 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1836 +#ifdef __UCLIBC_HAS_XLOCALE__
1837 + __uselocale(__old);
1839 + setlocale(LC_ALL, __old);
1842 + __throw_exception_again;
1845 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1847 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1848 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1849 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1850 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1852 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1853 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1854 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1857 +#ifdef __UCLIBC_HAS_XLOCALE__
1858 + __uselocale(__old);
1860 + setlocale(LC_ALL, __old);
1868 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1869 +#ifdef __UCLIBC_HAS_XLOCALE__
1872 + const char* __name)
1876 + _M_data = new __moneypunct_cache<wchar_t, false>;
1881 + _M_data->_M_decimal_point = L'.';
1882 + _M_data->_M_thousands_sep = L',';
1883 + _M_data->_M_grouping = "";
1884 + _M_data->_M_grouping_size = 0;
1885 + _M_data->_M_curr_symbol = L"";
1886 + _M_data->_M_curr_symbol_size = 0;
1887 + _M_data->_M_positive_sign = L"";
1888 + _M_data->_M_positive_sign_size = 0;
1889 + _M_data->_M_negative_sign = L"";
1890 + _M_data->_M_negative_sign_size = 0;
1891 + _M_data->_M_frac_digits = 0;
1892 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1893 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1895 + // Use ctype::widen code without the facet...
1896 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1897 + _M_data->_M_atoms[__i] =
1898 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1903 +#ifdef __UCLIBC_HAS_XLOCALE__
1904 + __c_locale __old = __uselocale(__cloc);
1906 + // Switch to named locale so that mbsrtowcs will work.
1907 + char* __old = strdup(setlocale(LC_ALL, NULL));
1908 + setlocale(LC_ALL, __name);
1911 +#ifdef __UCLIBC_MJN3_ONLY__
1912 +#warning fix this... should be monetary
1915 +# ifdef __UCLIBC_HAS_XLOCALE__
1916 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1917 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1919 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1920 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1923 + union { char *__s; wchar_t __w; } __u;
1924 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1925 + _M_data->_M_decimal_point = __u.__w;
1927 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1928 + _M_data->_M_thousands_sep = __u.__w;
1930 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1931 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1933 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1934 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1935 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1937 + wchar_t* __wcs_ps = 0;
1938 + wchar_t* __wcs_ns = 0;
1939 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1942 + mbstate_t __state;
1944 + __len = strlen(__cpossign);
1948 + memset(&__state, 0, sizeof(mbstate_t));
1949 + __wcs_ps = new wchar_t[__len];
1950 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1951 + _M_data->_M_positive_sign = __wcs_ps;
1954 + _M_data->_M_positive_sign = L"";
1955 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1957 + __len = strlen(__cnegsign);
1959 + _M_data->_M_negative_sign = L"()";
1963 + memset(&__state, 0, sizeof(mbstate_t));
1964 + __wcs_ns = new wchar_t[__len];
1965 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1966 + _M_data->_M_negative_sign = __wcs_ns;
1969 + _M_data->_M_negative_sign = L"";
1970 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1973 + __len = strlen(__ccurr);
1977 + memset(&__state, 0, sizeof(mbstate_t));
1978 + wchar_t* __wcs = new wchar_t[__len];
1979 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1980 + _M_data->_M_curr_symbol = __wcs;
1983 + _M_data->_M_curr_symbol = L"";
1984 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1992 +#ifdef __UCLIBC_HAS_XLOCALE__
1993 + __uselocale(__old);
1995 + setlocale(LC_ALL, __old);
1998 + __throw_exception_again;
2001 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2002 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2003 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2004 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2005 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2007 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2008 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2009 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2012 +#ifdef __UCLIBC_HAS_XLOCALE__
2013 + __uselocale(__old);
2015 + setlocale(LC_ALL, __old);
2022 + moneypunct<wchar_t, true>::~moneypunct()
2024 + if (_M_data->_M_positive_sign_size)
2025 + delete [] _M_data->_M_positive_sign;
2026 + if (_M_data->_M_negative_sign_size
2027 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2028 + delete [] _M_data->_M_negative_sign;
2029 + if (_M_data->_M_curr_symbol_size)
2030 + delete [] _M_data->_M_curr_symbol;
2035 + moneypunct<wchar_t, false>::~moneypunct()
2037 + if (_M_data->_M_positive_sign_size)
2038 + delete [] _M_data->_M_positive_sign;
2039 + if (_M_data->_M_negative_sign_size
2040 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2041 + delete [] _M_data->_M_negative_sign;
2042 + if (_M_data->_M_curr_symbol_size)
2043 + delete [] _M_data->_M_curr_symbol;
2048 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2049 ===================================================================
2050 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2051 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-08-28 17:55:56.000000000 -0700
2053 +// std::numpunct implementation details, GNU version -*- C++ -*-
2055 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2057 +// This file is part of the GNU ISO C++ Library. This library is free
2058 +// software; you can redistribute it and/or modify it under the
2059 +// terms of the GNU General Public License as published by the
2060 +// Free Software Foundation; either version 2, or (at your option)
2061 +// any later version.
2063 +// This library is distributed in the hope that it will be useful,
2064 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2065 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2066 +// GNU General Public License for more details.
2068 +// You should have received a copy of the GNU General Public License along
2069 +// with this library; see the file COPYING. If not, write to the Free
2070 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2073 +// As a special exception, you may use this file as part of a free software
2074 +// library without restriction. Specifically, if other files instantiate
2075 +// templates or use macros or inline functions from this file, or you compile
2076 +// this file and link it with other files to produce an executable, this
2077 +// file does not by itself cause the resulting executable to be covered by
2078 +// the GNU General Public License. This exception does not however
2079 +// invalidate any other reasons why the executable file might be covered by
2080 +// the GNU General Public License.
2083 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2086 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2091 +#include <bits/c++locale_internal.h>
2093 +#ifdef __UCLIBC_MJN3_ONLY__
2094 +#warning tailor for stub locale support
2096 +#ifndef __UCLIBC_HAS_XLOCALE__
2097 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2104 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2107 + _M_data = new __numpunct_cache<char>;
2112 + _M_data->_M_grouping = "";
2113 + _M_data->_M_grouping_size = 0;
2114 + _M_data->_M_use_grouping = false;
2116 + _M_data->_M_decimal_point = '.';
2117 + _M_data->_M_thousands_sep = ',';
2119 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2120 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2122 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2123 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2128 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2130 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2133 + // Check for NULL, which implies no grouping.
2134 + if (_M_data->_M_thousands_sep == '\0')
2135 + _M_data->_M_grouping = "";
2137 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2138 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2141 + // NB: There is no way to extact this info from posix locales.
2142 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2143 + _M_data->_M_truename = "true";
2144 + _M_data->_M_truename_size = 4;
2145 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2146 + _M_data->_M_falsename = "false";
2147 + _M_data->_M_falsename_size = 5;
2151 + numpunct<char>::~numpunct()
2152 + { delete _M_data; }
2154 +#ifdef _GLIBCXX_USE_WCHAR_T
2157 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2160 + _M_data = new __numpunct_cache<wchar_t>;
2165 + _M_data->_M_grouping = "";
2166 + _M_data->_M_grouping_size = 0;
2167 + _M_data->_M_use_grouping = false;
2169 + _M_data->_M_decimal_point = L'.';
2170 + _M_data->_M_thousands_sep = L',';
2172 + // Use ctype::widen code without the facet...
2173 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2174 + _M_data->_M_atoms_out[__i] =
2175 + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2177 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2178 + _M_data->_M_atoms_in[__j] =
2179 + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2184 + // NB: In the GNU model wchar_t is always 32 bit wide.
2185 + union { char *__s; wchar_t __w; } __u;
2186 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2187 + _M_data->_M_decimal_point = __u.__w;
2189 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2190 + _M_data->_M_thousands_sep = __u.__w;
2192 + if (_M_data->_M_thousands_sep == L'\0')
2193 + _M_data->_M_grouping = "";
2195 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2196 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2199 + // NB: There is no way to extact this info from posix locales.
2200 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2201 + _M_data->_M_truename = L"true";
2202 + _M_data->_M_truename_size = 4;
2203 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2204 + _M_data->_M_falsename = L"false";
2205 + _M_data->_M_falsename_size = 5;
2209 + numpunct<wchar_t>::~numpunct()
2210 + { delete _M_data; }
2213 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc
2214 ===================================================================
2215 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2216 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-08-28 17:55:56.000000000 -0700
2218 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2220 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2222 +// This file is part of the GNU ISO C++ Library. This library is free
2223 +// software; you can redistribute it and/or modify it under the
2224 +// terms of the GNU General Public License as published by the
2225 +// Free Software Foundation; either version 2, or (at your option)
2226 +// any later version.
2228 +// This library is distributed in the hope that it will be useful,
2229 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2230 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2231 +// GNU General Public License for more details.
2233 +// You should have received a copy of the GNU General Public License along
2234 +// with this library; see the file COPYING. If not, write to the Free
2235 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2238 +// As a special exception, you may use this file as part of a free software
2239 +// library without restriction. Specifically, if other files instantiate
2240 +// templates or use macros or inline functions from this file, or you compile
2241 +// this file and link it with other files to produce an executable, this
2242 +// file does not by itself cause the resulting executable to be covered by
2243 +// the GNU General Public License. This exception does not however
2244 +// invalidate any other reasons why the executable file might be covered by
2245 +// the GNU General Public License.
2248 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2249 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2252 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2255 +#include <bits/c++locale_internal.h>
2257 +#ifdef __UCLIBC_MJN3_ONLY__
2258 +#warning tailor for stub locale support
2260 +#ifndef __UCLIBC_HAS_XLOCALE__
2261 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2268 + __timepunct<char>::
2269 + _M_put(char* __s, size_t __maxlen, const char* __format,
2270 + const tm* __tm) const
2272 +#ifdef __UCLIBC_HAS_XLOCALE__
2273 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2274 + _M_c_locale_timepunct);
2276 + char* __old = strdup(setlocale(LC_ALL, NULL));
2277 + setlocale(LC_ALL, _M_name_timepunct);
2278 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2279 + setlocale(LC_ALL, __old);
2282 + // Make sure __s is null terminated.
2289 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2292 + _M_data = new __timepunct_cache<char>;
2297 + _M_c_locale_timepunct = _S_get_c_locale();
2299 + _M_data->_M_date_format = "%m/%d/%y";
2300 + _M_data->_M_date_era_format = "%m/%d/%y";
2301 + _M_data->_M_time_format = "%H:%M:%S";
2302 + _M_data->_M_time_era_format = "%H:%M:%S";
2303 + _M_data->_M_date_time_format = "";
2304 + _M_data->_M_date_time_era_format = "";
2305 + _M_data->_M_am = "AM";
2306 + _M_data->_M_pm = "PM";
2307 + _M_data->_M_am_pm_format = "";
2309 + // Day names, starting with "C"'s Sunday.
2310 + _M_data->_M_day1 = "Sunday";
2311 + _M_data->_M_day2 = "Monday";
2312 + _M_data->_M_day3 = "Tuesday";
2313 + _M_data->_M_day4 = "Wednesday";
2314 + _M_data->_M_day5 = "Thursday";
2315 + _M_data->_M_day6 = "Friday";
2316 + _M_data->_M_day7 = "Saturday";
2318 + // Abbreviated day names, starting with "C"'s Sun.
2319 + _M_data->_M_aday1 = "Sun";
2320 + _M_data->_M_aday2 = "Mon";
2321 + _M_data->_M_aday3 = "Tue";
2322 + _M_data->_M_aday4 = "Wed";
2323 + _M_data->_M_aday5 = "Thu";
2324 + _M_data->_M_aday6 = "Fri";
2325 + _M_data->_M_aday7 = "Sat";
2327 + // Month names, starting with "C"'s January.
2328 + _M_data->_M_month01 = "January";
2329 + _M_data->_M_month02 = "February";
2330 + _M_data->_M_month03 = "March";
2331 + _M_data->_M_month04 = "April";
2332 + _M_data->_M_month05 = "May";
2333 + _M_data->_M_month06 = "June";
2334 + _M_data->_M_month07 = "July";
2335 + _M_data->_M_month08 = "August";
2336 + _M_data->_M_month09 = "September";
2337 + _M_data->_M_month10 = "October";
2338 + _M_data->_M_month11 = "November";
2339 + _M_data->_M_month12 = "December";
2341 + // Abbreviated month names, starting with "C"'s Jan.
2342 + _M_data->_M_amonth01 = "Jan";
2343 + _M_data->_M_amonth02 = "Feb";
2344 + _M_data->_M_amonth03 = "Mar";
2345 + _M_data->_M_amonth04 = "Apr";
2346 + _M_data->_M_amonth05 = "May";
2347 + _M_data->_M_amonth06 = "Jun";
2348 + _M_data->_M_amonth07 = "Jul";
2349 + _M_data->_M_amonth08 = "Aug";
2350 + _M_data->_M_amonth09 = "Sep";
2351 + _M_data->_M_amonth10 = "Oct";
2352 + _M_data->_M_amonth11 = "Nov";
2353 + _M_data->_M_amonth12 = "Dec";
2357 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2359 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2360 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2361 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2362 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2363 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2364 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2366 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2367 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2368 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2370 + // Day names, starting with "C"'s Sunday.
2371 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2372 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2373 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2374 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2375 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2376 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2377 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2379 + // Abbreviated day names, starting with "C"'s Sun.
2380 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2381 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2382 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2383 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2384 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2385 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2386 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2388 + // Month names, starting with "C"'s January.
2389 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2390 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2391 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2392 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2393 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2394 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2395 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2396 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2397 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2398 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2399 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2400 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2402 + // Abbreviated month names, starting with "C"'s Jan.
2403 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2404 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2405 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2406 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2407 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2408 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2409 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2410 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2411 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2412 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2413 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2414 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2418 +#ifdef _GLIBCXX_USE_WCHAR_T
2421 + __timepunct<wchar_t>::
2422 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2423 + const tm* __tm) const
2425 +#ifdef __UCLIBC_HAS_XLOCALE__
2426 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2427 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2428 + _M_c_locale_timepunct);
2430 + char* __old = strdup(setlocale(LC_ALL, NULL));
2431 + setlocale(LC_ALL, _M_name_timepunct);
2432 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2433 + setlocale(LC_ALL, __old);
2436 + // Make sure __s is null terminated.
2443 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2446 + _M_data = new __timepunct_cache<wchar_t>;
2448 +#warning wide time stuff
2452 + _M_c_locale_timepunct = _S_get_c_locale();
2454 + _M_data->_M_date_format = L"%m/%d/%y";
2455 + _M_data->_M_date_era_format = L"%m/%d/%y";
2456 + _M_data->_M_time_format = L"%H:%M:%S";
2457 + _M_data->_M_time_era_format = L"%H:%M:%S";
2458 + _M_data->_M_date_time_format = L"";
2459 + _M_data->_M_date_time_era_format = L"";
2460 + _M_data->_M_am = L"AM";
2461 + _M_data->_M_pm = L"PM";
2462 + _M_data->_M_am_pm_format = L"";
2464 + // Day names, starting with "C"'s Sunday.
2465 + _M_data->_M_day1 = L"Sunday";
2466 + _M_data->_M_day2 = L"Monday";
2467 + _M_data->_M_day3 = L"Tuesday";
2468 + _M_data->_M_day4 = L"Wednesday";
2469 + _M_data->_M_day5 = L"Thursday";
2470 + _M_data->_M_day6 = L"Friday";
2471 + _M_data->_M_day7 = L"Saturday";
2473 + // Abbreviated day names, starting with "C"'s Sun.
2474 + _M_data->_M_aday1 = L"Sun";
2475 + _M_data->_M_aday2 = L"Mon";
2476 + _M_data->_M_aday3 = L"Tue";
2477 + _M_data->_M_aday4 = L"Wed";
2478 + _M_data->_M_aday5 = L"Thu";
2479 + _M_data->_M_aday6 = L"Fri";
2480 + _M_data->_M_aday7 = L"Sat";
2482 + // Month names, starting with "C"'s January.
2483 + _M_data->_M_month01 = L"January";
2484 + _M_data->_M_month02 = L"February";
2485 + _M_data->_M_month03 = L"March";
2486 + _M_data->_M_month04 = L"April";
2487 + _M_data->_M_month05 = L"May";
2488 + _M_data->_M_month06 = L"June";
2489 + _M_data->_M_month07 = L"July";
2490 + _M_data->_M_month08 = L"August";
2491 + _M_data->_M_month09 = L"September";
2492 + _M_data->_M_month10 = L"October";
2493 + _M_data->_M_month11 = L"November";
2494 + _M_data->_M_month12 = L"December";
2496 + // Abbreviated month names, starting with "C"'s Jan.
2497 + _M_data->_M_amonth01 = L"Jan";
2498 + _M_data->_M_amonth02 = L"Feb";
2499 + _M_data->_M_amonth03 = L"Mar";
2500 + _M_data->_M_amonth04 = L"Apr";
2501 + _M_data->_M_amonth05 = L"May";
2502 + _M_data->_M_amonth06 = L"Jun";
2503 + _M_data->_M_amonth07 = L"Jul";
2504 + _M_data->_M_amonth08 = L"Aug";
2505 + _M_data->_M_amonth09 = L"Sep";
2506 + _M_data->_M_amonth10 = L"Oct";
2507 + _M_data->_M_amonth11 = L"Nov";
2508 + _M_data->_M_amonth12 = L"Dec";
2513 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2515 + union { char *__s; wchar_t *__w; } __u;
2517 + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2518 + _M_data->_M_date_format = __u.__w;
2519 + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2520 + _M_data->_M_date_era_format = __u.__w;
2521 + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2522 + _M_data->_M_time_format = __u.__w;
2523 + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2524 + _M_data->_M_time_era_format = __u.__w;
2525 + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2526 + _M_data->_M_date_time_format = __u.__w;
2527 + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2528 + _M_data->_M_date_time_era_format = __u.__w;
2529 + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2530 + _M_data->_M_am = __u.__w;
2531 + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2532 + _M_data->_M_pm = __u.__w;
2533 + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2534 + _M_data->_M_am_pm_format = __u.__w;
2536 + // Day names, starting with "C"'s Sunday.
2537 + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2538 + _M_data->_M_day1 = __u.__w;
2539 + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2540 + _M_data->_M_day2 = __u.__w;
2541 + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2542 + _M_data->_M_day3 = __u.__w;
2543 + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2544 + _M_data->_M_day4 = __u.__w;
2545 + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2546 + _M_data->_M_day5 = __u.__w;
2547 + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2548 + _M_data->_M_day6 = __u.__w;
2549 + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2550 + _M_data->_M_day7 = __u.__w;
2552 + // Abbreviated day names, starting with "C"'s Sun.
2553 + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2554 + _M_data->_M_aday1 = __u.__w;
2555 + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2556 + _M_data->_M_aday2 = __u.__w;
2557 + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2558 + _M_data->_M_aday3 = __u.__w;
2559 + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2560 + _M_data->_M_aday4 = __u.__w;
2561 + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2562 + _M_data->_M_aday5 = __u.__w;
2563 + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2564 + _M_data->_M_aday6 = __u.__w;
2565 + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2566 + _M_data->_M_aday7 = __u.__w;
2568 + // Month names, starting with "C"'s January.
2569 + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2570 + _M_data->_M_month01 = __u.__w;
2571 + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2572 + _M_data->_M_month02 = __u.__w;
2573 + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2574 + _M_data->_M_month03 = __u.__w;
2575 + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2576 + _M_data->_M_month04 = __u.__w;
2577 + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2578 + _M_data->_M_month05 = __u.__w;
2579 + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2580 + _M_data->_M_month06 = __u.__w;
2581 + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2582 + _M_data->_M_month07 = __u.__w;
2583 + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2584 + _M_data->_M_month08 = __u.__w;
2585 + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2586 + _M_data->_M_month09 = __u.__w;
2587 + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2588 + _M_data->_M_month10 = __u.__w;
2589 + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2590 + _M_data->_M_month11 = __u.__w;
2591 + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2592 + _M_data->_M_month12 = __u.__w;
2594 + // Abbreviated month names, starting with "C"'s Jan.
2595 + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2596 + _M_data->_M_amonth01 = __u.__w;
2597 + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2598 + _M_data->_M_amonth02 = __u.__w;
2599 + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2600 + _M_data->_M_amonth03 = __u.__w;
2601 + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2602 + _M_data->_M_amonth04 = __u.__w;
2603 + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2604 + _M_data->_M_amonth05 = __u.__w;
2605 + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2606 + _M_data->_M_amonth06 = __u.__w;
2607 + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2608 + _M_data->_M_amonth07 = __u.__w;
2609 + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2610 + _M_data->_M_amonth08 = __u.__w;
2611 + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2612 + _M_data->_M_amonth09 = __u.__w;
2613 + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2614 + _M_data->_M_amonth10 = __u.__w;
2615 + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2616 + _M_data->_M_amonth11 = __u.__w;
2617 + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2618 + _M_data->_M_amonth12 = __u.__w;
2624 Index: gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h
2625 ===================================================================
2626 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2627 +++ gcc-4.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 2008-08-28 17:55:56.000000000 -0700
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);
2697 Index: gcc-4.3.2/libstdc++-v3/configure
2698 ===================================================================
2699 --- gcc-4.3.2.orig/libstdc++-v3/configure 2008-07-07 12:49:54.000000000 -0700
2700 +++ gcc-4.3.2/libstdc++-v3/configure 2008-08-28 18:02:13.000000000 -0700
2701 @@ -14003,7 +14003,7 @@
2702 enableval="$enable_clocale"
2704 case "$enableval" in
2705 - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2706 + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
2707 *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
2708 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
2709 { (exit 1); exit 1; }; } ;;
2710 @@ -14036,6 +14036,9 @@
2711 # Default to "generic".
2712 if test $enable_clocale_flag = auto; then
2713 case ${target_os} in
2715 + enable_clocale_flag=uclibc
2717 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2718 enable_clocale_flag=gnu
2720 @@ -14424,6 +14427,76 @@
2721 CTIME_CC=config/locale/generic/time_members.cc
2722 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2725 + echo "$as_me:$LINENO: result: uclibc" >&5
2726 +echo "${ECHO_T}uclibc" >&6
2728 + # Declare intention to use gettext, and add support for specific
2730 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2731 + ALL_LINGUAS="de fr"
2733 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2734 + # Extract the first word of "msgfmt", so it can be a program name with args.
2735 +set dummy msgfmt; ac_word=$2
2736 +echo "$as_me:$LINENO: checking for $ac_word" >&5
2737 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2738 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2739 + echo $ECHO_N "(cached) $ECHO_C" >&6
2741 + if test -n "$check_msgfmt"; then
2742 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2744 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2745 +for as_dir in $PATH
2748 + test -z "$as_dir" && as_dir=.
2749 + for ac_exec_ext in '' $ac_executable_extensions; do
2750 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2751 + ac_cv_prog_check_msgfmt="yes"
2752 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2758 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
2761 +check_msgfmt=$ac_cv_prog_check_msgfmt
2762 +if test -n "$check_msgfmt"; then
2763 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
2764 +echo "${ECHO_T}$check_msgfmt" >&6
2766 + echo "$as_me:$LINENO: result: no" >&5
2767 +echo "${ECHO_T}no" >&6
2770 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2773 + # Export the build objects.
2774 + for ling in $ALL_LINGUAS; do \
2775 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2776 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2781 + CLOCALE_H=config/locale/uclibc/c_locale.h
2782 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
2783 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2784 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2785 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2786 + CMESSAGES_H=config/locale/uclibc/messages_members.h
2787 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2788 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
2789 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2790 + CTIME_H=config/locale/uclibc/time_members.h
2791 + CTIME_CC=config/locale/uclibc/time_members.cc
2792 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2796 # This is where the testsuite looks for locale catalogs, using the
2797 Index: gcc-4.3.2/libstdc++-v3/include/c_compatibility/wchar.h
2798 ===================================================================
2799 --- gcc-4.3.2.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 14:59:49.000000000 -0800
2800 +++ gcc-4.3.2/libstdc++-v3/include/c_compatibility/wchar.h 2008-08-28 17:55:56.000000000 -0700
2803 using std::wmemmove;
2805 +#if _GLIBCXX_HAVE_WCSFTIME
2806 using std::wcsftime;
2809 #if _GLIBCXX_USE_C99
2811 Index: gcc-4.3.2/libstdc++-v3/include/c_std/cwchar
2812 ===================================================================
2813 --- gcc-4.3.2.orig/libstdc++-v3/include/c_std/cwchar 2007-05-27 07:50:21.000000000 -0700
2814 +++ gcc-4.3.2/libstdc++-v3/include/c_std/cwchar 2008-08-28 17:55:56.000000000 -0700
2819 +#if _GLIBCXX_HAVE_WCSFTIME