1 Warning! This patch is not finished. The wide char time-related stuff
2 is broken or non-functional. But it serves as a starting point to get
3 things building while I continue to work on the uClibc locale internals.
4 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
5 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600
6 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2004-01-09 07:55:02.000000000 -0600
8 +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
10 +// Copyright (C) 2002 Free Software Foundation, Inc.
12 +// This file is part of the GNU ISO C++ Library. This library is free
13 +// software; you can redistribute it and/or modify it under the
14 +// terms of the GNU General Public License as published by the
15 +// Free Software Foundation; either version 2, or (at your option)
16 +// any later version.
18 +// This library is distributed in the hope that it will be useful,
19 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
20 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 +// GNU General Public License for more details.
23 +// You should have received a copy of the GNU General Public License along
24 +// with this library; see the file COPYING. If not, write to the Free
25 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
28 +// As a special exception, you may use this file as part of a free software
29 +// library without restriction. Specifically, if other files instantiate
30 +// templates or use macros or inline functions from this file, or you compile
31 +// this file and link it with other files to produce an executable, this
32 +// file does not by itself cause the resulting executable to be covered by
33 +// the GNU General Public License. This exception does not however
34 +// invalidate any other reasons why the executable file might be covered by
35 +// the GNU General Public License.
37 +// Written by Jakub Jelinek <jakub@redhat.com>
41 +#ifdef __UCLIBC_MJN3_ONLY__
42 +#warning clean this up
45 +#ifdef __UCLIBC_HAS_XLOCALE__
47 +extern "C" __typeof(iswctype_l) __iswctype_l;
48 +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
49 +extern "C" __typeof(strcoll_l) __strcoll_l;
50 +extern "C" __typeof(strftime_l) __strftime_l;
51 +extern "C" __typeof(strtod_l) __strtod_l;
52 +extern "C" __typeof(strtof_l) __strtof_l;
53 +extern "C" __typeof(strtold_l) __strtold_l;
54 +extern "C" __typeof(strtol_l) __strtol_l;
55 +extern "C" __typeof(strtoll_l) __strtoll_l;
56 +extern "C" __typeof(strtoul_l) __strtoul_l;
57 +extern "C" __typeof(strtoull_l) __strtoull_l;
58 +extern "C" __typeof(strxfrm_l) __strxfrm_l;
59 +extern "C" __typeof(towlower_l) __towlower_l;
60 +extern "C" __typeof(towupper_l) __towupper_l;
61 +extern "C" __typeof(wcscoll_l) __wcscoll_l;
62 +extern "C" __typeof(wcsftime_l) __wcsftime_l;
63 +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
64 +extern "C" __typeof(wctype_l) __wctype_l;
65 +extern "C" __typeof(newlocale) __newlocale;
66 +extern "C" __typeof(freelocale) __freelocale;
67 +extern "C" __typeof(duplocale) __duplocale;
68 +extern "C" __typeof(uselocale) __uselocale;
70 +#endif // GLIBC 2.3 and later
71 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc
72 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600
73 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.cc 2004-01-09 08:37:55.000000000 -0600
75 +// Wrapper for underlying C-language localization -*- C++ -*-
77 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
79 +// This file is part of the GNU ISO C++ Library. This library is free
80 +// software; you can redistribute it and/or modify it under the
81 +// terms of the GNU General Public License as published by the
82 +// Free Software Foundation; either version 2, or (at your option)
83 +// any later version.
85 +// This library is distributed in the hope that it will be useful,
86 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
87 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
88 +// GNU General Public License for more details.
90 +// You should have received a copy of the GNU General Public License along
91 +// with this library; see the file COPYING. If not, write to the Free
92 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
95 +// As a special exception, you may use this file as part of a free software
96 +// library without restriction. Specifically, if other files instantiate
97 +// templates or use macros or inline functions from this file, or you compile
98 +// this file and link it with other files to produce an executable, this
99 +// file does not by itself cause the resulting executable to be covered by
100 +// the GNU General Public License. This exception does not however
101 +// invalidate any other reasons why the executable file might be covered by
102 +// the GNU General Public License.
105 +// ISO C++ 14882: 22.8 Standard locale categories.
108 +// Written by Benjamin Kosnik <bkoz@redhat.com>
111 +#include <stdexcept>
112 +#include <langinfo.h>
113 +#include <bits/c++locale_internal.h>
115 +#ifndef __UCLIBC_HAS_XLOCALE__
116 +#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
117 +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
118 +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
119 +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
120 +#define __strtof_l(S, E, L) strtof((S), (E))
121 +#define __strtod_l(S, E, L) strtod((S), (E))
122 +#define __strtold_l(S, E, L) strtold((S), (E))
129 + __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
130 + const __c_locale& __cloc, int __base)
132 + if (!(__err & ios_base::failbit))
136 + long __l = __strtol_l(__s, &__sanity, __base, __cloc);
137 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
140 + __err |= ios_base::failbit;
146 + __convert_to_v(const char* __s, unsigned long& __v,
147 + ios_base::iostate& __err, const __c_locale& __cloc,
150 + if (!(__err & ios_base::failbit))
154 + unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
155 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
158 + __err |= ios_base::failbit;
162 +#ifdef _GLIBCPP_USE_LONG_LONG
165 + __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
166 + const __c_locale& __cloc, int __base)
168 + if (!(__err & ios_base::failbit))
172 + long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
173 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
176 + __err |= ios_base::failbit;
182 + __convert_to_v(const char* __s, unsigned long long& __v,
183 + ios_base::iostate& __err, const __c_locale& __cloc,
186 + if (!(__err & ios_base::failbit))
190 + unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
192 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
195 + __err |= ios_base::failbit;
202 + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
203 + const __c_locale& __cloc, int)
205 + if (!(__err & ios_base::failbit))
209 + float __f = __strtof_l(__s, &__sanity, __cloc);
210 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
213 + __err |= ios_base::failbit;
219 + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
220 + const __c_locale& __cloc, int)
222 + if (!(__err & ios_base::failbit))
226 + double __d = __strtod_l(__s, &__sanity, __cloc);
227 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
230 + __err |= ios_base::failbit;
236 + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
237 + const __c_locale& __cloc, int)
239 + if (!(__err & ios_base::failbit))
243 + long double __ld = __strtold_l(__s, &__sanity, __cloc);
244 + if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
247 + __err |= ios_base::failbit;
252 + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
255 +#ifdef __UCLIBC_HAS_XLOCALE__
256 + __cloc = __newlocale(1 << LC_ALL, __s, __old);
259 + // This named locale is not supported by the underlying OS.
260 + __throw_runtime_error("attempt to create locale from unknown name");
268 + locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
270 +#ifdef __UCLIBC_HAS_XLOCALE__
271 + if (_S_c_locale != __cloc)
272 + __freelocale(__cloc);
279 + locale::facet::_S_clone_c_locale(__c_locale& __cloc)
280 +#ifdef __UCLIBC_HAS_XLOCALE__
281 + { return __duplocale(__cloc); }
283 + { return __c_locale(); }
286 + const char* locale::_S_categories[_S_categories_size
287 + + _S_extra_categories_size] =
295 +#if _GLIBCPP_NUM_CATEGORIES != 0
302 + "LC_IDENTIFICATION"
306 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h
307 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600
308 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/c_locale.h 2004-01-09 07:51:06.000000000 -0600
310 +// Wrapper for underlying C-language localization -*- C++ -*-
312 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
314 +// This file is part of the GNU ISO C++ Library. This library is free
315 +// software; you can redistribute it and/or modify it under the
316 +// terms of the GNU General Public License as published by the
317 +// Free Software Foundation; either version 2, or (at your option)
318 +// any later version.
320 +// This library is distributed in the hope that it will be useful,
321 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
322 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
323 +// GNU General Public License for more details.
325 +// You should have received a copy of the GNU General Public License along
326 +// with this library; see the file COPYING. If not, write to the Free
327 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
330 +// As a special exception, you may use this file as part of a free software
331 +// library without restriction. Specifically, if other files instantiate
332 +// templates or use macros or inline functions from this file, or you compile
333 +// this file and link it with other files to produce an executable, this
334 +// file does not by itself cause the resulting executable to be covered by
335 +// the GNU General Public License. This exception does not however
336 +// invalidate any other reasons why the executable file might be covered by
337 +// the GNU General Public License.
340 +// ISO C++ 14882: 22.8 Standard locale categories.
343 +// Written by Benjamin Kosnik <bkoz@redhat.com>
345 +#ifndef _CPP_BITS_C_LOCALE_H
346 +#define _CPP_BITS_C_LOCALE_H 1
348 +#pragma GCC system_header
351 +#include <langinfo.h> // For codecvt
352 +#ifdef __UCLIBC_MJN3_ONLY__
355 +#ifdef __UCLIBC_HAS_LOCALE__
356 +#include <iconv.h> // For codecvt using iconv, iconv_t
358 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
359 +#include <libintl.h> // For messages
362 +#ifdef __UCLIBC_MJN3_ONLY__
363 +#warning what is _GLIBCPP_C_LOCALE_GNU for
365 +#define _GLIBCPP_C_LOCALE_GNU 1
367 +#ifdef __UCLIBC_MJN3_ONLY__
368 +#warning fix categories
370 +// #define _GLIBCPP_NUM_CATEGORIES 6
371 +#define _GLIBCPP_NUM_CATEGORIES 0
373 +#ifdef __UCLIBC_HAS_XLOCALE__
376 + extern "C" __typeof(uselocale) __uselocale;
382 +#ifdef __UCLIBC_HAS_XLOCALE__
383 + typedef __locale_t __c_locale;
385 + typedef int* __c_locale;
388 + // Convert numeric value of type _Tv to string and return length of
389 + // string. If snprintf is available use it, otherwise fall back to
390 + // the unsafe sprintf which, in general, can be dangerous and should
392 + template<typename _Tv>
394 + __convert_from_v(char* __out, const int __size, const char* __fmt,
395 +#ifdef __UCLIBC_HAS_XLOCALE__
396 + _Tv __v, const __c_locale& __cloc, int __prec = -1)
398 + __c_locale __old = __gnu_cxx::__uselocale(__cloc);
400 + _Tv __v, const __c_locale&, int __prec = -1)
402 +# ifdef __UCLIBC_HAS_LOCALE__
403 + char* __old = setlocale(LC_ALL, NULL);
404 + char* __sav = static_cast<char*>(malloc(strlen(__old) + 1));
406 + strcpy(__sav, __old);
407 + setlocale(LC_ALL, "C");
413 + __ret = snprintf(__out, __size, __fmt, __prec, __v);
415 + __ret = snprintf(__out, __size, __fmt, __v);
417 +#ifdef __UCLIBC_HAS_XLOCALE__
418 + __gnu_cxx::__uselocale(__old);
419 +#elif defined __UCLIBC_HAS_LOCALE__
420 + setlocale(LC_ALL, __sav);
428 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
429 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600
430 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2004-01-09 04:04:34.000000000 -0600
432 +// std::codecvt implementation details, GNU version -*- C++ -*-
434 +// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
436 +// This file is part of the GNU ISO C++ Library. This library is free
437 +// software; you can redistribute it and/or modify it under the
438 +// terms of the GNU General Public License as published by the
439 +// Free Software Foundation; either version 2, or (at your option)
440 +// any later version.
442 +// This library is distributed in the hope that it will be useful,
443 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
444 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
445 +// GNU General Public License for more details.
447 +// You should have received a copy of the GNU General Public License along
448 +// with this library; see the file COPYING. If not, write to the Free
449 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
452 +// As a special exception, you may use this file as part of a free software
453 +// library without restriction. Specifically, if other files instantiate
454 +// templates or use macros or inline functions from this file, or you compile
455 +// this file and link it with other files to produce an executable, this
456 +// file does not by itself cause the resulting executable to be covered by
457 +// the GNU General Public License. This exception does not however
458 +// invalidate any other reasons why the executable file might be covered by
459 +// the GNU General Public License.
462 +// ISO C++ 14882: 22.2.1.5 - Template class codecvt
465 +// Written by Benjamin Kosnik <bkoz@redhat.com>
468 +#include <bits/c++locale_internal.h>
472 + // Specializations.
473 +#ifdef _GLIBCPP_USE_WCHAR_T
474 + codecvt_base::result
475 + codecvt<wchar_t, char, mbstate_t>::
476 + do_out(state_type& __state, const intern_type* __from,
477 + const intern_type* __from_end, const intern_type*& __from_next,
478 + extern_type* __to, extern_type* __to_end,
479 + extern_type*& __to_next) const
481 + result __ret = error;
482 + size_t __len = min(__from_end - __from, __to_end - __to);
483 +#ifdef __UCLIBC_HAS_XLOCALE__
484 + __c_locale __old = __uselocale(_S_c_locale);
486 + size_t __conv = wcsrtombs(__to, &__from, __len, &__state);
487 +#ifdef __UCLIBC_HAS_XLOCALE__
488 + __uselocale(__old);
491 + if (__conv == __len)
493 + __from_next = __from;
494 + __to_next = __to + __conv;
497 + else if (__conv > 0 && __conv < __len)
499 + __from_next = __from;
500 + __to_next = __to + __conv;
509 + codecvt_base::result
510 + codecvt<wchar_t, char, mbstate_t>::
511 + do_in(state_type& __state, const extern_type* __from,
512 + const extern_type* __from_end, const extern_type*& __from_next,
513 + intern_type* __to, intern_type* __to_end,
514 + intern_type*& __to_next) const
516 + result __ret = error;
517 + size_t __len = min(__from_end - __from, __to_end - __to);
518 +#ifdef __UCLIBC_HAS_XLOCALE__
519 + __c_locale __old = __uselocale(_S_c_locale);
521 + size_t __conv = mbsrtowcs(__to, &__from, __len, &__state);
522 +#ifdef __UCLIBC_HAS_XLOCALE__
523 + __uselocale(__old);
526 + if (__conv == __len)
528 + __from_next = __from;
529 + __to_next = __to + __conv;
532 + else if (__conv > 0 && __conv < __len)
534 + __from_next = __from;
535 + __to_next = __to + __conv;
545 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h
546 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 1969-12-31 18:00:00.000000000 -0600
547 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/codecvt_specializations.h 2004-01-09 01:53:51.000000000 -0600
549 +// Locale support (codecvt) -*- C++ -*-
551 +// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
553 +// This file is part of the GNU ISO C++ Library. This library is free
554 +// software; you can redistribute it and/or modify it under the
555 +// terms of the GNU General Public License as published by the
556 +// Free Software Foundation; either version 2, or (at your option)
557 +// any later version.
559 +// This library is distributed in the hope that it will be useful,
560 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
561 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
562 +// GNU General Public License for more details.
564 +// You should have received a copy of the GNU General Public License along
565 +// with this library; see the file COPYING. If not, write to the Free
566 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
569 +// As a special exception, you may use this file as part of a free software
570 +// library without restriction. Specifically, if other files instantiate
571 +// templates or use macros or inline functions from this file, or you compile
572 +// this file and link it with other files to produce an executable, this
573 +// file does not by itself cause the resulting executable to be covered by
574 +// the GNU General Public License. This exception does not however
575 +// invalidate any other reasons why the executable file might be covered by
576 +// the GNU General Public License.
579 +// ISO C++ 14882: 22.2.1.5 Template class codecvt
582 +// Warning: this file is not meant for user inclusion. Use <locale>.
584 +// Written by Benjamin Kosnik <bkoz@cygnus.com>
587 + // Define this here to codecvt.cc can have _S_max_size definition.
588 +#define _GLIBCPP_USE___ENC_TRAITS 1
590 + // Extension to use icov for dealing with character encodings,
591 + // including conversions and comparisons between various character
592 + // sets. This object encapsulates data that may need to be shared between
593 + // char_traits, codecvt and ctype.
598 + // NB: A conversion descriptor subsumes and enhances the
599 + // functionality of a simple state type such as mbstate_t.
600 + typedef iconv_t __desc_type;
604 + // Max size of charset encoding name
605 + static const int _S_max_size = 32;
606 + // Name of internal character set encoding.
607 + char _M_int_enc[_S_max_size];
608 + // Name of external character set encoding.
609 + char _M_ext_enc[_S_max_size];
611 + // Conversion descriptor between external encoding to internal encoding.
612 + __desc_type _M_in_desc;
613 + // Conversion descriptor between internal encoding to external encoding.
614 + __desc_type _M_out_desc;
616 + // Details the byte-order marker for the external encoding, if necessary.
619 + // Details the byte-order marker for the internal encoding, if necessary.
623 + explicit __enc_traits()
624 + : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
626 + memset(_M_int_enc, 0, _S_max_size);
627 + memset(_M_ext_enc, 0, _S_max_size);
630 + explicit __enc_traits(const char* __int, const char* __ext,
631 + int __ibom = 0, int __ebom = 0)
632 + : _M_in_desc(0), _M_out_desc(0), _M_ext_bom(0), _M_int_bom(0)
634 + strncpy(_M_int_enc, __int, _S_max_size);
635 + strncpy(_M_ext_enc, __ext, _S_max_size);
638 + // 21.1.2 traits typedefs
640 + // typedef STATE_T state_type
641 + // requires: state_type shall meet the requirements of
642 + // CopyConstructible types (20.1.3)
643 + __enc_traits(const __enc_traits& __obj): _M_in_desc(0), _M_out_desc(0)
645 + strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
646 + strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
647 + _M_ext_bom = __obj._M_ext_bom;
648 + _M_int_bom = __obj._M_int_bom;
651 + // Need assignment operator as well.
653 + operator=(const __enc_traits& __obj)
655 + strncpy(_M_int_enc, __obj._M_int_enc, _S_max_size);
656 + strncpy(_M_ext_enc, __obj._M_ext_enc, _S_max_size);
659 + _M_ext_bom = __obj._M_ext_bom;
660 + _M_int_bom = __obj._M_int_bom;
666 + __desc_type __err = reinterpret_cast<iconv_t>(-1);
667 + if (_M_in_desc && _M_in_desc != __err)
668 + iconv_close(_M_in_desc);
669 + if (_M_out_desc && _M_out_desc != __err)
670 + iconv_close(_M_out_desc);
676 + const __desc_type __err = reinterpret_cast<iconv_t>(-1);
679 + _M_in_desc = iconv_open(_M_int_enc, _M_ext_enc);
680 + if (_M_in_desc == __err)
681 + __throw_runtime_error("creating iconv input descriptor failed.");
685 + _M_out_desc = iconv_open(_M_ext_enc, _M_int_enc);
686 + if (_M_out_desc == __err)
687 + __throw_runtime_error("creating iconv output descriptor failed.");
694 + const __desc_type __err = reinterpret_cast<iconv_t>(-1);
695 + bool __test = _M_in_desc && _M_in_desc != __err;
696 + __test &= _M_out_desc && _M_out_desc != __err;
701 + _M_get_in_descriptor()
702 + { return &_M_in_desc; }
705 + _M_get_out_descriptor()
706 + { return &_M_out_desc; }
709 + _M_get_external_bom()
710 + { return _M_ext_bom; }
713 + _M_get_internal_bom()
714 + { return _M_int_bom; }
717 + _M_get_internal_enc()
718 + { return _M_int_enc; }
721 + _M_get_external_enc()
722 + { return _M_ext_enc; }
725 + // Partial specialization
726 + // This specialization takes advantage of iconv to provide code
727 + // conversions between a large number of character encodings.
728 + template<typename _InternT, typename _ExternT>
729 + class codecvt<_InternT, _ExternT, __enc_traits>
730 + : public __codecvt_abstract_base<_InternT, _ExternT, __enc_traits>
734 + typedef codecvt_base::result result;
735 + typedef _InternT intern_type;
736 + typedef _ExternT extern_type;
737 + typedef __enc_traits state_type;
738 + typedef __enc_traits::__desc_type __desc_type;
739 + typedef __enc_traits __enc_type;
742 + static locale::id id;
745 + codecvt(size_t __refs = 0)
746 + : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
750 + codecvt(__enc_type* __enc, size_t __refs = 0)
751 + : __codecvt_abstract_base<intern_type, extern_type, state_type>(__refs)
759 + do_out(state_type& __state, const intern_type* __from,
760 + const intern_type* __from_end, const intern_type*& __from_next,
761 + extern_type* __to, extern_type* __to_end,
762 + extern_type*& __to_next) const;
765 + do_unshift(state_type& __state, extern_type* __to,
766 + extern_type* __to_end, extern_type*& __to_next) const;
769 + do_in(state_type& __state, const extern_type* __from,
770 + const extern_type* __from_end, const extern_type*& __from_next,
771 + intern_type* __to, intern_type* __to_end,
772 + intern_type*& __to_next) const;
775 + do_encoding() const throw();
778 + do_always_noconv() const throw();
781 + do_length(const state_type&, const extern_type* __from,
782 + const extern_type* __end, size_t __max) const;
785 + do_max_length() const throw();
788 + template<typename _InternT, typename _ExternT>
790 + codecvt<_InternT, _ExternT, __enc_traits>::id;
792 + // This adaptor works around the signature problems of the second
793 + // argument to iconv(): SUSv2 and others use 'const char**', but glibc 2.2
794 + // uses 'char**', which matches the POSIX 1003.1-2001 standard.
795 + // Using this adaptor, g++ will do the work for us.
796 + template<typename _T>
798 + __iconv_adaptor(size_t(*__func)(iconv_t, _T, size_t*, char**, size_t*),
799 + iconv_t __cd, char** __inbuf, size_t* __inbytes,
800 + char** __outbuf, size_t* __outbytes)
801 + { return __func(__cd, (_T)__inbuf, __inbytes, __outbuf, __outbytes); }
803 + template<typename _InternT, typename _ExternT>
804 + codecvt_base::result
805 + codecvt<_InternT, _ExternT, __enc_traits>::
806 + do_out(state_type& __state, const intern_type* __from,
807 + const intern_type* __from_end, const intern_type*& __from_next,
808 + extern_type* __to, extern_type* __to_end,
809 + extern_type*& __to_next) const
811 + result __ret = codecvt_base::error;
812 + if (__state._M_good())
814 + typedef state_type::__desc_type __desc_type;
815 + const __desc_type* __desc = __state._M_get_out_descriptor();
816 + const size_t __fmultiple = sizeof(intern_type);
817 + size_t __fbytes = __fmultiple * (__from_end - __from);
818 + const size_t __tmultiple = sizeof(extern_type);
819 + size_t __tbytes = __tmultiple * (__to_end - __to);
821 + // Argument list for iconv specifies a byte sequence. Thus,
822 + // all to/from arrays must be brutally casted to char*.
823 + char* __cto = reinterpret_cast<char*>(__to);
827 + // Some encodings need a byte order marker as the first item
828 + // in the byte stream, to designate endian-ness. The default
829 + // value for the byte order marker is NULL, so if this is
830 + // the case, it's not necessary and we can just go on our
832 + int __int_bom = __state._M_get_internal_bom();
835 + size_t __size = __from_end - __from;
836 + intern_type* __cfixed = static_cast<intern_type*>(__builtin_alloca(sizeof(intern_type) * (__size + 1)));
837 + __cfixed[0] = static_cast<intern_type>(__int_bom);
838 + char_traits<intern_type>::copy(__cfixed + 1, __from, __size);
839 + __cfrom = reinterpret_cast<char*>(__cfixed);
840 + __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
841 + &__fbytes, &__cto, &__tbytes);
845 + intern_type* __cfixed = const_cast<intern_type*>(__from);
846 + __cfrom = reinterpret_cast<char*>(__cfixed);
847 + __conv = __iconv_adaptor(iconv, *__desc, &__cfrom, &__fbytes,
848 + &__cto, &__tbytes);
851 + if (__conv != size_t(-1))
853 + __from_next = reinterpret_cast<const intern_type*>(__cfrom);
854 + __to_next = reinterpret_cast<extern_type*>(__cto);
855 + __ret = codecvt_base::ok;
859 + if (__fbytes < __fmultiple * (__from_end - __from))
861 + __from_next = reinterpret_cast<const intern_type*>(__cfrom);
862 + __to_next = reinterpret_cast<extern_type*>(__cto);
863 + __ret = codecvt_base::partial;
866 + __ret = codecvt_base::error;
872 + template<typename _InternT, typename _ExternT>
873 + codecvt_base::result
874 + codecvt<_InternT, _ExternT, __enc_traits>::
875 + do_unshift(state_type& __state, extern_type* __to,
876 + extern_type* __to_end, extern_type*& __to_next) const
878 + result __ret = codecvt_base::error;
879 + if (__state._M_good())
881 + typedef state_type::__desc_type __desc_type;
882 + const __desc_type* __desc = __state._M_get_in_descriptor();
883 + const size_t __tmultiple = sizeof(intern_type);
884 + size_t __tlen = __tmultiple * (__to_end - __to);
886 + // Argument list for iconv specifies a byte sequence. Thus,
887 + // all to/from arrays must be brutally casted to char*.
888 + char* __cto = reinterpret_cast<char*>(__to);
889 + size_t __conv = __iconv_adaptor(iconv,*__desc, NULL, NULL,
892 + if (__conv != size_t(-1))
894 + __to_next = reinterpret_cast<extern_type*>(__cto);
895 + if (__tlen == __tmultiple * (__to_end - __to))
896 + __ret = codecvt_base::noconv;
897 + else if (__tlen == 0)
898 + __ret = codecvt_base::ok;
900 + __ret = codecvt_base::partial;
903 + __ret = codecvt_base::error;
908 + template<typename _InternT, typename _ExternT>
909 + codecvt_base::result
910 + codecvt<_InternT, _ExternT, __enc_traits>::
911 + do_in(state_type& __state, const extern_type* __from,
912 + const extern_type* __from_end, const extern_type*& __from_next,
913 + intern_type* __to, intern_type* __to_end,
914 + intern_type*& __to_next) const
916 + result __ret = codecvt_base::error;
917 + if (__state._M_good())
919 + typedef state_type::__desc_type __desc_type;
920 + const __desc_type* __desc = __state._M_get_in_descriptor();
921 + const size_t __fmultiple = sizeof(extern_type);
922 + size_t __flen = __fmultiple * (__from_end - __from);
923 + const size_t __tmultiple = sizeof(intern_type);
924 + size_t __tlen = __tmultiple * (__to_end - __to);
926 + // Argument list for iconv specifies a byte sequence. Thus,
927 + // all to/from arrays must be brutally casted to char*.
928 + char* __cto = reinterpret_cast<char*>(__to);
932 + // Some encodings need a byte order marker as the first item
933 + // in the byte stream, to designate endian-ness. The default
934 + // value for the byte order marker is NULL, so if this is
935 + // the case, it's not necessary and we can just go on our
937 + int __ext_bom = __state._M_get_external_bom();
940 + size_t __size = __from_end - __from;
941 + extern_type* __cfixed = static_cast<extern_type*>(__builtin_alloca(sizeof(extern_type) * (__size + 1)));
942 + __cfixed[0] = static_cast<extern_type>(__ext_bom);
943 + char_traits<extern_type>::copy(__cfixed + 1, __from, __size);
944 + __cfrom = reinterpret_cast<char*>(__cfixed);
945 + __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
946 + &__flen, &__cto, &__tlen);
950 + extern_type* __cfixed = const_cast<extern_type*>(__from);
951 + __cfrom = reinterpret_cast<char*>(__cfixed);
952 + __conv = __iconv_adaptor(iconv, *__desc, &__cfrom,
953 + &__flen, &__cto, &__tlen);
957 + if (__conv != size_t(-1))
959 + __from_next = reinterpret_cast<const extern_type*>(__cfrom);
960 + __to_next = reinterpret_cast<intern_type*>(__cto);
961 + __ret = codecvt_base::ok;
965 + if (__flen < static_cast<size_t>(__from_end - __from))
967 + __from_next = reinterpret_cast<const extern_type*>(__cfrom);
968 + __to_next = reinterpret_cast<intern_type*>(__cto);
969 + __ret = codecvt_base::partial;
972 + __ret = codecvt_base::error;
978 + template<typename _InternT, typename _ExternT>
980 + codecvt<_InternT, _ExternT, __enc_traits>::
981 + do_encoding() const throw()
984 + if (sizeof(_ExternT) <= sizeof(_InternT))
985 + __ret = sizeof(_InternT)/sizeof(_ExternT);
989 + template<typename _InternT, typename _ExternT>
991 + codecvt<_InternT, _ExternT, __enc_traits>::
992 + do_always_noconv() const throw()
995 + template<typename _InternT, typename _ExternT>
997 + codecvt<_InternT, _ExternT, __enc_traits>::
998 + do_length(const state_type&, const extern_type* __from,
999 + const extern_type* __end, size_t __max) const
1000 + { return min(__max, static_cast<size_t>(__end - __from)); }
1002 +#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
1003 +// 74. Garbled text for codecvt::do_max_length
1004 + template<typename _InternT, typename _ExternT>
1006 + codecvt<_InternT, _ExternT, __enc_traits>::
1007 + do_max_length() const throw()
1010 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc
1011 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600
1012 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/collate_members.cc 2004-01-09 08:06:24.000000000 -0600
1014 +// std::collate implementation details, GNU version -*- C++ -*-
1016 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1018 +// This file is part of the GNU ISO C++ Library. This library is free
1019 +// software; you can redistribute it and/or modify it under the
1020 +// terms of the GNU General Public License as published by the
1021 +// Free Software Foundation; either version 2, or (at your option)
1022 +// any later version.
1024 +// This library is distributed in the hope that it will be useful,
1025 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1026 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1027 +// GNU General Public License for more details.
1029 +// You should have received a copy of the GNU General Public License along
1030 +// with this library; see the file COPYING. If not, write to the Free
1031 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1034 +// As a special exception, you may use this file as part of a free software
1035 +// library without restriction. Specifically, if other files instantiate
1036 +// templates or use macros or inline functions from this file, or you compile
1037 +// this file and link it with other files to produce an executable, this
1038 +// file does not by itself cause the resulting executable to be covered by
1039 +// the GNU General Public License. This exception does not however
1040 +// invalidate any other reasons why the executable file might be covered by
1041 +// the GNU General Public License.
1044 +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
1047 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1050 +#include <bits/c++locale_internal.h>
1052 +#ifndef __UCLIBC_HAS_XLOCALE__
1053 +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
1054 +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
1055 +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
1056 +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
1061 + // These are basically extensions to char_traits, and perhaps should
1062 + // be put there instead of here.
1065 + collate<char>::_M_compare(const char* __one, const char* __two) const
1067 + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
1068 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
1073 + collate<char>::_M_transform(char* __to, const char* __from,
1075 + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
1077 +#ifdef _GLIBCPP_USE_WCHAR_T
1080 + collate<wchar_t>::_M_compare(const wchar_t* __one,
1081 + const wchar_t* __two) const
1083 + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
1084 + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
1089 + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
1091 + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
1094 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc
1095 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600
1096 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2004-01-09 08:15:41.000000000 -0600
1098 +// std::ctype implementation details, GNU version -*- C++ -*-
1100 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
1102 +// This file is part of the GNU ISO C++ Library. This library is free
1103 +// software; you can redistribute it and/or modify it under the
1104 +// terms of the GNU General Public License as published by the
1105 +// Free Software Foundation; either version 2, or (at your option)
1106 +// any later version.
1108 +// This library is distributed in the hope that it will be useful,
1109 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1110 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1111 +// GNU General Public License for more details.
1113 +// You should have received a copy of the GNU General Public License along
1114 +// with this library; see the file COPYING. If not, write to the Free
1115 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1118 +// As a special exception, you may use this file as part of a free software
1119 +// library without restriction. Specifically, if other files instantiate
1120 +// templates or use macros or inline functions from this file, or you compile
1121 +// this file and link it with other files to produce an executable, this
1122 +// file does not by itself cause the resulting executable to be covered by
1123 +// the GNU General Public License. This exception does not however
1124 +// invalidate any other reasons why the executable file might be covered by
1125 +// the GNU General Public License.
1128 +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
1131 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1136 +#include <bits/c++locale_internal.h>
1138 +#ifndef __UCLIBC_HAS_XLOCALE__
1139 +#define __wctype_l(S, L) wctype((S))
1140 +#define __towupper_l(C, L) towupper((C))
1141 +#define __towlower_l(C, L) towlower((C))
1142 +#define __iswctype_l(C, M, L) iswctype((C), (M))
1147 + // NB: The other ctype<char> specializations are in src/locale.cc and
1148 + // various /config/os/* files.
1150 + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
1151 + : ctype<char>(0, false, __refs)
1153 + _S_destroy_c_locale(_M_c_locale_ctype);
1154 + _S_create_c_locale(_M_c_locale_ctype, __s);
1155 +#ifdef __UCLIBC_HAS_XLOCALE__
1156 + _M_toupper = _M_c_locale_ctype->__ctype_toupper;
1157 + _M_tolower = _M_c_locale_ctype->__ctype_tolower;
1158 + _M_table = _M_c_locale_ctype->__ctype_b;
1162 +#ifdef _GLIBCPP_USE_WCHAR_T
1163 + ctype<wchar_t>::__wmask_type
1164 + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
1166 + __wmask_type __ret;
1170 + __ret = __wctype_l("space", _M_c_locale_ctype);
1173 + __ret = __wctype_l("print", _M_c_locale_ctype);
1176 + __ret = __wctype_l("cntrl", _M_c_locale_ctype);
1179 + __ret = __wctype_l("upper", _M_c_locale_ctype);
1182 + __ret = __wctype_l("lower", _M_c_locale_ctype);
1185 + __ret = __wctype_l("alpha", _M_c_locale_ctype);
1188 + __ret = __wctype_l("digit", _M_c_locale_ctype);
1191 + __ret = __wctype_l("punct", _M_c_locale_ctype);
1194 + __ret = __wctype_l("xdigit", _M_c_locale_ctype);
1197 + __ret = __wctype_l("alnum", _M_c_locale_ctype);
1200 + __ret = __wctype_l("graph", _M_c_locale_ctype);
1209 + ctype<wchar_t>::do_toupper(wchar_t __c) const
1210 + { return __towupper_l(__c, _M_c_locale_ctype); }
1213 + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
1215 + while (__lo < __hi)
1217 + *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
1224 + ctype<wchar_t>::do_tolower(wchar_t __c) const
1225 + { return __towlower_l(__c, _M_c_locale_ctype); }
1228 + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
1230 + while (__lo < __hi)
1232 + *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
1240 + do_is(mask __m, wchar_t __c) const
1242 + // Highest bitmask in ctype_base == 10, but extra in "C"
1243 + // library for blank.
1244 + bool __ret = false;
1245 + const size_t __bitmasksize = 11;
1246 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1248 + const mask __bit = static_cast<mask>(_ISbit(__bitcur));
1250 + __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
1251 + _M_c_locale_ctype);
1258 + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
1260 + for (;__lo < __hi; ++__vec, ++__lo)
1262 + // Highest bitmask in ctype_base == 10, but extra in "C"
1263 + // library for blank.
1264 + const size_t __bitmasksize = 11;
1266 + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
1268 + const mask __bit = static_cast<mask>(_ISbit(__bitcur));
1269 + if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
1270 + _M_c_locale_ctype))
1280 + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
1282 + while (__lo < __hi && !this->do_is(__m, *__lo))
1289 + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
1291 + while (__lo < __hi && this->do_is(__m, *__lo) != 0)
1298 + do_widen(char __c) const
1300 +#ifdef __UCLIBC_HAS_XLOCALE__
1301 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1303 + wchar_t __ret = btowc(__c);
1304 +#ifdef __UCLIBC_HAS_XLOCALE__
1305 + __uselocale(__old);
1312 + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
1314 +#ifdef __UCLIBC_HAS_XLOCALE__
1315 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1317 + mbstate_t __state;
1318 + memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
1319 + mbsrtowcs(__dest, &__lo, __hi - __lo, &__state);
1320 +#ifdef __UCLIBC_HAS_XLOCALE__
1321 + __uselocale(__old);
1328 + do_narrow(wchar_t __wc, char __dfault) const
1330 +#ifdef __UCLIBC_HAS_XLOCALE__
1331 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1333 + int __c = wctob(__wc);
1334 +#ifdef __UCLIBC_HAS_XLOCALE__
1335 + __uselocale(__old);
1337 + return (__c == EOF ? __dfault : static_cast<char>(__c));
1342 + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
1343 + char* __dest) const
1345 +#ifdef __UCLIBC_HAS_XLOCALE__
1346 + __c_locale __old = __uselocale(_M_c_locale_ctype);
1348 + size_t __offset = 0;
1351 + const wchar_t* __start = __lo + __offset;
1352 + size_t __len = __hi - __start;
1354 + mbstate_t __state;
1355 + memset(static_cast<void*>(&__state), 0, sizeof(mbstate_t));
1356 + size_t __con = wcsrtombs(__dest + __offset, &__start, __len, &__state);
1357 + if (__con != __len && __start != 0)
1359 + __offset = __start - __lo;
1360 + __dest[__offset++] = __dfault;
1365 +#ifdef __UCLIBC_HAS_XLOCALE__
1366 + __uselocale(__old);
1370 +#endif // _GLIBCPP_USE_WCHAR_T
1372 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc
1373 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600
1374 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.cc 2004-01-09 08:46:16.000000000 -0600
1376 +// std::messages implementation details, GNU version -*- C++ -*-
1378 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1380 +// This file is part of the GNU ISO C++ Library. This library is free
1381 +// software; you can redistribute it and/or modify it under the
1382 +// terms of the GNU General Public License as published by the
1383 +// Free Software Foundation; either version 2, or (at your option)
1384 +// any later version.
1386 +// This library is distributed in the hope that it will be useful,
1387 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1388 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1389 +// GNU General Public License for more details.
1391 +// You should have received a copy of the GNU General Public License along
1392 +// with this library; see the file COPYING. If not, write to the Free
1393 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1396 +// As a special exception, you may use this file as part of a free software
1397 +// library without restriction. Specifically, if other files instantiate
1398 +// templates or use macros or inline functions from this file, or you compile
1399 +// this file and link it with other files to produce an executable, this
1400 +// file does not by itself cause the resulting executable to be covered by
1401 +// the GNU General Public License. This exception does not however
1402 +// invalidate any other reasons why the executable file might be covered by
1403 +// the GNU General Public License.
1406 +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
1409 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1412 +#include <bits/c++locale_internal.h>
1414 +#ifdef __UCLIBC_MJN3_ONLY__
1415 +#warning fix gettext stuff
1417 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1418 +extern "C" char *__dcgettext(const char *domainname,
1419 + const char *msgid, int category);
1421 +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
1424 +#define gettext(msgid) (msgid)
1429 + // Specializations.
1432 + messages<char>::do_get(catalog, int, int, const string& __dfault) const
1434 +#ifdef __UCLIBC_HAS_XLOCALE__
1435 + __c_locale __old = __uselocale(_M_c_locale_messages);
1436 + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
1437 + __uselocale(__old);
1438 + return string(__msg);
1439 +#elif defined __UCLIBC_HAS_LOCALE__
1440 + char* __old = strdup(setlocale(LC_ALL, NULL));
1441 + setlocale(LC_ALL, _M_name_messages);
1442 + const char* __msg = gettext(__dfault.c_str());
1443 + setlocale(LC_ALL, __old);
1445 + return string(__msg);
1447 + const char* __msg = gettext(__dfault.c_str());
1448 + return string(__msg);
1452 +#ifdef _GLIBCPP_USE_WCHAR_T
1455 + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
1457 +#ifdef __UCLIBC_HAS_XLOCALE__
1458 + __c_locale __old = __uselocale(_M_c_locale_messages);
1459 + char* __msg = gettext(_M_convert_to_char(__dfault));
1460 + __uselocale(__old);
1461 + return _M_convert_from_char(__msg);
1462 +#elif defined __UCLIBC_HAS_LOCALE__
1463 + char* __old = strdup(setlocale(LC_ALL, NULL));
1464 + setlocale(LC_ALL, _M_name_messages);
1465 + char* __msg = gettext(_M_convert_to_char(__dfault));
1466 + setlocale(LC_ALL, __old);
1468 + return _M_convert_from_char(__msg);
1470 + char* __msg = gettext(_M_convert_to_char(__dfault));
1471 + return _M_convert_from_char(__msg);
1476 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h
1477 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600
1478 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/messages_members.h 2004-01-09 08:52:48.000000000 -0600
1480 +// std::messages implementation details, GNU version -*- C++ -*-
1482 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
1484 +// This file is part of the GNU ISO C++ Library. This library is free
1485 +// software; you can redistribute it and/or modify it under the
1486 +// terms of the GNU General Public License as published by the
1487 +// Free Software Foundation; either version 2, or (at your option)
1488 +// any later version.
1490 +// This library is distributed in the hope that it will be useful,
1491 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1492 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1493 +// GNU General Public License for more details.
1495 +// You should have received a copy of the GNU General Public License along
1496 +// with this library; see the file COPYING. If not, write to the Free
1497 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1500 +// As a special exception, you may use this file as part of a free software
1501 +// library without restriction. Specifically, if other files instantiate
1502 +// templates or use macros or inline functions from this file, or you compile
1503 +// this file and link it with other files to produce an executable, this
1504 +// file does not by itself cause the resulting executable to be covered by
1505 +// the GNU General Public License. This exception does not however
1506 +// invalidate any other reasons why the executable file might be covered by
1507 +// the GNU General Public License.
1510 +// ISO C++ 14882: 22.2.7.1.2 messages functions
1513 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1515 +#ifdef __UCLIBC_MJN3_ONLY__
1516 +#warning fix prototypes for *textdomain funcs
1518 +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
1519 +extern "C" char *__textdomain(const char *domainname);
1520 +extern "C" char *__bindtextdomain(const char *domainname,
1521 + const char *dirname);
1523 +#undef __textdomain
1524 +#undef __bindtextdomain
1525 +#define __textdomain(D) ((void)0)
1526 +#define __bindtextdomain(D,P) ((void)0)
1529 + // Non-virtual member functions.
1530 + template<typename _CharT>
1531 + messages<_CharT>::messages(size_t __refs)
1532 + : locale::facet(__refs)
1534 +#ifndef __UCLIBC_HAS_XLOCALE__
1535 + _M_name_messages = _S_c_name;
1537 + _M_c_locale_messages = _S_c_locale;
1540 + template<typename _CharT>
1541 + messages<_CharT>::messages(__c_locale __cloc,
1542 + const char* __s, size_t __refs)
1543 + : locale::facet(__refs)
1545 +#ifndef __UCLIBC_HAS_XLOCALE__
1546 + _M_name_messages = new char[strlen(__s) + 1];
1547 + strcpy(_M_name_messages, __s);
1549 + _M_c_locale_messages = _S_clone_c_locale(__cloc);
1552 + template<typename _CharT>
1553 + typename messages<_CharT>::catalog
1554 + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
1555 + const char* __dir) const
1557 + __bindtextdomain(__s.c_str(), __dir);
1558 + return this->do_open(__s, __loc);
1561 + // Virtual member functions.
1562 + template<typename _CharT>
1563 + messages<_CharT>::~messages()
1565 +#ifndef __UCLIBC_HAS_XLOCALE__
1566 + if (_S_c_name != _M_name_messages)
1567 + delete [] _M_name_messages;
1569 + _S_destroy_c_locale(_M_c_locale_messages);
1572 + template<typename _CharT>
1573 + typename messages<_CharT>::catalog
1574 + messages<_CharT>::do_open(const basic_string<char>& __s,
1575 + const locale&) const
1577 + // No error checking is done, assume the catalog exists and can
1579 + __textdomain(__s.c_str());
1583 + template<typename _CharT>
1585 + messages<_CharT>::do_close(catalog) const
1588 + // messages_byname
1589 + template<typename _CharT>
1590 + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
1591 + : messages<_CharT>(__refs)
1593 +#ifndef __UCLIBC_HAS_XLOCALE__
1594 + if (_S_c_name != _M_name_messages)
1595 + delete [] _M_name_messages;
1596 + _M_name_messages = new char[strlen(__s) + 1];
1597 + strcpy(_M_name_messages, __s);
1599 + _S_destroy_c_locale(_M_c_locale_messages);
1600 + _S_create_c_locale(_M_c_locale_messages, __s);
1602 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc
1603 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600
1604 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2004-01-09 18:20:23.000000000 -0600
1606 +// std::moneypunct implementation details, GNU version -*- C++ -*-
1608 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
1610 +// This file is part of the GNU ISO C++ Library. This library is free
1611 +// software; you can redistribute it and/or modify it under the
1612 +// terms of the GNU General Public License as published by the
1613 +// Free Software Foundation; either version 2, or (at your option)
1614 +// any later version.
1616 +// This library is distributed in the hope that it will be useful,
1617 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
1618 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1619 +// GNU General Public License for more details.
1621 +// You should have received a copy of the GNU General Public License along
1622 +// with this library; see the file COPYING. If not, write to the Free
1623 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
1626 +// As a special exception, you may use this file as part of a free software
1627 +// library without restriction. Specifically, if other files instantiate
1628 +// templates or use macros or inline functions from this file, or you compile
1629 +// this file and link it with other files to produce an executable, this
1630 +// file does not by itself cause the resulting executable to be covered by
1631 +// the GNU General Public License. This exception does not however
1632 +// invalidate any other reasons why the executable file might be covered by
1633 +// the GNU General Public License.
1636 +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
1639 +// Written by Benjamin Kosnik <bkoz@redhat.com>
1644 +#include <bits/c++locale_internal.h>
1646 +#ifdef __UCLIBC_MJN3_ONLY__
1647 +#warning optimize this for uclibc
1648 +#warning tailor for stub locale support
1651 +#ifndef __UCLIBC_HAS_XLOCALE__
1652 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
1657 + // Construct and return valid pattern consisting of some combination of:
1658 + // space none symbol sign value
1659 + money_base::pattern
1660 + money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
1664 + // This insanely complicated routine attempts to construct a valid
1665 + // pattern for use with monyepunct. A couple of invariants:
1667 + // if (__precedes) symbol -> value
1668 + // else value -> symbol
1670 + // if (__space) space
1673 + // none == never first
1674 + // space never first or last
1676 + // Any elegant implementations of this are welcome.
1681 + // 1 The sign precedes the value and symbol.
1684 + // Pattern starts with sign.
1687 + __ret.field[1] = symbol;
1688 + __ret.field[2] = space;
1689 + __ret.field[3] = value;
1693 + __ret.field[1] = value;
1694 + __ret.field[2] = space;
1695 + __ret.field[3] = symbol;
1697 + __ret.field[0] = sign;
1701 + // Pattern starts with sign and ends with none.
1704 + __ret.field[1] = symbol;
1705 + __ret.field[2] = value;
1709 + __ret.field[1] = value;
1710 + __ret.field[2] = symbol;
1712 + __ret.field[0] = sign;
1713 + __ret.field[3] = none;
1717 + // 2 The sign follows the value and symbol.
1720 + // Pattern either ends with sign.
1723 + __ret.field[0] = symbol;
1724 + __ret.field[1] = space;
1725 + __ret.field[2] = value;
1729 + __ret.field[0] = value;
1730 + __ret.field[1] = space;
1731 + __ret.field[2] = symbol;
1733 + __ret.field[3] = sign;
1737 + // Pattern ends with sign then none.
1740 + __ret.field[0] = symbol;
1741 + __ret.field[1] = value;
1745 + __ret.field[0] = value;
1746 + __ret.field[1] = symbol;
1748 + __ret.field[2] = sign;
1749 + __ret.field[3] = none;
1753 + // 3 The sign immediately precedes the symbol.
1759 + __ret.field[0] = sign;
1760 + __ret.field[1] = symbol;
1761 + __ret.field[2] = space;
1762 + __ret.field[3] = value;
1766 + __ret.field[0] = value;
1767 + __ret.field[1] = space;
1768 + __ret.field[2] = sign;
1769 + __ret.field[3] = symbol;
1777 + __ret.field[0] = sign;
1778 + __ret.field[1] = symbol;
1779 + __ret.field[2] = value;
1783 + __ret.field[0] = value;
1784 + __ret.field[1] = sign;
1785 + __ret.field[2] = symbol;
1787 + __ret.field[3] = none;
1791 + // 4 The sign immediately follows the symbol.
1797 + __ret.field[0] = symbol;
1798 + __ret.field[1] = sign;
1799 + __ret.field[2] = space;
1800 + __ret.field[3] = value;
1804 + __ret.field[0] = value;
1805 + __ret.field[1] = space;
1806 + __ret.field[2] = symbol;
1807 + __ret.field[3] = sign;
1815 + __ret.field[0] = symbol;
1816 + __ret.field[1] = sign;
1817 + __ret.field[2] = value;
1821 + __ret.field[0] = value;
1822 + __ret.field[1] = symbol;
1823 + __ret.field[2] = sign;
1825 + __ret.field[3] = none;
1836 + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
1842 + _M_decimal_point = '.';
1843 + _M_thousands_sep = ',';
1845 + _M_curr_symbol = "";
1846 + _M_positive_sign = "";
1847 + _M_negative_sign = "";
1848 + _M_frac_digits = 0;
1849 + _M_pos_format = money_base::_S_default_pattern;
1850 + _M_neg_format = money_base::_S_default_pattern;
1855 + _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
1856 + _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
1857 + _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1858 + _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1860 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
1862 + _M_negative_sign = "()";
1864 + _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1867 + _M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1868 + _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
1869 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
1870 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
1871 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
1872 + _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
1873 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
1874 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
1875 + _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
1881 + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
1887 + _M_decimal_point = '.';
1888 + _M_thousands_sep = ',';
1890 + _M_curr_symbol = "";
1891 + _M_positive_sign = "";
1892 + _M_negative_sign = "";
1893 + _M_frac_digits = 0;
1894 + _M_pos_format = money_base::_S_default_pattern;
1895 + _M_neg_format = money_base::_S_default_pattern;
1900 + _M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, __cloc));
1901 + _M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, __cloc));
1902 + _M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
1903 + _M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1905 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
1907 + _M_negative_sign = "()";
1909 + _M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1912 + _M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
1913 + _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
1914 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
1915 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
1916 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
1917 + _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
1918 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
1919 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
1920 + _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
1925 + moneypunct<char, true>::~moneypunct()
1929 + moneypunct<char, false>::~moneypunct()
1932 +#ifdef _GLIBCPP_USE_WCHAR_T
1935 + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
1936 +#ifdef __UCLIBC_HAS_XLOCALE__
1939 + const char* __name)
1945 + _M_decimal_point = L'.';
1946 + _M_thousands_sep = L',';
1948 + _M_curr_symbol = L"";
1949 + _M_positive_sign = L"";
1950 + _M_negative_sign = L"";
1951 + _M_frac_digits = 0;
1952 + _M_pos_format = money_base::_S_default_pattern;
1953 + _M_neg_format = money_base::_S_default_pattern;
1958 +#ifdef __UCLIBC_HAS_XLOCALE__
1959 + __c_locale __old = __uselocale(__cloc);
1961 + // Switch to named locale so that mbsrtowcs will work.
1962 + char* __old = strdup(setlocale(LC_ALL, NULL));
1963 + setlocale(LC_ALL, __name);
1966 +#ifdef __UCLIBC_MJN3_ONLY__
1970 +# ifdef __UCLIBC_HAS_XLOCALE__
1971 + _M_decimal_point = __cloc->decimal_point_wc;
1972 + _M_thousands_sep = __cloc->thousands_sep_wc;
1974 + _M_decimal_point = __global_locale->decimal_point_wc;
1975 + _M_thousands_sep = __global_locale->thousands_sep_wc;
1978 + _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
1980 + _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
1982 + _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
1984 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
1985 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
1986 + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
1988 + mbstate_t __state;
1989 + size_t __len = strlen(__cpossign);
1993 + memset(&__state, 0, sizeof(mbstate_t));
1994 + wchar_t* __wcs = new wchar_t[__len];
1995 + mbsrtowcs(__wcs, &__cpossign, __len, &__state);
1996 + _M_positive_sign = __wcs;
1999 + _M_positive_sign = L"";
2001 + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
2002 + __len = strlen(__cnegsign);
2004 + _M_negative_sign = L"()";
2008 + memset(&__state, 0, sizeof(mbstate_t));
2009 + wchar_t* __wcs = new wchar_t[__len];
2010 + mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
2011 + _M_negative_sign = __wcs;
2014 + _M_negative_sign = L"";
2017 + __len = strlen(__ccurr);
2021 + memset(&__state, 0, sizeof(mbstate_t));
2022 + wchar_t* __wcs = new wchar_t[__len];
2023 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2024 + _M_curr_symbol = __wcs;
2027 + _M_curr_symbol = L"";
2029 + _M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, __cloc));
2030 + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
2031 + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
2032 + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
2033 + _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
2034 + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
2035 + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
2036 + _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
2038 +#ifdef __UCLIBC_HAS_XLOCALE__
2039 + __uselocale(__old);
2041 + setlocale(LC_ALL, __old);
2049 + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
2050 +#ifdef __UCLIBC_HAS_XLOCALE__
2053 + const char* __name)
2059 + _M_decimal_point = L'.';
2060 + _M_thousands_sep = L',';
2062 + _M_curr_symbol = L"";
2063 + _M_positive_sign = L"";
2064 + _M_negative_sign = L"";
2065 + _M_frac_digits = 0;
2066 + _M_pos_format = money_base::_S_default_pattern;
2067 + _M_neg_format = money_base::_S_default_pattern;
2072 +#ifdef __UCLIBC_HAS_XLOCALE__
2073 + __c_locale __old = __uselocale(__cloc);
2075 + // Switch to named locale so that mbsrtowcs will work.
2076 + char* __old = strdup(setlocale(LC_ALL, NULL));
2077 + setlocale(LC_ALL, __name);
2080 +#ifdef __UCLIBC_MJN3_ONLY__
2084 +# ifdef __UCLIBC_HAS_XLOCALE__
2085 + _M_decimal_point = __cloc->decimal_point_wc;
2086 + _M_thousands_sep = __cloc->thousands_sep_wc;
2088 + _M_decimal_point = __global_locale->decimal_point_wc;
2089 + _M_thousands_sep = __global_locale->thousands_sep_wc;
2092 + _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
2093 + _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
2095 + _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2097 + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
2098 + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
2099 + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
2101 + mbstate_t __state;
2103 + __len = strlen(__cpossign);
2107 + memset(&__state, 0, sizeof(mbstate_t));
2108 + wchar_t* __wcs = new wchar_t[__len];
2109 + mbsrtowcs(__wcs, &__cpossign, __len, &__state);
2110 + _M_positive_sign = __wcs;
2113 + _M_positive_sign = L"";
2115 + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
2116 + __len = strlen(__cnegsign);
2118 + _M_negative_sign = L"()";
2122 + memset(&__state, 0, sizeof(mbstate_t));
2123 + wchar_t* __wcs = new wchar_t[__len];
2124 + mbsrtowcs(__wcs, &__cnegsign, __len, &__state);
2125 + _M_negative_sign = __wcs;
2128 + _M_negative_sign = L"";
2131 + __len = strlen(__ccurr);
2135 + memset(&__state, 0, sizeof(mbstate_t));
2136 + wchar_t* __wcs = new wchar_t[__len];
2137 + mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2138 + _M_curr_symbol = __wcs;
2141 + _M_curr_symbol = L"";
2143 + _M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2144 + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2145 + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2146 + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2147 + _M_pos_format = _S_construct_pattern(__pprecedes, __pspace, __pposn);
2148 + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2149 + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2150 + _M_neg_format = _S_construct_pattern(__nprecedes, __nspace, __nposn);
2152 +#ifdef __UCLIBC_HAS_XLOCALE__
2153 + __uselocale(__old);
2155 + setlocale(LC_ALL, __old);
2162 + moneypunct<wchar_t, true>::~moneypunct()
2164 + if (wcslen(_M_positive_sign))
2165 + delete [] _M_positive_sign;
2166 + if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
2167 + delete [] _M_negative_sign;
2168 + if (wcslen(_M_curr_symbol))
2169 + delete [] _M_curr_symbol;
2173 + moneypunct<wchar_t, false>::~moneypunct()
2175 + if (wcslen(_M_positive_sign))
2176 + delete [] _M_positive_sign;
2177 + if (wcslen(_M_negative_sign) && (wcscmp(_M_negative_sign, L"()") != 0))
2178 + delete [] _M_negative_sign;
2179 + if (wcslen(_M_curr_symbol))
2180 + delete [] _M_curr_symbol;
2184 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2185 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600
2186 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2004-01-09 18:20:59.000000000 -0600
2188 +// std::numpunct implementation details, GNU version -*- C++ -*-
2190 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2192 +// This file is part of the GNU ISO C++ Library. This library is free
2193 +// software; you can redistribute it and/or modify it under the
2194 +// terms of the GNU General Public License as published by the
2195 +// Free Software Foundation; either version 2, or (at your option)
2196 +// any later version.
2198 +// This library is distributed in the hope that it will be useful,
2199 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2200 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2201 +// GNU General Public License for more details.
2203 +// You should have received a copy of the GNU General Public License along
2204 +// with this library; see the file COPYING. If not, write to the Free
2205 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2208 +// As a special exception, you may use this file as part of a free software
2209 +// library without restriction. Specifically, if other files instantiate
2210 +// templates or use macros or inline functions from this file, or you compile
2211 +// this file and link it with other files to produce an executable, this
2212 +// file does not by itself cause the resulting executable to be covered by
2213 +// the GNU General Public License. This exception does not however
2214 +// invalidate any other reasons why the executable file might be covered by
2215 +// the GNU General Public License.
2218 +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2221 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2226 +#include <bits/c++locale_internal.h>
2228 +#ifdef __UCLIBC_MJN3_ONLY__
2229 +#warning tailor for stub locale support
2231 +#ifndef __UCLIBC_HAS_XLOCALE__
2232 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2239 + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2244 + _M_decimal_point = '.';
2245 + _M_thousands_sep = ',';
2251 + _M_decimal_point = *(__nl_langinfo_l(RADIXCHAR, __cloc));
2252 + _M_thousands_sep = *(__nl_langinfo_l(THOUSEP, __cloc));
2253 + // Check for NUL, which implies no grouping.
2254 + if (_M_thousands_sep == '\0')
2257 + _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2259 + // NB: There is no way to extact this info from posix locales.
2260 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2261 + _M_truename = "true";
2262 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2263 + _M_falsename = "false";
2267 + numpunct<char>::~numpunct()
2270 +#ifdef _GLIBCPP_USE_WCHAR_T
2273 + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2278 + _M_decimal_point = L'.';
2279 + _M_thousands_sep = L',';
2285 +#ifdef __UCLIBC_MJN3_ONLY__
2289 +# ifdef __UCLIBC_HAS_XLOCALE__
2290 + _M_decimal_point = __cloc->decimal_point_wc;
2291 + _M_thousands_sep = __cloc->thousands_sep_wc;
2293 + _M_decimal_point = __global_locale->decimal_point_wc;
2294 + _M_thousands_sep = __global_locale->thousands_sep_wc;
2297 + _M_decimal_point = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc)}).__w);
2298 + _M_thousands_sep = static_cast<wchar_t>(((union { const char *__s; unsigned int __w; }){ __s: __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc)}).__w);
2300 + if (_M_thousands_sep == L'\0')
2303 + _M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2305 + // NB: There is no way to extact this info from posix locales.
2306 + // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2307 + _M_truename = L"true";
2308 + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2309 + _M_falsename = L"false";
2313 + numpunct<wchar_t>::~numpunct()
2317 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc
2318 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600
2319 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.cc 2004-01-09 08:25:03.000000000 -0600
2321 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2323 +// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2325 +// This file is part of the GNU ISO C++ Library. This library is free
2326 +// software; you can redistribute it and/or modify it under the
2327 +// terms of the GNU General Public License as published by the
2328 +// Free Software Foundation; either version 2, or (at your option)
2329 +// any later version.
2331 +// This library is distributed in the hope that it will be useful,
2332 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2333 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2334 +// GNU General Public License for more details.
2336 +// You should have received a copy of the GNU General Public License along
2337 +// with this library; see the file COPYING. If not, write to the Free
2338 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2341 +// As a special exception, you may use this file as part of a free software
2342 +// library without restriction. Specifically, if other files instantiate
2343 +// templates or use macros or inline functions from this file, or you compile
2344 +// this file and link it with other files to produce an executable, this
2345 +// file does not by itself cause the resulting executable to be covered by
2346 +// the GNU General Public License. This exception does not however
2347 +// invalidate any other reasons why the executable file might be covered by
2348 +// the GNU General Public License.
2351 +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2352 +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2355 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2358 +#include <bits/c++locale_internal.h>
2360 +#ifdef __UCLIBC_MJN3_ONLY__
2361 +#warning tailor for stub locale support
2363 +#ifndef __UCLIBC_HAS_XLOCALE__
2364 +#define __nl_langinfo_l(N, L) nl_langinfo((N))
2371 + __timepunct<char>::
2372 + _M_put(char* __s, size_t __maxlen, const char* __format,
2373 + const tm* __tm) const
2375 +#ifdef __UCLIBC_HAS_XLOCALE__
2376 + __strftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2378 + char* __old = strdup(setlocale(LC_ALL, NULL));
2379 + setlocale(LC_ALL, _M_name_timepunct);
2380 + strftime(__s, __maxlen, __format, __tm);
2381 + setlocale(LC_ALL, __old);
2388 + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2393 + _M_c_locale_timepunct = _S_c_locale;
2395 + _M_date_format = "%m/%d/%y";
2396 + _M_date_era_format = "%m/%d/%y";
2397 + _M_time_format = "%H:%M:%S";
2398 + _M_time_era_format = "%H:%M:%S";
2399 + _M_date_time_format = "";
2400 + _M_date_time_era_format = "";
2403 + _M_am_pm_format = "";
2405 + // Day names, starting with "C"'s Sunday.
2406 + _M_day1 = "Sunday";
2407 + _M_day2 = "Monday";
2408 + _M_day3 = "Tuesday";
2409 + _M_day4 = "Wednesday";
2410 + _M_day5 = "Thursday";
2411 + _M_day6 = "Friday";
2412 + _M_day7 = "Saturday";
2414 + // Abbreviated day names, starting with "C"'s Sun.
2415 + _M_day_a1 = "Sun";
2416 + _M_day_a2 = "Mon";
2417 + _M_day_a3 = "Tue";
2418 + _M_day_a4 = "Wed";
2419 + _M_day_a5 = "Thu";
2420 + _M_day_a6 = "Fri";
2421 + _M_day_a7 = "Sat";
2423 + // Month names, starting with "C"'s January.
2424 + _M_month01 = "January";
2425 + _M_month02 = "February";
2426 + _M_month03 = "March";
2427 + _M_month04 = "April";
2428 + _M_month05 = "May";
2429 + _M_month06 = "June";
2430 + _M_month07 = "July";
2431 + _M_month08 = "August";
2432 + _M_month09 = "September";
2433 + _M_month10 = "October";
2434 + _M_month11 = "November";
2435 + _M_month12 = "December";
2437 + // Abbreviated month names, starting with "C"'s Jan.
2438 + _M_month_a01 = "Jan";
2439 + _M_month_a02 = "Feb";
2440 + _M_month_a03 = "Mar";
2441 + _M_month_a04 = "Apr";
2442 + _M_month_a05 = "May";
2443 + _M_month_a06 = "Jun";
2444 + _M_month_a07 = "July";
2445 + _M_month_a08 = "Aug";
2446 + _M_month_a09 = "Sep";
2447 + _M_month_a10 = "Oct";
2448 + _M_month_a11 = "Nov";
2449 + _M_month_a12 = "Dec";
2453 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2455 + _M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2456 + _M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2457 + _M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2458 + _M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2459 + _M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2460 + _M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, __cloc);
2461 + _M_am = __nl_langinfo_l(AM_STR, __cloc);
2462 + _M_pm = __nl_langinfo_l(PM_STR, __cloc);
2463 + _M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2465 + // Day names, starting with "C"'s Sunday.
2466 + _M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2467 + _M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2468 + _M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2469 + _M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2470 + _M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2471 + _M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2472 + _M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2474 + // Abbreviated day names, starting with "C"'s Sun.
2475 + _M_day_a1 = __nl_langinfo_l(ABDAY_1, __cloc);
2476 + _M_day_a2 = __nl_langinfo_l(ABDAY_2, __cloc);
2477 + _M_day_a3 = __nl_langinfo_l(ABDAY_3, __cloc);
2478 + _M_day_a4 = __nl_langinfo_l(ABDAY_4, __cloc);
2479 + _M_day_a5 = __nl_langinfo_l(ABDAY_5, __cloc);
2480 + _M_day_a6 = __nl_langinfo_l(ABDAY_6, __cloc);
2481 + _M_day_a7 = __nl_langinfo_l(ABDAY_7, __cloc);
2483 + // Month names, starting with "C"'s January.
2484 + _M_month01 = __nl_langinfo_l(MON_1, __cloc);
2485 + _M_month02 = __nl_langinfo_l(MON_2, __cloc);
2486 + _M_month03 = __nl_langinfo_l(MON_3, __cloc);
2487 + _M_month04 = __nl_langinfo_l(MON_4, __cloc);
2488 + _M_month05 = __nl_langinfo_l(MON_5, __cloc);
2489 + _M_month06 = __nl_langinfo_l(MON_6, __cloc);
2490 + _M_month07 = __nl_langinfo_l(MON_7, __cloc);
2491 + _M_month08 = __nl_langinfo_l(MON_8, __cloc);
2492 + _M_month09 = __nl_langinfo_l(MON_9, __cloc);
2493 + _M_month10 = __nl_langinfo_l(MON_10, __cloc);
2494 + _M_month11 = __nl_langinfo_l(MON_11, __cloc);
2495 + _M_month12 = __nl_langinfo_l(MON_12, __cloc);
2497 + // Abbreviated month names, starting with "C"'s Jan.
2498 + _M_month_a01 = __nl_langinfo_l(ABMON_1, __cloc);
2499 + _M_month_a02 = __nl_langinfo_l(ABMON_2, __cloc);
2500 + _M_month_a03 = __nl_langinfo_l(ABMON_3, __cloc);
2501 + _M_month_a04 = __nl_langinfo_l(ABMON_4, __cloc);
2502 + _M_month_a05 = __nl_langinfo_l(ABMON_5, __cloc);
2503 + _M_month_a06 = __nl_langinfo_l(ABMON_6, __cloc);
2504 + _M_month_a07 = __nl_langinfo_l(ABMON_7, __cloc);
2505 + _M_month_a08 = __nl_langinfo_l(ABMON_8, __cloc);
2506 + _M_month_a09 = __nl_langinfo_l(ABMON_9, __cloc);
2507 + _M_month_a10 = __nl_langinfo_l(ABMON_10, __cloc);
2508 + _M_month_a11 = __nl_langinfo_l(ABMON_11, __cloc);
2509 + _M_month_a12 = __nl_langinfo_l(ABMON_12, __cloc);
2513 +#ifdef _GLIBCPP_USE_WCHAR_T
2516 + __timepunct<wchar_t>::
2517 + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2518 + const tm* __tm) const
2520 +#ifdef __UCLIBC_HAS_XLOCALE__
2521 + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2523 + char* __old = strdup(setlocale(LC_ALL, NULL));
2524 + setlocale(LC_ALL, _M_name_timepunct);
2525 + wcsftime(__s, __maxlen, __format, __tm);
2526 + setlocale(LC_ALL, __old);
2533 + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2535 +#warning wide time stuff
2539 + _M_c_locale_timepunct = _S_c_locale;
2541 + _M_date_format = L"%m/%d/%y";
2542 + _M_date_era_format = L"%m/%d/%y";
2543 + _M_time_format = L"%H:%M:%S";
2544 + _M_time_era_format = L"%H:%M:%S";
2545 + _M_date_time_format = L"";
2546 + _M_date_time_era_format = L"";
2549 + _M_am_pm_format = L"";
2551 + // Day names, starting with "C"'s Sunday.
2552 + _M_day1 = L"Sunday";
2553 + _M_day2 = L"Monday";
2554 + _M_day3 = L"Tuesday";
2555 + _M_day4 = L"Wednesday";
2556 + _M_day5 = L"Thursday";
2557 + _M_day6 = L"Friday";
2558 + _M_day7 = L"Saturday";
2560 + // Abbreviated day names, starting with "C"'s Sun.
2561 + _M_day_a1 = L"Sun";
2562 + _M_day_a2 = L"Mon";
2563 + _M_day_a3 = L"Tue";
2564 + _M_day_a4 = L"Wed";
2565 + _M_day_a5 = L"Thu";
2566 + _M_day_a6 = L"Fri";
2567 + _M_day_a7 = L"Sat";
2569 + // Month names, starting with "C"'s January.
2570 + _M_month01 = L"January";
2571 + _M_month02 = L"February";
2572 + _M_month03 = L"March";
2573 + _M_month04 = L"April";
2574 + _M_month05 = L"May";
2575 + _M_month06 = L"June";
2576 + _M_month07 = L"July";
2577 + _M_month08 = L"August";
2578 + _M_month09 = L"September";
2579 + _M_month10 = L"October";
2580 + _M_month11 = L"November";
2581 + _M_month12 = L"December";
2583 + // Abbreviated month names, starting with "C"'s Jan.
2584 + _M_month_a01 = L"Jan";
2585 + _M_month_a02 = L"Feb";
2586 + _M_month_a03 = L"Mar";
2587 + _M_month_a04 = L"Apr";
2588 + _M_month_a05 = L"May";
2589 + _M_month_a06 = L"Jun";
2590 + _M_month_a07 = L"July";
2591 + _M_month_a08 = L"Aug";
2592 + _M_month_a09 = L"Sep";
2593 + _M_month_a10 = L"Oct";
2594 + _M_month_a11 = L"Nov";
2595 + _M_month_a12 = L"Dec";
2600 + _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2602 + _M_date_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_FMT, __cloc));
2603 + _M_date_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_FMT, __cloc));
2604 + _M_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT, __cloc));
2605 + _M_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_T_FMT, __cloc));
2606 + _M_date_time_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WD_T_FMT, __cloc));
2607 + _M_date_time_era_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc));
2608 + _M_am = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WAM_STR, __cloc));
2609 + _M_pm = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WPM_STR, __cloc));
2610 + _M_am_pm_format = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc));
2612 + // Day names, starting with "C"'s Sunday.
2613 + _M_day1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_1, __cloc));
2614 + _M_day2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_2, __cloc));
2615 + _M_day3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_3, __cloc));
2616 + _M_day4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_4, __cloc));
2617 + _M_day5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_5, __cloc));
2618 + _M_day6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_6, __cloc));
2619 + _M_day7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WDAY_7, __cloc));
2621 + // Abbreviated day names, starting with "C"'s Sun.
2622 + _M_day_a1 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_1, __cloc));
2623 + _M_day_a2 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_2, __cloc));
2624 + _M_day_a3 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_3, __cloc));
2625 + _M_day_a4 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_4, __cloc));
2626 + _M_day_a5 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_5, __cloc));
2627 + _M_day_a6 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_6, __cloc));
2628 + _M_day_a7 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABDAY_7, __cloc));
2630 + // Month names, starting with "C"'s January.
2631 + _M_month01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_1, __cloc));
2632 + _M_month02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_2, __cloc));
2633 + _M_month03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_3, __cloc));
2634 + _M_month04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_4, __cloc));
2635 + _M_month05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_5, __cloc));
2636 + _M_month06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_6, __cloc));
2637 + _M_month07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_7, __cloc));
2638 + _M_month08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_8, __cloc));
2639 + _M_month09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_9, __cloc));
2640 + _M_month10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_10, __cloc));
2641 + _M_month11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_11, __cloc));
2642 + _M_month12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WMON_12, __cloc));
2644 + // Abbreviated month names, starting with "C"'s Jan.
2645 + _M_month_a01 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_1, __cloc));
2646 + _M_month_a02 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_2, __cloc));
2647 + _M_month_a03 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_3, __cloc));
2648 + _M_month_a04 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_4, __cloc));
2649 + _M_month_a05 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_5, __cloc));
2650 + _M_month_a06 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_6, __cloc));
2651 + _M_month_a07 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_7, __cloc));
2652 + _M_month_a08 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_8, __cloc));
2653 + _M_month_a09 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_9, __cloc));
2654 + _M_month_a10 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_10, __cloc));
2655 + _M_month_a11 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_11, __cloc));
2656 + _M_month_a12 = reinterpret_cast<wchar_t*>(__nl_langinfo_l(_NL_WABMON_12, __cloc));
2662 diff -urN gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h
2663 --- gcc-3.3.2/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600
2664 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/locale/uclibc/time_members.h 2004-01-09 04:26:21.000000000 -0600
2666 +// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2668 +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2670 +// This file is part of the GNU ISO C++ Library. This library is free
2671 +// software; you can redistribute it and/or modify it under the
2672 +// terms of the GNU General Public License as published by the
2673 +// Free Software Foundation; either version 2, or (at your option)
2674 +// any later version.
2676 +// This library is distributed in the hope that it will be useful,
2677 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2678 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2679 +// GNU General Public License for more details.
2681 +// You should have received a copy of the GNU General Public License along
2682 +// with this library; see the file COPYING. If not, write to the Free
2683 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2686 +// As a special exception, you may use this file as part of a free software
2687 +// library without restriction. Specifically, if other files instantiate
2688 +// templates or use macros or inline functions from this file, or you compile
2689 +// this file and link it with other files to produce an executable, this
2690 +// file does not by itself cause the resulting executable to be covered by
2691 +// the GNU General Public License. This exception does not however
2692 +// invalidate any other reasons why the executable file might be covered by
2693 +// the GNU General Public License.
2696 +// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2697 +// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2700 +// Written by Benjamin Kosnik <bkoz@redhat.com>
2702 + template<typename _CharT>
2703 + __timepunct<_CharT>::__timepunct(size_t __refs)
2704 + : locale::facet(__refs)
2706 +#ifndef __UCLIBC_HAS_XLOCALE__
2707 + _M_name_timepunct = _S_c_name;
2709 + _M_initialize_timepunct();
2712 + template<typename _CharT>
2713 + __timepunct<_CharT>::__timepunct(__c_locale __cloc,
2716 + : locale::facet(__refs)
2718 +#ifndef __UCLIBC_HAS_XLOCALE__
2719 + _M_name_timepunct = new char[strlen(__s) + 1];
2720 + strcpy(_M_name_timepunct, __s);
2722 + _M_initialize_timepunct(__cloc);
2725 + template<typename _CharT>
2726 + __timepunct<_CharT>::~__timepunct()
2728 +#ifndef __UCLIBC_HAS_XLOCALE__
2729 + if (_S_c_name != _M_name_timepunct)
2730 + delete [] _M_name_timepunct;
2732 + _S_destroy_c_locale(_M_c_locale_timepunct);
2734 diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h
2735 --- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600
2736 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_base.h 2004-01-09 02:54:54.000000000 -0600
2738 +// Locale support -*- C++ -*-
2740 +// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
2742 +// This file is part of the GNU ISO C++ Library. This library is free
2743 +// software; you can redistribute it and/or modify it under the
2744 +// terms of the GNU General Public License as published by the
2745 +// Free Software Foundation; either version 2, or (at your option)
2746 +// any later version.
2748 +// This library is distributed in the hope that it will be useful,
2749 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2750 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2751 +// GNU General Public License for more details.
2753 +// You should have received a copy of the GNU General Public License along
2754 +// with this library; see the file COPYING. If not, write to the Free
2755 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2758 +// As a special exception, you may use this file as part of a free software
2759 +// library without restriction. Specifically, if other files instantiate
2760 +// templates or use macros or inline functions from this file, or you compile
2761 +// this file and link it with other files to produce an executable, this
2762 +// file does not by itself cause the resulting executable to be covered by
2763 +// the GNU General Public License. This exception does not however
2764 +// invalidate any other reasons why the executable file might be covered by
2765 +// the GNU General Public License.
2768 +// ISO C++ 14882: 22.1 Locales
2771 +// Information as gleaned from /usr/include/ctype.h
2775 + // Note: In uClibc, the following two types depend on configuration.
2777 + // Non-standard typedefs.
2778 + typedef const __ctype_touplow_t* __to_type;
2779 + // NB: Offsets into ctype<char>::_M_table force a particular size
2780 + // on the mask type. Because of this, we don't use an enum.
2781 + typedef __ctype_mask_t mask;
2783 + static const mask upper = _ISupper;
2784 + static const mask lower = _ISlower;
2785 + static const mask alpha = _ISalpha;
2786 + static const mask digit = _ISdigit;
2787 + static const mask xdigit = _ISxdigit;
2788 + static const mask space = _ISspace;
2789 + static const mask print = _ISprint;
2790 + static const mask graph = _ISgraph;
2791 + static const mask cntrl = _IScntrl;
2792 + static const mask punct = _ISpunct;
2793 + static const mask alnum = _ISalnum;
2795 diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h
2796 --- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600
2797 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_inline.h 2002-06-24 00:49:19.000000000 -0500
2799 +// Locale support -*- C++ -*-
2801 +// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
2803 +// This file is part of the GNU ISO C++ Library. This library is free
2804 +// software; you can redistribute it and/or modify it under the
2805 +// terms of the GNU General Public License as published by the
2806 +// Free Software Foundation; either version 2, or (at your option)
2807 +// any later version.
2809 +// This library is distributed in the hope that it will be useful,
2810 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2811 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2812 +// GNU General Public License for more details.
2814 +// You should have received a copy of the GNU General Public License along
2815 +// with this library; see the file COPYING. If not, write to the Free
2816 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2819 +// As a special exception, you may use this file as part of a free software
2820 +// library without restriction. Specifically, if other files instantiate
2821 +// templates or use macros or inline functions from this file, or you compile
2822 +// this file and link it with other files to produce an executable, this
2823 +// file does not by itself cause the resulting executable to be covered by
2824 +// the GNU General Public License. This exception does not however
2825 +// invalidate any other reasons why the executable file might be covered by
2826 +// the GNU General Public License.
2829 +// ISO C++ 14882: 22.1 Locales
2832 +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*)
2833 +// functions go in ctype.cc
2837 + is(mask __m, char __c) const
2838 + { return _M_table[static_cast<unsigned char>(__c)] & __m; }
2842 + is(const char* __low, const char* __high, mask* __vec) const
2844 + while (__low < __high)
2845 + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)];
2851 + scan_is(mask __m, const char* __low, const char* __high) const
2853 + while (__low < __high
2854 + && !(_M_table[static_cast<unsigned char>(*__low)] & __m))
2861 + scan_not(mask __m, const char* __low, const char* __high) const
2863 + while (__low < __high
2864 + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0)
2868 diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h
2869 --- gcc-3.3.2/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600
2870 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2004-01-09 03:34:53.000000000 -0600
2872 +// Locale support -*- C++ -*-
2874 +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
2875 +// Free Software Foundation, Inc.
2877 +// This file is part of the GNU ISO C++ Library. This library is free
2878 +// software; you can redistribute it and/or modify it under the
2879 +// terms of the GNU General Public License as published by the
2880 +// Free Software Foundation; either version 2, or (at your option)
2881 +// any later version.
2883 +// This library is distributed in the hope that it will be useful,
2884 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2885 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2886 +// GNU General Public License for more details.
2888 +// You should have received a copy of the GNU General Public License along
2889 +// with this library; see the file COPYING. If not, write to the Free
2890 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2893 +// As a special exception, you may use this file as part of a free software
2894 +// library without restriction. Specifically, if other files instantiate
2895 +// templates or use macros or inline functions from this file, or you compile
2896 +// this file and link it with other files to produce an executable, this
2897 +// file does not by itself cause the resulting executable to be covered by
2898 +// the GNU General Public License. This exception does not however
2899 +// invalidate any other reasons why the executable file might be covered by
2900 +// the GNU General Public License.
2903 +// ISO C++ 14882: 22.1 Locales
2906 +// Information as gleaned from /usr/include/ctype.h
2908 + const ctype_base::mask*
2909 + ctype<char>::classic_table() throw()
2911 + return __C_ctype_b;
2914 + ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
2916 + : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
2918 + _M_toupper = __C_ctype_toupper;
2919 + _M_tolower = __C_ctype_tolower;
2920 + _M_table = __table ? __table : __C_ctype_b;
2921 + _M_c_locale_ctype = _S_c_locale;
2924 + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
2925 + __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
2927 + _M_toupper = __C_ctype_toupper;
2928 + _M_tolower = __C_ctype_tolower;
2929 + _M_table = __table ? __table : __C_ctype_b;
2930 + _M_c_locale_ctype = _S_c_locale;
2934 + ctype<char>::do_toupper(char __c) const
2935 + { return _M_toupper[static_cast<unsigned char>(__c)]; }
2938 + ctype<char>::do_toupper(char* __low, const char* __high) const
2940 + while (__low < __high)
2942 + *__low = _M_toupper[static_cast<unsigned char>(*__low)];
2949 + ctype<char>::do_tolower(char __c) const
2950 + { return _M_tolower[static_cast<unsigned char>(__c)]; }
2953 + ctype<char>::do_tolower(char* __low, const char* __high) const
2955 + while (__low < __high)
2957 + *__low = _M_tolower[static_cast<unsigned char>(*__low)];
2962 diff -urN gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h
2963 --- gcc-3.3.2/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600
2964 +++ gcc-3.3.2-uClibc/libstdc++-v3/config/os/uclibc/os_defines.h 2004-01-09 04:56:13.000000000 -0600
2966 +// Specific definitions for GNU/Linux -*- C++ -*-
2968 +// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
2970 +// This file is part of the GNU ISO C++ Library. This library is free
2971 +// software; you can redistribute it and/or modify it under the
2972 +// terms of the GNU General Public License as published by the
2973 +// Free Software Foundation; either version 2, or (at your option)
2974 +// any later version.
2976 +// This library is distributed in the hope that it will be useful,
2977 +// but WITHOUT ANY WARRANTY; without even the implied warranty of
2978 +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2979 +// GNU General Public License for more details.
2981 +// You should have received a copy of the GNU General Public License along
2982 +// with this library; see the file COPYING. If not, write to the Free
2983 +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2986 +// As a special exception, you may use this file as part of a free software
2987 +// library without restriction. Specifically, if other files instantiate
2988 +// templates or use macros or inline functions from this file, or you compile
2989 +// this file and link it with other files to produce an executable, this
2990 +// file does not by itself cause the resulting executable to be covered by
2991 +// the GNU General Public License. This exception does not however
2992 +// invalidate any other reasons why the executable file might be covered by
2993 +// the GNU General Public License.
2995 +#ifndef _GLIBCPP_OS_DEFINES
2996 +#define _GLIBCPP_OS_DEFINES 1
2998 +// System-specific #define, typedefs, corrections, etc, go here. This
2999 +// file will come before all others.
3001 +// This keeps isanum, et al from being propagated as macros.
3002 +#define __NO_CTYPE 1
3004 +#include <features.h>
3006 +// These systems have declarations mismatching those in libio.h by
3007 +// omitting throw qualifiers. Cleanest way out is to not provide
3008 +// throw-qualifiers at all. Defining it as empty here will make libio.h
3013 +// Tell Glibc not to try to provide its own inline versions of
3014 +// some math functions. Those cause assembly-time clashes with
3015 +// our definitions.
3016 +#define __NO_MATH_INLINES
3018 +// We must not see the optimized string functions GNU libc defines.
3019 +#define __NO_STRING_INLINES