1 Index: gcc-4.2.3/libstdc++-v3/acinclude.m4
2 ===================================================================
3 --- gcc-4.2.3.orig/libstdc++-v3/acinclude.m4 2007-06-29 01:02:05.000000000 +0200
4 +++ gcc-4.2.3/libstdc++-v3/acinclude.m4 2008-05-21 13:45:43.925289703 +0200
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 @@ -1526,6 +1529,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.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
66 ===================================================================
67 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
68 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-05-21 13:45:43.925289703 +0200
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.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc
134 ===================================================================
135 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
136 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-05-21 13:45:43.925289703 +0200
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.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h
299 ===================================================================
300 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
301 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-05-21 13:45:43.925289703 +0200
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.2.3/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
421 ===================================================================
422 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
423 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-05-21 13:45:43.929287698 +0200
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 <bits/c++locale_internal.h>
465 + // Specializations.
466 +#ifdef _GLIBCXX_USE_WCHAR_T
467 + codecvt_base::result
468 + codecvt<wchar_t, char, mbstate_t>::
469 + do_out(state_type& __state, const intern_type* __from,
470 + const intern_type* __from_end, const intern_type*& __from_next,
471 + extern_type* __to, extern_type* __to_end,
472 + extern_type*& __to_next) const
475 + state_type __tmp_state(__state);
477 +#ifdef __UCLIBC_HAS_XLOCALE__
478 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
481 + // wcsnrtombs is *very* fast but stops if encounters NUL characters:
482 + // in case we fall back to wcrtomb and then continue, in a loop.
483 + // NB: wcsnrtombs is a GNU extension
484 + for (__from_next = __from, __to_next = __to;
485 + __from_next < __from_end && __to_next < __to_end
488 + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
489 + __from_end - __from_next);
490 + if (!__from_chunk_end)
491 + __from_chunk_end = __from_end;
493 + __from = __from_next;
494 + const size_t __conv = wcsnrtombs(__to_next, &__from_next,
495 + __from_chunk_end - __from_next,
496 + __to_end - __to_next, &__state);
497 + if (__conv == static_cast<size_t>(-1))
499 + // In case of error, in order to stop at the exact place we
500 + // have to start again from the beginning with a series of
502 + for (; __from < __from_next; ++__from)
503 + __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
504 + __state = __tmp_state;
507 + else if (__from_next && __from_next < __from_chunk_end)
509 + __to_next += __conv;
514 + __from_next = __from_chunk_end;
515 + __to_next += __conv;
518 + if (__from_next < __from_end && __ret == ok)
520 + extern_type __buf[MB_LEN_MAX];
521 + __tmp_state = __state;
522 + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
523 + if (__conv > static_cast<size_t>(__to_end - __to_next))
527 + memcpy(__to_next, __buf, __conv);
528 + __state = __tmp_state;
529 + __to_next += __conv;
535 +#ifdef __UCLIBC_HAS_XLOCALE__
536 + __uselocale(__old);
542 + codecvt_base::result
543 + codecvt<wchar_t, char, mbstate_t>::
544 + do_in(state_type& __state, const extern_type* __from,
545 + const extern_type* __from_end, const extern_type*& __from_next,
546 + intern_type* __to, intern_type* __to_end,
547 + intern_type*& __to_next) const
550 + state_type __tmp_state(__state);
552 +#ifdef __UCLIBC_HAS_XLOCALE__
553 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
556 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
557 + // in case we store a L'\0' and then continue, in a loop.
558 + // NB: mbsnrtowcs is a GNU extension
559 + for (__from_next = __from, __to_next = __to;
560 + __from_next < __from_end && __to_next < __to_end
563 + const extern_type* __from_chunk_end;
564 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
567 + if (!__from_chunk_end)
568 + __from_chunk_end = __from_end;
570 + __from = __from_next;
571 + size_t __conv = mbsnrtowcs(__to_next, &__from_next,
572 + __from_chunk_end - __from_next,
573 + __to_end - __to_next, &__state);
574 + if (__conv == static_cast<size_t>(-1))
576 + // In case of error, in order to stop at the exact place we
577 + // have to start again from the beginning with a series of
579 + for (;; ++__to_next, __from += __conv)
581 + __conv = mbrtowc(__to_next, __from, __from_end - __from,
583 + if (__conv == static_cast<size_t>(-1)
584 + || __conv == static_cast<size_t>(-2))
587 + __from_next = __from;
588 + __state = __tmp_state;
591 + else if (__from_next && __from_next < __from_chunk_end)
593 + // It is unclear what to return in this case (see DR 382).
594 + __to_next += __conv;
599 + __from_next = __from_chunk_end;
600 + __to_next += __conv;
603 + if (__from_next < __from_end && __ret == ok)
605 + if (__to_next < __to_end)
607 + // XXX Probably wrong for stateful encodings
608 + __tmp_state = __state;
610 + *__to_next++ = L'\0';
617 +#ifdef __UCLIBC_HAS_XLOCALE__
618 + __uselocale(__old);
625 + codecvt<wchar_t, char, mbstate_t>::
626 + do_encoding() const throw()
628 + // XXX This implementation assumes that the encoding is
629 + // stateless and is either single-byte or variable-width.
631 +#ifdef __UCLIBC_HAS_XLOCALE__
632 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
634 + if (MB_CUR_MAX == 1)
636 +#ifdef __UCLIBC_HAS_XLOCALE__
637 + __uselocale(__old);
643 + codecvt<wchar_t, char, mbstate_t>::
644 + do_max_length() const throw()
646 +#ifdef __UCLIBC_HAS_XLOCALE__
647 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
649 + // XXX Probably wrong for stateful encodings.
650 + int __ret = MB_CUR_MAX;
651 +#ifdef __UCLIBC_HAS_XLOCALE__
652 + __uselocale(__old);
658 + codecvt<wchar_t, char, mbstate_t>::
659 + do_length(state_type& __state, const extern_type* __from,
660 + const extern_type* __end, size_t __max) const
663 + state_type __tmp_state(__state);
665 +#ifdef __UCLIBC_HAS_XLOCALE__
666 + __c_locale __old = __uselocale(_M_c_locale_codecvt);
669 + // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
670 + // in case we advance past it and then continue, in a loop.
671 + // NB: mbsnrtowcs is a GNU extension
673 + // A dummy internal buffer is needed in order for mbsnrtocws to consider
674 + // its fourth parameter (it wouldn't with NULL as first parameter).
675 + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
677 + while (__from < __end && __max)
679 + const extern_type* __from_chunk_end;
680 + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
683 + if (!__from_chunk_end)
684 + __from_chunk_end = __end;
686 + const extern_type* __tmp_from = __from;
687 + size_t __conv = mbsnrtowcs(__to, &__from,
688 + __from_chunk_end - __from,
690 + if (__conv == static_cast<size_t>(-1))
692 + // In case of error, in order to stop at the exact place we
693 + // have to start again from the beginning with a series of
695 + for (__from = __tmp_from;; __from += __conv)
697 + __conv = mbrtowc(NULL, __from, __end - __from,
699 + if (__conv == static_cast<size_t>(-1)
700 + || __conv == static_cast<size_t>(-2))
703 + __state = __tmp_state;
704 + __ret += __from - __tmp_from;
708 + __from = __from_chunk_end;
710 + __ret += __from - __tmp_from;
713 + if (__from < __end && __max)
715 + // XXX Probably wrong for stateful encodings
716 + __tmp_state = __state;
723 +#ifdef __UCLIBC_HAS_XLOCALE__
724 + __uselocale(__old);
731 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc
732 ===================================================================
733 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
734 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-05-21 13:45:43.929287698 +0200
736 +// std::collate implementation details, GNU version -*- C++ -*-
738 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
740 +// This file is part of the GNU ISO C++ Library. This library is free
741 +// software; you can redistribute it and/or modify it under the
742 +// terms of the GNU General Public License as published by the
743 +// Free Software Foundation; either version 2, or (at your option)
744 +// any later version.
746 +// This library is distributed in the hope that it will be useful,
747 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
748 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
749 +// GNU General Public License for more details.
751 +// You should have received a copy of the GNU General Public License along
752 +// with this library; see the file COPYING. If not, write to the Free
753 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
756 +// As a special exception, you may use this file as part of a free software
757 +// library without restriction. Specifically, if other files instantiate
758 +// templates or use macros or inline functions from this file, or you compile
759 +// this file and link it with other files to produce an executable, this
760 +// file does not by itself cause the resulting executable to be covered by
761 +// the GNU General Public License. This exception does not however
762 +// invalidate any other reasons why the executable file might be covered by
763 +// the GNU General Public License.
766 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
769 +// Written by Benjamin Kosnik <bkoz@redhat.com>
772 +#include <bits/c++locale_internal.h>
774 +#ifndef __UCLIBC_HAS_XLOCALE__
775 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
776 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
777 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
778 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
783 + // These are basically extensions to char_traits, and perhaps should
784 + // be put there instead of here.
787 + collate<char>::_M_compare(const char* __one, const char* __two) const
789 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
790 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
795 + collate<char>::_M_transform(char* __to, const char* __from,
797 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
799 +#ifdef _GLIBCXX_USE_WCHAR_T
802 + collate<wchar_t>::_M_compare(const wchar_t* __one,
803 + const wchar_t* __two) const
805 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
806 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
811 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
813 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
816 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc
817 ===================================================================
818 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
819 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-05-21 13:45:43.929287698 +0200
821 +// std::ctype implementation details, GNU version -*- C++ -*-
823 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
825 +// This file is part of the GNU ISO C++ Library. This library is free
826 +// software; you can redistribute it and/or modify it under the
827 +// terms of the GNU General Public License as published by the
828 +// Free Software Foundation; either version 2, or (at your option)
829 +// any later version.
831 +// This library is distributed in the hope that it will be useful,
832 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
833 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
834 +// GNU General Public License for more details.
836 +// You should have received a copy of the GNU General Public License along
837 +// with this library; see the file COPYING. If not, write to the Free
838 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
841 +// As a special exception, you may use this file as part of a free software
842 +// library without restriction. Specifically, if other files instantiate
843 +// templates or use macros or inline functions from this file, or you compile
844 +// this file and link it with other files to produce an executable, this
845 +// file does not by itself cause the resulting executable to be covered by
846 +// the GNU General Public License. This exception does not however
847 +// invalidate any other reasons why the executable file might be covered by
848 +// the GNU General Public License.
851 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
854 +// Written by Benjamin Kosnik <bkoz@redhat.com>
859 +#include <bits/c++locale_internal.h>
861 +#ifndef __UCLIBC_HAS_XLOCALE__
862 +#define __wctype_l(S, L) wctype((S))
863 +#define __towupper_l(C, L) towupper((C))
864 +#define __towlower_l(C, L) towlower((C))
865 +#define __iswctype_l(C, M, L) iswctype((C), (M))
870 + // NB: The other ctype<char> specializations are in src/locale.cc and
871 + // various /config/os/* files.
873 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
874 + : ctype<char>(0, false, __refs)
876 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
878 + this->_S_destroy_c_locale(this->_M_c_locale_ctype);
879 + this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
880 +#ifdef __UCLIBC_HAS_XLOCALE__
881 + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
882 + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
883 + this->_M_table = this->_M_c_locale_ctype->__ctype_b;
888 +#ifdef _GLIBCXX_USE_WCHAR_T
889 + ctype<wchar_t>::__wmask_type
890 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
892 + __wmask_type __ret;
896 + __ret = __wctype_l("space", _M_c_locale_ctype);
899 + __ret = __wctype_l("print", _M_c_locale_ctype);
902 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
905 + __ret = __wctype_l("upper", _M_c_locale_ctype);
908 + __ret = __wctype_l("lower", _M_c_locale_ctype);
911 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
914 + __ret = __wctype_l("digit", _M_c_locale_ctype);
917 + __ret = __wctype_l("punct", _M_c_locale_ctype);
920 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
923 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
926 + __ret = __wctype_l("graph", _M_c_locale_ctype);
929 + __ret = __wmask_type();
935 + ctype<wchar_t>::do_toupper(wchar_t __c) const
936 + { return __towupper_l(__c, _M_c_locale_ctype); }
939 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
941 + while (__lo < __hi)
943 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
950 + ctype<wchar_t>::do_tolower(wchar_t __c) const
951 + { return __towlower_l(__c, _M_c_locale_ctype); }
954 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
956 + while (__lo < __hi)
958 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
966 + do_is(mask __m, wchar_t __c) const
968 + // Highest bitmask in ctype_base == 10, but extra in "C"
969 + // library for blank.
970 + bool __ret = false;
971 + const size_t __bitmasksize = 11;
972 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
973 + if (__m & _M_bit[__bitcur]
974 + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
984 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
986 + for (; __lo < __hi; ++__vec, ++__lo)
988 + // Highest bitmask in ctype_base == 10, but extra in "C"
989 + // library for blank.
990 + const size_t __bitmasksize = 11;
992 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
993 + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
994 + __m |= _M_bit[__bitcur];
1002 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1004 + while (__lo < __hi && !this->do_is(__m, *__lo))
1011 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1013 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1020 + do_widen(char __c) const
1021 + { return _M_widen[static_cast<unsigned char>(__c)]; }
1025 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1027 + while (__lo < __hi)
1029 + *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
1038 + do_narrow(wchar_t __wc, char __dfault) const
1040 + if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
1041 + return _M_narrow[__wc];
1042 +#ifdef __UCLIBC_HAS_XLOCALE__
1043 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1045 + const int __c = wctob(__wc);
1046 +#ifdef __UCLIBC_HAS_XLOCALE__
1047 + __uselocale(__old);
1049 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1054 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1055 + char* __dest) const
1057 +#ifdef __UCLIBC_HAS_XLOCALE__
1058 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1061 + while (__lo < __hi)
1063 + if (*__lo >= 0 && *__lo < 128)
1064 + *__dest = _M_narrow[*__lo];
1067 + const int __c = wctob(*__lo);
1068 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1074 + while (__lo < __hi)
1076 + const int __c = wctob(*__lo);
1077 + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
1081 +#ifdef __UCLIBC_HAS_XLOCALE__
1082 + __uselocale(__old);
1088 + ctype<wchar_t>::_M_initialize_ctype()
1090 +#ifdef __UCLIBC_HAS_XLOCALE__
1091 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1094 + for (__i = 0; __i < 128; ++__i)
1096 + const int __c = wctob(__i);
1100 + _M_narrow[__i] = static_cast<char>(__c);
1103 + _M_narrow_ok = true;
1105 + _M_narrow_ok = false;
1106 + for (size_t __j = 0;
1107 + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
1108 + _M_widen[__j] = btowc(__j);
1110 + for (size_t __k = 0; __k <= 11; ++__k)
1112 + _M_bit[__k] = static_cast<mask>(_ISbit(__k));
1113 + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
1115 +#ifdef __UCLIBC_HAS_XLOCALE__
1116 + __uselocale(__old);
1119 +#endif // _GLIBCXX_USE_WCHAR_T
1121 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc
1122 ===================================================================
1123 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1124 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-05-21 13:45:43.929287698 +0200
1126 +// std::messages implementation details, GNU version -*- C++ -*-
1128 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1130 +// This file is part of the GNU ISO C++ Library. This library is free
1131 +// software; you can redistribute it and/or modify it under the
1132 +// terms of the GNU General Public License as published by the
1133 +// Free Software Foundation; either version 2, or (at your option)
1134 +// any later version.
1136 +// This library is distributed in the hope that it will be useful,
1137 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1138 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1139 +// GNU General Public License for more details.
1141 +// You should have received a copy of the GNU General Public License along
1142 +// with this library; see the file COPYING. If not, write to the Free
1143 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1146 +// As a special exception, you may use this file as part of a free software
1147 +// library without restriction. Specifically, if other files instantiate
1148 +// templates or use macros or inline functions from this file, or you compile
1149 +// this file and link it with other files to produce an executable, this
1150 +// file does not by itself cause the resulting executable to be covered by
1151 +// the GNU General Public License. This exception does not however
1152 +// invalidate any other reasons why the executable file might be covered by
1153 +// the GNU General Public License.
1156 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1159 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1162 +#include <bits/c++locale_internal.h>
1164 +#ifdef __UCLIBC_MJN3_ONLY__
1165 +#warning fix gettext stuff
1167 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1168 +extern "C" char *__dcgettext(const char *domainname,
1169 + const char *msgid, int category);
1171 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1174 +#define gettext(msgid) (msgid)
1179 + // Specializations.
1182 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1184 +#ifdef __UCLIBC_HAS_XLOCALE__
1185 + __c_locale __old = __uselocale(_M_c_locale_messages);
1186 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1187 + __uselocale(__old);
1188 + return string(__msg);
1189 +#elif defined __UCLIBC_HAS_LOCALE__
1190 + char* __old = strdup(setlocale(LC_ALL, NULL));
1191 + setlocale(LC_ALL, _M_name_messages);
1192 + const char* __msg = gettext(__dfault.c_str());
1193 + setlocale(LC_ALL, __old);
1195 + return string(__msg);
1197 + const char* __msg = gettext(__dfault.c_str());
1198 + return string(__msg);
1202 +#ifdef _GLIBCXX_USE_WCHAR_T
1205 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1207 +# ifdef __UCLIBC_HAS_XLOCALE__
1208 + __c_locale __old = __uselocale(_M_c_locale_messages);
1209 + char* __msg = gettext(_M_convert_to_char(__dfault));
1210 + __uselocale(__old);
1211 + return _M_convert_from_char(__msg);
1212 +# elif defined __UCLIBC_HAS_LOCALE__
1213 + char* __old = strdup(setlocale(LC_ALL, NULL));
1214 + setlocale(LC_ALL, _M_name_messages);
1215 + char* __msg = gettext(_M_convert_to_char(__dfault));
1216 + setlocale(LC_ALL, __old);
1218 + return _M_convert_from_char(__msg);
1220 + char* __msg = gettext(_M_convert_to_char(__dfault));
1221 + return _M_convert_from_char(__msg);
1226 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h
1227 ===================================================================
1228 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1229 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-05-21 13:45:43.929287698 +0200
1231 +// std::messages implementation details, GNU version -*- C++ -*-
1233 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1235 +// This file is part of the GNU ISO C++ Library. This library is free
1236 +// software; you can redistribute it and/or modify it under the
1237 +// terms of the GNU General Public License as published by the
1238 +// Free Software Foundation; either version 2, or (at your option)
1239 +// any later version.
1241 +// This library is distributed in the hope that it will be useful,
1242 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1243 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1244 +// GNU General Public License for more details.
1246 +// You should have received a copy of the GNU General Public License along
1247 +// with this library; see the file COPYING. If not, write to the Free
1248 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1251 +// As a special exception, you may use this file as part of a free software
1252 +// library without restriction. Specifically, if other files instantiate
1253 +// templates or use macros or inline functions from this file, or you compile
1254 +// this file and link it with other files to produce an executable, this
1255 +// file does not by itself cause the resulting executable to be covered by
1256 +// the GNU General Public License. This exception does not however
1257 +// invalidate any other reasons why the executable file might be covered by
1258 +// the GNU General Public License.
1261 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1264 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1266 +#ifdef __UCLIBC_MJN3_ONLY__
1267 +#warning fix prototypes for *textdomain funcs
1269 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1270 +extern "C" char *__textdomain(const char *domainname);
1271 +extern "C" char *__bindtextdomain(const char *domainname,
1272 + const char *dirname);
1274 +#undef __textdomain
1275 +#undef __bindtextdomain
1276 +#define __textdomain(D) ((void)0)
1277 +#define __bindtextdomain(D,P) ((void)0)
1280 + // Non-virtual member functions.
1281 + template<typename _CharT>
1282 + messages<_CharT>::messages(size_t __refs)
1283 + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
1284 + _M_name_messages(_S_get_c_name())
1287 + template<typename _CharT>
1288 + messages<_CharT>::messages(__c_locale __cloc, const char* __s,
1290 + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
1291 + _M_name_messages(__s)
1293 + char* __tmp = new char[std::strlen(__s) + 1];
1294 + std::strcpy(__tmp, __s);
1295 + _M_name_messages = __tmp;
1298 + template<typename _CharT>
1299 + typename messages<_CharT>::catalog
1300 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1301 + const char* __dir) const
1303 + __bindtextdomain(__s.c_str(), __dir);
1304 + return this->do_open(__s, __loc);
1307 + // Virtual member functions.
1308 + template<typename _CharT>
1309 + messages<_CharT>::~messages()
1311 + if (_M_name_messages != _S_get_c_name())
1312 + delete [] _M_name_messages;
1313 + _S_destroy_c_locale(_M_c_locale_messages);
1316 + template<typename _CharT>
1317 + typename messages<_CharT>::catalog
1318 + messages<_CharT>::do_open(const basic_string<char>& __s,
1319 + const locale&) const
1321 + // No error checking is done, assume the catalog exists and can
1323 + __textdomain(__s.c_str());
1327 + template<typename _CharT>
1329 + messages<_CharT>::do_close(catalog) const
1332 + // messages_byname
1333 + template<typename _CharT>
1334 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1335 + : messages<_CharT>(__refs)
1337 + if (this->_M_name_messages != locale::facet::_S_get_c_name())
1338 + delete [] this->_M_name_messages;
1339 + char* __tmp = new char[std::strlen(__s) + 1];
1340 + std::strcpy(__tmp, __s);
1341 + this->_M_name_messages = __tmp;
1343 + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
1345 + this->_S_destroy_c_locale(this->_M_c_locale_messages);
1346 + this->_S_create_c_locale(this->_M_c_locale_messages, __s);
1349 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1350 ===================================================================
1351 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
1352 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-05-21 13:45:43.933287929 +0200
1354 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1356 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1358 +// This file is part of the GNU ISO C++ Library. This library is free
1359 +// software; you can redistribute it and/or modify it under the
1360 +// terms of the GNU General Public License as published by the
1361 +// Free Software Foundation; either version 2, or (at your option)
1362 +// any later version.
1364 +// This library is distributed in the hope that it will be useful,
1365 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1366 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1367 +// GNU General Public License for more details.
1369 +// You should have received a copy of the GNU General Public License along
1370 +// with this library; see the file COPYING. If not, write to the Free
1371 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1374 +// As a special exception, you may use this file as part of a free software
1375 +// library without restriction. Specifically, if other files instantiate
1376 +// templates or use macros or inline functions from this file, or you compile
1377 +// this file and link it with other files to produce an executable, this
1378 +// file does not by itself cause the resulting executable to be covered by
1379 +// the GNU General Public License. This exception does not however
1380 +// invalidate any other reasons why the executable file might be covered by
1381 +// the GNU General Public License.
1384 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1387 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1392 +#include <bits/c++locale_internal.h>
1394 +#ifdef __UCLIBC_MJN3_ONLY__
1395 +#warning optimize this for uclibc
1396 +#warning tailor for stub locale support
1399 +#ifndef __UCLIBC_HAS_XLOCALE__
1400 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1405 + // Construct and return valid pattern consisting of some combination of:
1406 + // space none symbol sign value
1407 + money_base::pattern
1408 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1412 + // This insanely complicated routine attempts to construct a valid
1413 + // pattern for use with monyepunct. A couple of invariants:
1415 + // if (__precedes) symbol -> value
1416 + // else value -> symbol
1418 + // if (__space) space
1421 + // none == never first
1422 + // space never first or last
1424 + // Any elegant implementations of this are welcome.
1429 + // 1 The sign precedes the value and symbol.
1430 + __ret.field[0] = sign;
1433 + // Pattern starts with sign.
1436 + __ret.field[1] = symbol;
1437 + __ret.field[3] = value;
1441 + __ret.field[1] = value;
1442 + __ret.field[3] = symbol;
1444 + __ret.field[2] = space;
1448 + // Pattern starts with sign and ends with none.
1451 + __ret.field[1] = symbol;
1452 + __ret.field[2] = value;
1456 + __ret.field[1] = value;
1457 + __ret.field[2] = symbol;
1459 + __ret.field[3] = none;
1463 + // 2 The sign follows the value and symbol.
1466 + // Pattern either ends with sign.
1469 + __ret.field[0] = symbol;
1470 + __ret.field[2] = value;
1474 + __ret.field[0] = value;
1475 + __ret.field[2] = symbol;
1477 + __ret.field[1] = space;
1478 + __ret.field[3] = sign;
1482 + // Pattern ends with sign then none.
1485 + __ret.field[0] = symbol;
1486 + __ret.field[1] = value;
1490 + __ret.field[0] = value;
1491 + __ret.field[1] = symbol;
1493 + __ret.field[2] = sign;
1494 + __ret.field[3] = none;
1498 + // 3 The sign immediately precedes the symbol.
1501 + __ret.field[0] = sign;
1502 + __ret.field[1] = symbol;
1505 + __ret.field[2] = space;
1506 + __ret.field[3] = value;
1510 + __ret.field[2] = value;
1511 + __ret.field[3] = none;
1516 + __ret.field[0] = value;
1519 + __ret.field[1] = space;
1520 + __ret.field[2] = sign;
1521 + __ret.field[3] = symbol;
1525 + __ret.field[1] = sign;
1526 + __ret.field[2] = symbol;
1527 + __ret.field[3] = none;
1532 + // 4 The sign immediately follows the symbol.
1535 + __ret.field[0] = symbol;
1536 + __ret.field[1] = sign;
1539 + __ret.field[2] = space;
1540 + __ret.field[3] = value;
1544 + __ret.field[2] = value;
1545 + __ret.field[3] = none;
1550 + __ret.field[0] = value;
1553 + __ret.field[1] = space;
1554 + __ret.field[2] = symbol;
1555 + __ret.field[3] = sign;
1559 + __ret.field[1] = symbol;
1560 + __ret.field[2] = sign;
1561 + __ret.field[3] = none;
1573 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1577 + _M_data = new __moneypunct_cache<char, true>;
1582 + _M_data->_M_decimal_point = '.';
1583 + _M_data->_M_thousands_sep = ',';
1584 + _M_data->_M_grouping = "";
1585 + _M_data->_M_grouping_size = 0;
1586 + _M_data->_M_curr_symbol = "";
1587 + _M_data->_M_curr_symbol_size = 0;
1588 + _M_data->_M_positive_sign = "";
1589 + _M_data->_M_positive_sign_size = 0;
1590 + _M_data->_M_negative_sign = "";
1591 + _M_data->_M_negative_sign_size = 0;
1592 + _M_data->_M_frac_digits = 0;
1593 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1594 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1596 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1597 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1602 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1604 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1606 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1607 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1608 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1609 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1611 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1613 + _M_data->_M_negative_sign = "()";
1615 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1617 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1620 + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1621 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1622 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1624 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1625 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1626 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1627 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1629 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1630 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1631 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1638 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1642 + _M_data = new __moneypunct_cache<char, false>;
1647 + _M_data->_M_decimal_point = '.';
1648 + _M_data->_M_thousands_sep = ',';
1649 + _M_data->_M_grouping = "";
1650 + _M_data->_M_grouping_size = 0;
1651 + _M_data->_M_curr_symbol = "";
1652 + _M_data->_M_curr_symbol_size = 0;
1653 + _M_data->_M_positive_sign = "";
1654 + _M_data->_M_positive_sign_size = 0;
1655 + _M_data->_M_negative_sign = "";
1656 + _M_data->_M_negative_sign_size = 0;
1657 + _M_data->_M_frac_digits = 0;
1658 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1659 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1661 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1662 + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
1667 + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
1669 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
1671 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1672 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1673 + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1674 + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
1676 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1678 + _M_data->_M_negative_sign = "()";
1680 + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
1682 + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
1685 + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1686 + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
1687 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1688 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1689 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1690 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1691 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1693 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1694 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1695 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1701 + moneypunct<char, true>::~moneypunct()
1702 + { delete _M_data; }
1705 + moneypunct<char, false>::~moneypunct()
1706 + { delete _M_data; }
1708 +#ifdef _GLIBCXX_USE_WCHAR_T
1711 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1712 +#ifdef __UCLIBC_HAS_XLOCALE__
1715 + const char* __name)
1719 + _M_data = new __moneypunct_cache<wchar_t, true>;
1724 + _M_data->_M_decimal_point = L'.';
1725 + _M_data->_M_thousands_sep = L',';
1726 + _M_data->_M_grouping = "";
1727 + _M_data->_M_grouping_size = 0;
1728 + _M_data->_M_curr_symbol = L"";
1729 + _M_data->_M_curr_symbol_size = 0;
1730 + _M_data->_M_positive_sign = L"";
1731 + _M_data->_M_positive_sign_size = 0;
1732 + _M_data->_M_negative_sign = L"";
1733 + _M_data->_M_negative_sign_size = 0;
1734 + _M_data->_M_frac_digits = 0;
1735 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1736 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1738 + // Use ctype::widen code without the facet...
1739 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1740 + _M_data->_M_atoms[__i] =
1741 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1746 +#ifdef __UCLIBC_HAS_XLOCALE__
1747 + __c_locale __old = __uselocale(__cloc);
1749 + // Switch to named locale so that mbsrtowcs will work.
1750 + char* __old = strdup(setlocale(LC_ALL, NULL));
1751 + setlocale(LC_ALL, __name);
1754 +#ifdef __UCLIBC_MJN3_ONLY__
1755 +#warning fix this... should be monetary
1758 +# ifdef __UCLIBC_HAS_XLOCALE__
1759 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1760 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1762 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1763 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1766 + union { char *__s; wchar_t __w; } __u;
1767 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1768 + _M_data->_M_decimal_point = __u.__w;
1770 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1771 + _M_data->_M_thousands_sep = __u.__w;
1773 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1774 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1776 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1777 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1778 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1780 + wchar_t* __wcs_ps = 0;
1781 + wchar_t* __wcs_ns = 0;
1782 + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1785 + mbstate_t __state;
1786 + size_t __len = strlen(__cpossign);
1790 + memset(&__state, 0, sizeof(mbstate_t));
1791 + __wcs_ps = new wchar_t[__len];
1792 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1793 + _M_data->_M_positive_sign = __wcs_ps;
1796 + _M_data->_M_positive_sign = L"";
1797 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1799 + __len = strlen(__cnegsign);
1801 + _M_data->_M_negative_sign = L"()";
1805 + memset(&__state, 0, sizeof(mbstate_t));
1806 + __wcs_ns = new wchar_t[__len];
1807 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1808 + _M_data->_M_negative_sign = __wcs_ns;
1811 + _M_data->_M_negative_sign = L"";
1812 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1815 + __len = strlen(__ccurr);
1819 + memset(&__state, 0, sizeof(mbstate_t));
1820 + wchar_t* __wcs = new wchar_t[__len];
1821 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1822 + _M_data->_M_curr_symbol = __wcs;
1825 + _M_data->_M_curr_symbol = L"";
1826 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1834 +#ifdef __UCLIBC_HAS_XLOCALE__
1835 + __uselocale(__old);
1837 + setlocale(LC_ALL, __old);
1840 + __throw_exception_again;
1843 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
1845 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1846 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1847 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1848 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
1850 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1851 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1852 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
1855 +#ifdef __UCLIBC_HAS_XLOCALE__
1856 + __uselocale(__old);
1858 + setlocale(LC_ALL, __old);
1866 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
1867 +#ifdef __UCLIBC_HAS_XLOCALE__
1870 + const char* __name)
1874 + _M_data = new __moneypunct_cache<wchar_t, false>;
1879 + _M_data->_M_decimal_point = L'.';
1880 + _M_data->_M_thousands_sep = L',';
1881 + _M_data->_M_grouping = "";
1882 + _M_data->_M_grouping_size = 0;
1883 + _M_data->_M_curr_symbol = L"";
1884 + _M_data->_M_curr_symbol_size = 0;
1885 + _M_data->_M_positive_sign = L"";
1886 + _M_data->_M_positive_sign_size = 0;
1887 + _M_data->_M_negative_sign = L"";
1888 + _M_data->_M_negative_sign_size = 0;
1889 + _M_data->_M_frac_digits = 0;
1890 + _M_data->_M_pos_format = money_base::_S_default_pattern;
1891 + _M_data->_M_neg_format = money_base::_S_default_pattern;
1893 + // Use ctype::widen code without the facet...
1894 + for (size_t __i = 0; __i < money_base::_S_end; ++__i)
1895 + _M_data->_M_atoms[__i] =
1896 + static_cast<wchar_t>(money_base::_S_atoms[__i]);
1901 +#ifdef __UCLIBC_HAS_XLOCALE__
1902 + __c_locale __old = __uselocale(__cloc);
1904 + // Switch to named locale so that mbsrtowcs will work.
1905 + char* __old = strdup(setlocale(LC_ALL, NULL));
1906 + setlocale(LC_ALL, __name);
1909 +#ifdef __UCLIBC_MJN3_ONLY__
1910 +#warning fix this... should be monetary
1913 +# ifdef __UCLIBC_HAS_XLOCALE__
1914 + _M_data->_M_decimal_point = __cloc->decimal_point_wc;
1915 + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
1917 + _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
1918 + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
1921 + union { char *__s; wchar_t __w; } __u;
1922 + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
1923 + _M_data->_M_decimal_point = __u.__w;
1925 + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
1926 + _M_data->_M_thousands_sep = __u.__w;
1928 + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1929 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
1931 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1932 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1933 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1935 + wchar_t* __wcs_ps = 0;
1936 + wchar_t* __wcs_ns = 0;
1937 + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1940 + mbstate_t __state;
1942 + __len = strlen(__cpossign);
1946 + memset(&__state, 0, sizeof(mbstate_t));
1947 + __wcs_ps = new wchar_t[__len];
1948 + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
1949 + _M_data->_M_positive_sign = __wcs_ps;
1952 + _M_data->_M_positive_sign = L"";
1953 + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
1955 + __len = strlen(__cnegsign);
1957 + _M_data->_M_negative_sign = L"()";
1961 + memset(&__state, 0, sizeof(mbstate_t));
1962 + __wcs_ns = new wchar_t[__len];
1963 + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
1964 + _M_data->_M_negative_sign = __wcs_ns;
1967 + _M_data->_M_negative_sign = L"";
1968 + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
1971 + __len = strlen(__ccurr);
1975 + memset(&__state, 0, sizeof(mbstate_t));
1976 + wchar_t* __wcs = new wchar_t[__len];
1977 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
1978 + _M_data->_M_curr_symbol = __wcs;
1981 + _M_data->_M_curr_symbol = L"";
1982 + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
1990 +#ifdef __UCLIBC_HAS_XLOCALE__
1991 + __uselocale(__old);
1993 + setlocale(LC_ALL, __old);
1996 + __throw_exception_again;
1999 + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2000 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2001 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2002 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2003 + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2005 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2006 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2007 + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2010 +#ifdef __UCLIBC_HAS_XLOCALE__
2011 + __uselocale(__old);
2013 + setlocale(LC_ALL, __old);
2020 + moneypunct<wchar_t, true>::~moneypunct()
2022 + if (_M_data->_M_positive_sign_size)
2023 + delete [] _M_data->_M_positive_sign;
2024 + if (_M_data->_M_negative_sign_size
2025 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2026 + delete [] _M_data->_M_negative_sign;
2027 + if (_M_data->_M_curr_symbol_size)
2028 + delete [] _M_data->_M_curr_symbol;
2033 + moneypunct<wchar_t, false>::~moneypunct()
2035 + if (_M_data->_M_positive_sign_size)
2036 + delete [] _M_data->_M_positive_sign;
2037 + if (_M_data->_M_negative_sign_size
2038 + && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2039 + delete [] _M_data->_M_negative_sign;
2040 + if (_M_data->_M_curr_symbol_size)
2041 + delete [] _M_data->_M_curr_symbol;
2046 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2047 ===================================================================
2048 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2049 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-05-21 13:45:43.933287929 +0200
2051 +// std::numpunct implementation details, GNU version -*- C++ -*-
2053 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2055 +// This file is part of the GNU ISO C++ Library. This library is free
2056 +// software; you can redistribute it and/or modify it under the
2057 +// terms of the GNU General Public License as published by the
2058 +// Free Software Foundation; either version 2, or (at your option)
2059 +// any later version.
2061 +// This library is distributed in the hope that it will be useful,
2062 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2063 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2064 +// GNU General Public License for more details.
2066 +// You should have received a copy of the GNU General Public License along
2067 +// with this library; see the file COPYING. If not, write to the Free
2068 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2071 +// As a special exception, you may use this file as part of a free software
2072 +// library without restriction. Specifically, if other files instantiate
2073 +// templates or use macros or inline functions from this file, or you compile
2074 +// this file and link it with other files to produce an executable, this
2075 +// file does not by itself cause the resulting executable to be covered by
2076 +// the GNU General Public License. This exception does not however
2077 +// invalidate any other reasons why the executable file might be covered by
2078 +// the GNU General Public License.
2081 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2084 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2089 +#include <bits/c++locale_internal.h>
2091 +#ifdef __UCLIBC_MJN3_ONLY__
2092 +#warning tailor for stub locale support
2094 +#ifndef __UCLIBC_HAS_XLOCALE__
2095 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2102 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2105 + _M_data = new __numpunct_cache<char>;
2110 + _M_data->_M_grouping = "";
2111 + _M_data->_M_grouping_size = 0;
2112 + _M_data->_M_use_grouping = false;
2114 + _M_data->_M_decimal_point = '.';
2115 + _M_data->_M_thousands_sep = ',';
2117 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2118 + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2120 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2121 + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2126 + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2128 + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2131 + // Check for NULL, which implies no grouping.
2132 + if (_M_data->_M_thousands_sep == '\0')
2133 + _M_data->_M_grouping = "";
2135 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2136 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2139 + // NB: There is no way to extact this info from posix locales.
2140 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2141 + _M_data->_M_truename = "true";
2142 + _M_data->_M_truename_size = 4;
2143 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2144 + _M_data->_M_falsename = "false";
2145 + _M_data->_M_falsename_size = 5;
2149 + numpunct<char>::~numpunct()
2150 + { delete _M_data; }
2152 +#ifdef _GLIBCXX_USE_WCHAR_T
2155 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2158 + _M_data = new __numpunct_cache<wchar_t>;
2163 + _M_data->_M_grouping = "";
2164 + _M_data->_M_grouping_size = 0;
2165 + _M_data->_M_use_grouping = false;
2167 + _M_data->_M_decimal_point = L'.';
2168 + _M_data->_M_thousands_sep = L',';
2170 + // Use ctype::widen code without the facet...
2171 + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2172 + _M_data->_M_atoms_out[__i] =
2173 + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2175 + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2176 + _M_data->_M_atoms_in[__j] =
2177 + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2182 + // NB: In the GNU model wchar_t is always 32 bit wide.
2183 + union { char *__s; wchar_t __w; } __u;
2184 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2185 + _M_data->_M_decimal_point = __u.__w;
2187 + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2188 + _M_data->_M_thousands_sep = __u.__w;
2190 + if (_M_data->_M_thousands_sep == L'\0')
2191 + _M_data->_M_grouping = "";
2193 + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2194 + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2197 + // NB: There is no way to extact this info from posix locales.
2198 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2199 + _M_data->_M_truename = L"true";
2200 + _M_data->_M_truename_size = 4;
2201 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2202 + _M_data->_M_falsename = L"false";
2203 + _M_data->_M_falsename_size = 5;
2207 + numpunct<wchar_t>::~numpunct()
2208 + { delete _M_data; }
2211 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc
2212 ===================================================================
2213 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2214 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-05-21 13:45:43.933287929 +0200
2216 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2218 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2220 +// This file is part of the GNU ISO C++ Library. This library is free
2221 +// software; you can redistribute it and/or modify it under the
2222 +// terms of the GNU General Public License as published by the
2223 +// Free Software Foundation; either version 2, or (at your option)
2224 +// any later version.
2226 +// This library is distributed in the hope that it will be useful,
2227 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2228 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2229 +// GNU General Public License for more details.
2231 +// You should have received a copy of the GNU General Public License along
2232 +// with this library; see the file COPYING. If not, write to the Free
2233 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2236 +// As a special exception, you may use this file as part of a free software
2237 +// library without restriction. Specifically, if other files instantiate
2238 +// templates or use macros or inline functions from this file, or you compile
2239 +// this file and link it with other files to produce an executable, this
2240 +// file does not by itself cause the resulting executable to be covered by
2241 +// the GNU General Public License. This exception does not however
2242 +// invalidate any other reasons why the executable file might be covered by
2243 +// the GNU General Public License.
2246 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2247 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2250 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2253 +#include <bits/c++locale_internal.h>
2255 +#ifdef __UCLIBC_MJN3_ONLY__
2256 +#warning tailor for stub locale support
2258 +#ifndef __UCLIBC_HAS_XLOCALE__
2259 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2266 + __timepunct<char>::
2267 + _M_put(char* __s, size_t __maxlen, const char* __format,
2268 + const tm* __tm) const
2270 +#ifdef __UCLIBC_HAS_XLOCALE__
2271 + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2272 + _M_c_locale_timepunct);
2274 + char* __old = strdup(setlocale(LC_ALL, NULL));
2275 + setlocale(LC_ALL, _M_name_timepunct);
2276 + const size_t __len = strftime(__s, __maxlen, __format, __tm);
2277 + setlocale(LC_ALL, __old);
2280 + // Make sure __s is null terminated.
2287 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2290 + _M_data = new __timepunct_cache<char>;
2295 + _M_c_locale_timepunct = _S_get_c_locale();
2297 + _M_data->_M_date_format = "%m/%d/%y";
2298 + _M_data->_M_date_era_format = "%m/%d/%y";
2299 + _M_data->_M_time_format = "%H:%M:%S";
2300 + _M_data->_M_time_era_format = "%H:%M:%S";
2301 + _M_data->_M_date_time_format = "";
2302 + _M_data->_M_date_time_era_format = "";
2303 + _M_data->_M_am = "AM";
2304 + _M_data->_M_pm = "PM";
2305 + _M_data->_M_am_pm_format = "";
2307 + // Day names, starting with "C"'s Sunday.
2308 + _M_data->_M_day1 = "Sunday";
2309 + _M_data->_M_day2 = "Monday";
2310 + _M_data->_M_day3 = "Tuesday";
2311 + _M_data->_M_day4 = "Wednesday";
2312 + _M_data->_M_day5 = "Thursday";
2313 + _M_data->_M_day6 = "Friday";
2314 + _M_data->_M_day7 = "Saturday";
2316 + // Abbreviated day names, starting with "C"'s Sun.
2317 + _M_data->_M_aday1 = "Sun";
2318 + _M_data->_M_aday2 = "Mon";
2319 + _M_data->_M_aday3 = "Tue";
2320 + _M_data->_M_aday4 = "Wed";
2321 + _M_data->_M_aday5 = "Thu";
2322 + _M_data->_M_aday6 = "Fri";
2323 + _M_data->_M_aday7 = "Sat";
2325 + // Month names, starting with "C"'s January.
2326 + _M_data->_M_month01 = "January";
2327 + _M_data->_M_month02 = "February";
2328 + _M_data->_M_month03 = "March";
2329 + _M_data->_M_month04 = "April";
2330 + _M_data->_M_month05 = "May";
2331 + _M_data->_M_month06 = "June";
2332 + _M_data->_M_month07 = "July";
2333 + _M_data->_M_month08 = "August";
2334 + _M_data->_M_month09 = "September";
2335 + _M_data->_M_month10 = "October";
2336 + _M_data->_M_month11 = "November";
2337 + _M_data->_M_month12 = "December";
2339 + // Abbreviated month names, starting with "C"'s Jan.
2340 + _M_data->_M_amonth01 = "Jan";
2341 + _M_data->_M_amonth02 = "Feb";
2342 + _M_data->_M_amonth03 = "Mar";
2343 + _M_data->_M_amonth04 = "Apr";
2344 + _M_data->_M_amonth05 = "May";
2345 + _M_data->_M_amonth06 = "Jun";
2346 + _M_data->_M_amonth07 = "Jul";
2347 + _M_data->_M_amonth08 = "Aug";
2348 + _M_data->_M_amonth09 = "Sep";
2349 + _M_data->_M_amonth10 = "Oct";
2350 + _M_data->_M_amonth11 = "Nov";
2351 + _M_data->_M_amonth12 = "Dec";
2355 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2357 + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2358 + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2359 + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2360 + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2361 + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2362 + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2364 + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2365 + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2366 + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2368 + // Day names, starting with "C"'s Sunday.
2369 + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2370 + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2371 + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2372 + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2373 + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2374 + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2375 + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2377 + // Abbreviated day names, starting with "C"'s Sun.
2378 + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2379 + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2380 + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2381 + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2382 + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2383 + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2384 + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2386 + // Month names, starting with "C"'s January.
2387 + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2388 + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2389 + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2390 + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2391 + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2392 + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2393 + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2394 + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2395 + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2396 + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2397 + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2398 + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2400 + // Abbreviated month names, starting with "C"'s Jan.
2401 + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2402 + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2403 + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2404 + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2405 + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2406 + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2407 + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2408 + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2409 + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2410 + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2411 + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2412 + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2416 +#ifdef _GLIBCXX_USE_WCHAR_T
2419 + __timepunct<wchar_t>::
2420 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2421 + const tm* __tm) const
2423 +#ifdef __UCLIBC_HAS_XLOCALE__
2424 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2425 + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2426 + _M_c_locale_timepunct);
2428 + char* __old = strdup(setlocale(LC_ALL, NULL));
2429 + setlocale(LC_ALL, _M_name_timepunct);
2430 + const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2431 + setlocale(LC_ALL, __old);
2434 + // Make sure __s is null terminated.
2441 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2444 + _M_data = new __timepunct_cache<wchar_t>;
2446 +#warning wide time stuff
2450 + _M_c_locale_timepunct = _S_get_c_locale();
2452 + _M_data->_M_date_format = L"%m/%d/%y";
2453 + _M_data->_M_date_era_format = L"%m/%d/%y";
2454 + _M_data->_M_time_format = L"%H:%M:%S";
2455 + _M_data->_M_time_era_format = L"%H:%M:%S";
2456 + _M_data->_M_date_time_format = L"";
2457 + _M_data->_M_date_time_era_format = L"";
2458 + _M_data->_M_am = L"AM";
2459 + _M_data->_M_pm = L"PM";
2460 + _M_data->_M_am_pm_format = L"";
2462 + // Day names, starting with "C"'s Sunday.
2463 + _M_data->_M_day1 = L"Sunday";
2464 + _M_data->_M_day2 = L"Monday";
2465 + _M_data->_M_day3 = L"Tuesday";
2466 + _M_data->_M_day4 = L"Wednesday";
2467 + _M_data->_M_day5 = L"Thursday";
2468 + _M_data->_M_day6 = L"Friday";
2469 + _M_data->_M_day7 = L"Saturday";
2471 + // Abbreviated day names, starting with "C"'s Sun.
2472 + _M_data->_M_aday1 = L"Sun";
2473 + _M_data->_M_aday2 = L"Mon";
2474 + _M_data->_M_aday3 = L"Tue";
2475 + _M_data->_M_aday4 = L"Wed";
2476 + _M_data->_M_aday5 = L"Thu";
2477 + _M_data->_M_aday6 = L"Fri";
2478 + _M_data->_M_aday7 = L"Sat";
2480 + // Month names, starting with "C"'s January.
2481 + _M_data->_M_month01 = L"January";
2482 + _M_data->_M_month02 = L"February";
2483 + _M_data->_M_month03 = L"March";
2484 + _M_data->_M_month04 = L"April";
2485 + _M_data->_M_month05 = L"May";
2486 + _M_data->_M_month06 = L"June";
2487 + _M_data->_M_month07 = L"July";
2488 + _M_data->_M_month08 = L"August";
2489 + _M_data->_M_month09 = L"September";
2490 + _M_data->_M_month10 = L"October";
2491 + _M_data->_M_month11 = L"November";
2492 + _M_data->_M_month12 = L"December";
2494 + // Abbreviated month names, starting with "C"'s Jan.
2495 + _M_data->_M_amonth01 = L"Jan";
2496 + _M_data->_M_amonth02 = L"Feb";
2497 + _M_data->_M_amonth03 = L"Mar";
2498 + _M_data->_M_amonth04 = L"Apr";
2499 + _M_data->_M_amonth05 = L"May";
2500 + _M_data->_M_amonth06 = L"Jun";
2501 + _M_data->_M_amonth07 = L"Jul";
2502 + _M_data->_M_amonth08 = L"Aug";
2503 + _M_data->_M_amonth09 = L"Sep";
2504 + _M_data->_M_amonth10 = L"Oct";
2505 + _M_data->_M_amonth11 = L"Nov";
2506 + _M_data->_M_amonth12 = L"Dec";
2511 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2513 + union { char *__s; wchar_t *__w; } __u;
2515 + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2516 + _M_data->_M_date_format = __u.__w;
2517 + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2518 + _M_data->_M_date_era_format = __u.__w;
2519 + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2520 + _M_data->_M_time_format = __u.__w;
2521 + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2522 + _M_data->_M_time_era_format = __u.__w;
2523 + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2524 + _M_data->_M_date_time_format = __u.__w;
2525 + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2526 + _M_data->_M_date_time_era_format = __u.__w;
2527 + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2528 + _M_data->_M_am = __u.__w;
2529 + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2530 + _M_data->_M_pm = __u.__w;
2531 + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2532 + _M_data->_M_am_pm_format = __u.__w;
2534 + // Day names, starting with "C"'s Sunday.
2535 + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2536 + _M_data->_M_day1 = __u.__w;
2537 + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2538 + _M_data->_M_day2 = __u.__w;
2539 + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2540 + _M_data->_M_day3 = __u.__w;
2541 + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2542 + _M_data->_M_day4 = __u.__w;
2543 + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2544 + _M_data->_M_day5 = __u.__w;
2545 + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2546 + _M_data->_M_day6 = __u.__w;
2547 + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2548 + _M_data->_M_day7 = __u.__w;
2550 + // Abbreviated day names, starting with "C"'s Sun.
2551 + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2552 + _M_data->_M_aday1 = __u.__w;
2553 + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2554 + _M_data->_M_aday2 = __u.__w;
2555 + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2556 + _M_data->_M_aday3 = __u.__w;
2557 + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2558 + _M_data->_M_aday4 = __u.__w;
2559 + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2560 + _M_data->_M_aday5 = __u.__w;
2561 + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2562 + _M_data->_M_aday6 = __u.__w;
2563 + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2564 + _M_data->_M_aday7 = __u.__w;
2566 + // Month names, starting with "C"'s January.
2567 + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2568 + _M_data->_M_month01 = __u.__w;
2569 + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2570 + _M_data->_M_month02 = __u.__w;
2571 + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2572 + _M_data->_M_month03 = __u.__w;
2573 + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2574 + _M_data->_M_month04 = __u.__w;
2575 + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2576 + _M_data->_M_month05 = __u.__w;
2577 + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2578 + _M_data->_M_month06 = __u.__w;
2579 + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2580 + _M_data->_M_month07 = __u.__w;
2581 + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2582 + _M_data->_M_month08 = __u.__w;
2583 + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2584 + _M_data->_M_month09 = __u.__w;
2585 + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2586 + _M_data->_M_month10 = __u.__w;
2587 + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2588 + _M_data->_M_month11 = __u.__w;
2589 + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2590 + _M_data->_M_month12 = __u.__w;
2592 + // Abbreviated month names, starting with "C"'s Jan.
2593 + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2594 + _M_data->_M_amonth01 = __u.__w;
2595 + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2596 + _M_data->_M_amonth02 = __u.__w;
2597 + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2598 + _M_data->_M_amonth03 = __u.__w;
2599 + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2600 + _M_data->_M_amonth04 = __u.__w;
2601 + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2602 + _M_data->_M_amonth05 = __u.__w;
2603 + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2604 + _M_data->_M_amonth06 = __u.__w;
2605 + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2606 + _M_data->_M_amonth07 = __u.__w;
2607 + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2608 + _M_data->_M_amonth08 = __u.__w;
2609 + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2610 + _M_data->_M_amonth09 = __u.__w;
2611 + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2612 + _M_data->_M_amonth10 = __u.__w;
2613 + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2614 + _M_data->_M_amonth11 = __u.__w;
2615 + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2616 + _M_data->_M_amonth12 = __u.__w;
2622 Index: gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h
2623 ===================================================================
2624 --- /dev/null 1970-01-01 00:00:00.000000000 +0000
2625 +++ gcc-4.2.3/libstdc++-v3/config/locale/uclibc/time_members.h 2008-05-21 13:45:43.933287929 +0200
2627 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2629 +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2631 +// This file is part of the GNU ISO C++ Library. This library is free
2632 +// software; you can redistribute it and/or modify it under the
2633 +// terms of the GNU General Public License as published by the
2634 +// Free Software Foundation; either version 2, or (at your option)
2635 +// any later version.
2637 +// This library is distributed in the hope that it will be useful,
2638 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2639 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2640 +// GNU General Public License for more details.
2642 +// You should have received a copy of the GNU General Public License along
2643 +// with this library; see the file COPYING. If not, write to the Free
2644 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2647 +// As a special exception, you may use this file as part of a free software
2648 +// library without restriction. Specifically, if other files instantiate
2649 +// templates or use macros or inline functions from this file, or you compile
2650 +// this file and link it with other files to produce an executable, this
2651 +// file does not by itself cause the resulting executable to be covered by
2652 +// the GNU General Public License. This exception does not however
2653 +// invalidate any other reasons why the executable file might be covered by
2654 +// the GNU General Public License.
2657 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2658 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2661 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2663 + template<typename _CharT>
2664 + __timepunct<_CharT>::__timepunct(size_t __refs)
2665 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2666 + _M_name_timepunct(_S_get_c_name())
2667 + { _M_initialize_timepunct(); }
2669 + template<typename _CharT>
2670 + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2671 + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2672 + _M_name_timepunct(_S_get_c_name())
2673 + { _M_initialize_timepunct(); }
2675 + template<typename _CharT>
2676 + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2678 + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2679 + _M_name_timepunct(__s)
2681 + char* __tmp = new char[std::strlen(__s) + 1];
2682 + std::strcpy(__tmp, __s);
2683 + _M_name_timepunct = __tmp;
2684 + _M_initialize_timepunct(__cloc);
2687 + template<typename _CharT>
2688 + __timepunct<_CharT>::~__timepunct()
2690 + if (_M_name_timepunct != _S_get_c_name())
2691 + delete [] _M_name_timepunct;
2693 + _S_destroy_c_locale(_M_c_locale_timepunct);
2695 Index: gcc-4.2.3/libstdc++-v3/configure
2696 ===================================================================
2697 --- gcc-4.2.3.orig/libstdc++-v3/configure 2008-05-21 13:45:41.725287971 +0200
2698 +++ gcc-4.2.3/libstdc++-v3/configure 2008-05-21 13:45:44.017287734 +0200
2699 @@ -5769,7 +5769,7 @@
2700 enableval="$enable_clocale"
2702 case "$enableval" in
2703 - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2704 + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
2705 *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
2706 echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
2707 { (exit 1); exit 1; }; } ;;
2708 @@ -5802,6 +5802,9 @@
2709 # Default to "generic".
2710 if test $enable_clocale_flag = auto; then
2711 case ${target_os} in
2713 + enable_clocale_flag=uclibc
2715 linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2716 enable_clocale_flag=gnu
2718 @@ -6190,6 +6193,76 @@
2719 CTIME_CC=config/locale/generic/time_members.cc
2720 CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2723 + echo "$as_me:$LINENO: result: uclibc" >&5
2724 +echo "${ECHO_T}uclibc" >&6
2726 + # Declare intention to use gettext, and add support for specific
2728 + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2729 + ALL_LINGUAS="de fr"
2731 + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2732 + # Extract the first word of "msgfmt", so it can be a program name with args.
2733 +set dummy msgfmt; ac_word=$2
2734 +echo "$as_me:$LINENO: checking for $ac_word" >&5
2735 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2736 +if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2737 + echo $ECHO_N "(cached) $ECHO_C" >&6
2739 + if test -n "$check_msgfmt"; then
2740 + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2742 +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2743 +for as_dir in $PATH
2746 + test -z "$as_dir" && as_dir=.
2747 + for ac_exec_ext in '' $ac_executable_extensions; do
2748 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2749 + ac_cv_prog_check_msgfmt="yes"
2750 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2756 + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
2759 +check_msgfmt=$ac_cv_prog_check_msgfmt
2760 +if test -n "$check_msgfmt"; then
2761 + echo "$as_me:$LINENO: result: $check_msgfmt" >&5
2762 +echo "${ECHO_T}$check_msgfmt" >&6
2764 + echo "$as_me:$LINENO: result: no" >&5
2765 +echo "${ECHO_T}no" >&6
2768 + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2771 + # Export the build objects.
2772 + for ling in $ALL_LINGUAS; do \
2773 + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2774 + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2779 + CLOCALE_H=config/locale/uclibc/c_locale.h
2780 + CLOCALE_CC=config/locale/uclibc/c_locale.cc
2781 + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2782 + CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2783 + CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2784 + CMESSAGES_H=config/locale/uclibc/messages_members.h
2785 + CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2786 + CMONEY_CC=config/locale/uclibc/monetary_members.cc
2787 + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2788 + CTIME_H=config/locale/uclibc/time_members.h
2789 + CTIME_CC=config/locale/uclibc/time_members.cc
2790 + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2794 # This is where the testsuite looks for locale catalogs, using the
2795 Index: gcc-4.2.3/libstdc++-v3/include/c_compatibility/wchar.h
2796 ===================================================================
2797 --- gcc-4.2.3.orig/libstdc++-v3/include/c_compatibility/wchar.h 2005-08-17 04:28:44.000000000 +0200
2798 +++ gcc-4.2.3/libstdc++-v3/include/c_compatibility/wchar.h 2008-05-21 13:45:44.021288244 +0200
2801 using std::wmemmove;
2803 +#if _GLIBCXX_HAVE_WCSFTIME
2804 using std::wcsftime;
2807 #if _GLIBCXX_USE_C99
2809 Index: gcc-4.2.3/libstdc++-v3/include/c_std/std_cwchar.h
2810 ===================================================================
2811 --- gcc-4.2.3.orig/libstdc++-v3/include/c_std/std_cwchar.h 2006-12-07 10:33:51.000000000 +0100
2812 +++ gcc-4.2.3/libstdc++-v3/include/c_std/std_cwchar.h 2008-05-21 13:45:44.021288244 +0200
2817 +#if _GLIBCXX_HAVE_WCSFTIME