Make gcc-4.3.x able to compile uClibc (snapshot only).
Update the gcc patchset accordingly.
/trunk/scripts/build/cc_gcc.sh | 55 53 2 0 ++++++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 53 insertions(+), 2 deletions(-)
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/4.3.0/320-missing-execinfo_h.patch Mon Aug 04 12:38:06 2008 +0000
1.3 @@ -0,0 +1,13 @@
1.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
1.5 +diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
1.6 +--- gcc-4.3.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
1.7 ++++ gcc-4.3.0/boehm-gc/include/gc.h 2008-06-10 14:45:50.000000000 +0200
1.8 +@@ -503,7 +503,7 @@
1.9 + #if defined(__linux__) || defined(__GLIBC__)
1.10 + # include <features.h>
1.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
1.12 +- && !defined(__ia64__)
1.13 ++ && !defined(__ia64__) && !defined(__UCLIBC__)
1.14 + # ifndef GC_HAVE_BUILTIN_BACKTRACE
1.15 + # define GC_HAVE_BUILTIN_BACKTRACE
1.16 + # endif
2.1 --- a/patches/gcc/4.3.0/320-uclibc-locale.patch Mon Aug 04 12:09:54 2008 +0000
2.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
2.3 @@ -1,2794 +0,0 @@
2.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_200-uclibc-locale.patch
2.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 gcc-4.3.0/libstdc++-v3/acinclude.m4
2.6 ---- gcc-4.3.0.orig/libstdc++-v3/acinclude.m4 2008-02-29 01:00:39.000000000 +0100
2.7 -+++ gcc-4.3.0/libstdc++-v3/acinclude.m4 2008-06-10 14:45:35.000000000 +0200
2.8 -@@ -1349,7 +1349,7 @@
2.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
2.10 - GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
2.11 - [use MODEL for target locale package],
2.12 -- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
2.13 -+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
2.14 -
2.15 - # Deal with gettext issues. Default to not using it (=no) until we detect
2.16 - # support for it later. Let the user turn it off via --e/d, but let that
2.17 -@@ -1370,6 +1370,9 @@
2.18 - # Default to "generic".
2.19 - if test $enable_clocale_flag = auto; then
2.20 - case ${target_os} in
2.21 -+ *-uclibc*)
2.22 -+ enable_clocale_flag=uclibc
2.23 -+ ;;
2.24 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2.25 - enable_clocale_flag=gnu
2.26 - ;;
2.27 -@@ -1541,6 +1544,40 @@
2.28 - CTIME_CC=config/locale/generic/time_members.cc
2.29 - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2.30 - ;;
2.31 -+ uclibc)
2.32 -+ AC_MSG_RESULT(uclibc)
2.33 -+
2.34 -+ # Declare intention to use gettext, and add support for specific
2.35 -+ # languages.
2.36 -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2.37 -+ ALL_LINGUAS="de fr"
2.38 -+
2.39 -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2.40 -+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
2.41 -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2.42 -+ USE_NLS=yes
2.43 -+ fi
2.44 -+ # Export the build objects.
2.45 -+ for ling in $ALL_LINGUAS; do \
2.46 -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2.47 -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2.48 -+ done
2.49 -+ AC_SUBST(glibcxx_MOFILES)
2.50 -+ AC_SUBST(glibcxx_POFILES)
2.51 -+
2.52 -+ CLOCALE_H=config/locale/uclibc/c_locale.h
2.53 -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
2.54 -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2.55 -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2.56 -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2.57 -+ CMESSAGES_H=config/locale/uclibc/messages_members.h
2.58 -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2.59 -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
2.60 -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2.61 -+ CTIME_H=config/locale/uclibc/time_members.h
2.62 -+ CTIME_CC=config/locale/uclibc/time_members.cc
2.63 -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2.64 -+ ;;
2.65 - esac
2.66 -
2.67 - # This is where the testsuite looks for locale catalogs, using the
2.68 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
2.69 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
2.70 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:35.000000000 +0200
2.71 -@@ -0,0 +1,63 @@
2.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
2.73 -+
2.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
2.75 -+//
2.76 -+// This file is part of the GNU ISO C++ Library. This library is free
2.77 -+// software; you can redistribute it and/or modify it under the
2.78 -+// terms of the GNU General Public License as published by the
2.79 -+// Free Software Foundation; either version 2, or (at your option)
2.80 -+// any later version.
2.81 -+
2.82 -+// This library is distributed in the hope that it will be useful,
2.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.85 -+// GNU General Public License for more details.
2.86 -+
2.87 -+// You should have received a copy of the GNU General Public License along
2.88 -+// with this library; see the file COPYING. If not, write to the Free
2.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.90 -+// USA.
2.91 -+
2.92 -+// As a special exception, you may use this file as part of a free software
2.93 -+// library without restriction. Specifically, if other files instantiate
2.94 -+// templates or use macros or inline functions from this file, or you compile
2.95 -+// this file and link it with other files to produce an executable, this
2.96 -+// file does not by itself cause the resulting executable to be covered by
2.97 -+// the GNU General Public License. This exception does not however
2.98 -+// invalidate any other reasons why the executable file might be covered by
2.99 -+// the GNU General Public License.
2.100 -+
2.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
2.102 -+
2.103 -+#include <bits/c++config.h>
2.104 -+#include <clocale>
2.105 -+
2.106 -+#ifdef __UCLIBC_MJN3_ONLY__
2.107 -+#warning clean this up
2.108 -+#endif
2.109 -+
2.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.111 -+
2.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
2.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
2.114 -+extern "C" __typeof(strftime_l) __strftime_l;
2.115 -+extern "C" __typeof(strtod_l) __strtod_l;
2.116 -+extern "C" __typeof(strtof_l) __strtof_l;
2.117 -+extern "C" __typeof(strtold_l) __strtold_l;
2.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
2.119 -+extern "C" __typeof(newlocale) __newlocale;
2.120 -+extern "C" __typeof(freelocale) __freelocale;
2.121 -+extern "C" __typeof(duplocale) __duplocale;
2.122 -+extern "C" __typeof(uselocale) __uselocale;
2.123 -+
2.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
2.126 -+extern "C" __typeof(towlower_l) __towlower_l;
2.127 -+extern "C" __typeof(towupper_l) __towupper_l;
2.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
2.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
2.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
2.131 -+extern "C" __typeof(wctype_l) __wctype_l;
2.132 -+#endif
2.133 -+
2.134 -+#endif // GLIBC 2.3 and later
2.135 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
2.136 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
2.137 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:35.000000000 +0200
2.138 -@@ -0,0 +1,160 @@
2.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
2.140 -+
2.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
2.142 -+//
2.143 -+// This file is part of the GNU ISO C++ Library. This library is free
2.144 -+// software; you can redistribute it and/or modify it under the
2.145 -+// terms of the GNU General Public License as published by the
2.146 -+// Free Software Foundation; either version 2, or (at your option)
2.147 -+// any later version.
2.148 -+
2.149 -+// This library is distributed in the hope that it will be useful,
2.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.152 -+// GNU General Public License for more details.
2.153 -+
2.154 -+// You should have received a copy of the GNU General Public License along
2.155 -+// with this library; see the file COPYING. If not, write to the Free
2.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.157 -+// USA.
2.158 -+
2.159 -+// As a special exception, you may use this file as part of a free software
2.160 -+// library without restriction. Specifically, if other files instantiate
2.161 -+// templates or use macros or inline functions from this file, or you compile
2.162 -+// this file and link it with other files to produce an executable, this
2.163 -+// file does not by itself cause the resulting executable to be covered by
2.164 -+// the GNU General Public License. This exception does not however
2.165 -+// invalidate any other reasons why the executable file might be covered by
2.166 -+// the GNU General Public License.
2.167 -+
2.168 -+//
2.169 -+// ISO C++ 14882: 22.8 Standard locale categories.
2.170 -+//
2.171 -+
2.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.173 -+
2.174 -+#include <cerrno> // For errno
2.175 -+#include <locale>
2.176 -+#include <stdexcept>
2.177 -+#include <langinfo.h>
2.178 -+#include <bits/c++locale_internal.h>
2.179 -+
2.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.181 -+#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
2.182 -+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
2.183 -+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
2.184 -+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
2.185 -+#define __strtof_l(S, E, L) strtof((S), (E))
2.186 -+#define __strtod_l(S, E, L) strtod((S), (E))
2.187 -+#define __strtold_l(S, E, L) strtold((S), (E))
2.188 -+#warning should dummy __newlocale check for C|POSIX ?
2.189 -+#define __newlocale(a, b, c) NULL
2.190 -+#define __freelocale(a) ((void)0)
2.191 -+#define __duplocale(a) __c_locale()
2.192 -+#endif
2.193 -+
2.194 -+namespace std
2.195 -+{
2.196 -+ template<>
2.197 -+ void
2.198 -+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
2.199 -+ const __c_locale& __cloc)
2.200 -+ {
2.201 -+ if (!(__err & ios_base::failbit))
2.202 -+ {
2.203 -+ char* __sanity;
2.204 -+ errno = 0;
2.205 -+ float __f = __strtof_l(__s, &__sanity, __cloc);
2.206 -+ if (__sanity != __s && errno != ERANGE)
2.207 -+ __v = __f;
2.208 -+ else
2.209 -+ __err |= ios_base::failbit;
2.210 -+ }
2.211 -+ }
2.212 -+
2.213 -+ template<>
2.214 -+ void
2.215 -+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
2.216 -+ const __c_locale& __cloc)
2.217 -+ {
2.218 -+ if (!(__err & ios_base::failbit))
2.219 -+ {
2.220 -+ char* __sanity;
2.221 -+ errno = 0;
2.222 -+ double __d = __strtod_l(__s, &__sanity, __cloc);
2.223 -+ if (__sanity != __s && errno != ERANGE)
2.224 -+ __v = __d;
2.225 -+ else
2.226 -+ __err |= ios_base::failbit;
2.227 -+ }
2.228 -+ }
2.229 -+
2.230 -+ template<>
2.231 -+ void
2.232 -+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
2.233 -+ const __c_locale& __cloc)
2.234 -+ {
2.235 -+ if (!(__err & ios_base::failbit))
2.236 -+ {
2.237 -+ char* __sanity;
2.238 -+ errno = 0;
2.239 -+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
2.240 -+ if (__sanity != __s && errno != ERANGE)
2.241 -+ __v = __ld;
2.242 -+ else
2.243 -+ __err |= ios_base::failbit;
2.244 -+ }
2.245 -+ }
2.246 -+
2.247 -+ void
2.248 -+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
2.249 -+ __c_locale __old)
2.250 -+ {
2.251 -+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
2.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.253 -+ if (!__cloc)
2.254 -+ {
2.255 -+ // This named locale is not supported by the underlying OS.
2.256 -+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
2.257 -+ "name not valid"));
2.258 -+ }
2.259 -+#endif
2.260 -+ }
2.261 -+
2.262 -+ void
2.263 -+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
2.264 -+ {
2.265 -+ if (_S_get_c_locale() != __cloc)
2.266 -+ __freelocale(__cloc);
2.267 -+ }
2.268 -+
2.269 -+ __c_locale
2.270 -+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
2.271 -+ { return __duplocale(__cloc); }
2.272 -+} // namespace std
2.273 -+
2.274 -+namespace __gnu_cxx
2.275 -+{
2.276 -+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
2.277 -+ {
2.278 -+ "LC_CTYPE",
2.279 -+ "LC_NUMERIC",
2.280 -+ "LC_TIME",
2.281 -+ "LC_COLLATE",
2.282 -+ "LC_MONETARY",
2.283 -+ "LC_MESSAGES",
2.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
2.285 -+ "LC_PAPER",
2.286 -+ "LC_NAME",
2.287 -+ "LC_ADDRESS",
2.288 -+ "LC_TELEPHONE",
2.289 -+ "LC_MEASUREMENT",
2.290 -+ "LC_IDENTIFICATION"
2.291 -+#endif
2.292 -+ };
2.293 -+}
2.294 -+
2.295 -+namespace std
2.296 -+{
2.297 -+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
2.298 -+} // namespace std
2.299 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
2.300 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
2.301 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:35.000000000 +0200
2.302 -@@ -0,0 +1,117 @@
2.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
2.304 -+
2.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
2.306 -+//
2.307 -+// This file is part of the GNU ISO C++ Library. This library is free
2.308 -+// software; you can redistribute it and/or modify it under the
2.309 -+// terms of the GNU General Public License as published by the
2.310 -+// Free Software Foundation; either version 2, or (at your option)
2.311 -+// any later version.
2.312 -+
2.313 -+// This library is distributed in the hope that it will be useful,
2.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.316 -+// GNU General Public License for more details.
2.317 -+
2.318 -+// You should have received a copy of the GNU General Public License along
2.319 -+// with this library; see the file COPYING. If not, write to the Free
2.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.321 -+// USA.
2.322 -+
2.323 -+// As a special exception, you may use this file as part of a free software
2.324 -+// library without restriction. Specifically, if other files instantiate
2.325 -+// templates or use macros or inline functions from this file, or you compile
2.326 -+// this file and link it with other files to produce an executable, this
2.327 -+// file does not by itself cause the resulting executable to be covered by
2.328 -+// the GNU General Public License. This exception does not however
2.329 -+// invalidate any other reasons why the executable file might be covered by
2.330 -+// the GNU General Public License.
2.331 -+
2.332 -+//
2.333 -+// ISO C++ 14882: 22.8 Standard locale categories.
2.334 -+//
2.335 -+
2.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.337 -+
2.338 -+#ifndef _C_LOCALE_H
2.339 -+#define _C_LOCALE_H 1
2.340 -+
2.341 -+#pragma GCC system_header
2.342 -+
2.343 -+#include <cstring> // get std::strlen
2.344 -+#include <cstdio> // get std::snprintf or std::sprintf
2.345 -+#include <clocale>
2.346 -+#include <langinfo.h> // For codecvt
2.347 -+#ifdef __UCLIBC_MJN3_ONLY__
2.348 -+#warning fix this
2.349 -+#endif
2.350 -+#ifdef __UCLIBC_HAS_LOCALE__
2.351 -+#include <iconv.h> // For codecvt using iconv, iconv_t
2.352 -+#endif
2.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
2.354 -+#include <libintl.h> // For messages
2.355 -+#endif
2.356 -+
2.357 -+#ifdef __UCLIBC_MJN3_ONLY__
2.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
2.359 -+#endif
2.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
2.361 -+
2.362 -+#ifdef __UCLIBC_MJN3_ONLY__
2.363 -+#warning fix categories
2.364 -+#endif
2.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
2.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
2.367 -+
2.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.369 -+namespace __gnu_cxx
2.370 -+{
2.371 -+ extern "C" __typeof(uselocale) __uselocale;
2.372 -+}
2.373 -+#endif
2.374 -+
2.375 -+namespace std
2.376 -+{
2.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.378 -+ typedef __locale_t __c_locale;
2.379 -+#else
2.380 -+ typedef int* __c_locale;
2.381 -+#endif
2.382 -+
2.383 -+ // Convert numeric value of type _Tv to string and return length of
2.384 -+ // string. If snprintf is available use it, otherwise fall back to
2.385 -+ // the unsafe sprintf which, in general, can be dangerous and should
2.386 -+ // be avoided.
2.387 -+ template<typename _Tv>
2.388 -+ int
2.389 -+ __convert_from_v(char* __out,
2.390 -+ const int __size __attribute__ ((__unused__)),
2.391 -+ const char* __fmt,
2.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
2.393 -+ _Tv __v, const __c_locale& __cloc, int __prec)
2.394 -+ {
2.395 -+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
2.396 -+#else
2.397 -+ _Tv __v, const __c_locale&, int __prec)
2.398 -+ {
2.399 -+# ifdef __UCLIBC_HAS_LOCALE__
2.400 -+ char* __old = std::setlocale(LC_ALL, NULL);
2.401 -+ char* __sav = new char[std::strlen(__old) + 1];
2.402 -+ std::strcpy(__sav, __old);
2.403 -+ std::setlocale(LC_ALL, "C");
2.404 -+# endif
2.405 -+#endif
2.406 -+
2.407 -+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
2.408 -+
2.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
2.410 -+ __gnu_cxx::__uselocale(__old);
2.411 -+#elif defined __UCLIBC_HAS_LOCALE__
2.412 -+ std::setlocale(LC_ALL, __sav);
2.413 -+ delete [] __sav;
2.414 -+#endif
2.415 -+ return __ret;
2.416 -+ }
2.417 -+}
2.418 -+
2.419 -+#endif
2.420 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
2.421 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
2.422 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:45:35.000000000 +0200
2.423 -@@ -0,0 +1,306 @@
2.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
2.425 -+
2.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
2.427 -+//
2.428 -+// This file is part of the GNU ISO C++ Library. This library is free
2.429 -+// software; you can redistribute it and/or modify it under the
2.430 -+// terms of the GNU General Public License as published by the
2.431 -+// Free Software Foundation; either version 2, or (at your option)
2.432 -+// any later version.
2.433 -+
2.434 -+// This library is distributed in the hope that it will be useful,
2.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.437 -+// GNU General Public License for more details.
2.438 -+
2.439 -+// You should have received a copy of the GNU General Public License along
2.440 -+// with this library; see the file COPYING. If not, write to the Free
2.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.442 -+// USA.
2.443 -+
2.444 -+// As a special exception, you may use this file as part of a free software
2.445 -+// library without restriction. Specifically, if other files instantiate
2.446 -+// templates or use macros or inline functions from this file, or you compile
2.447 -+// this file and link it with other files to produce an executable, this
2.448 -+// file does not by itself cause the resulting executable to be covered by
2.449 -+// the GNU General Public License. This exception does not however
2.450 -+// invalidate any other reasons why the executable file might be covered by
2.451 -+// the GNU General Public License.
2.452 -+
2.453 -+//
2.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
2.455 -+//
2.456 -+
2.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.458 -+
2.459 -+#include <locale>
2.460 -+#include <bits/c++locale_internal.h>
2.461 -+
2.462 -+namespace std
2.463 -+{
2.464 -+ // Specializations.
2.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.466 -+ codecvt_base::result
2.467 -+ codecvt<wchar_t, char, mbstate_t>::
2.468 -+ do_out(state_type& __state, const intern_type* __from,
2.469 -+ const intern_type* __from_end, const intern_type*& __from_next,
2.470 -+ extern_type* __to, extern_type* __to_end,
2.471 -+ extern_type*& __to_next) const
2.472 -+ {
2.473 -+ result __ret = ok;
2.474 -+ state_type __tmp_state(__state);
2.475 -+
2.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.477 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
2.478 -+#endif
2.479 -+
2.480 -+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
2.481 -+ // in case we fall back to wcrtomb and then continue, in a loop.
2.482 -+ // NB: wcsnrtombs is a GNU extension
2.483 -+ for (__from_next = __from, __to_next = __to;
2.484 -+ __from_next < __from_end && __to_next < __to_end
2.485 -+ && __ret == ok;)
2.486 -+ {
2.487 -+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
2.488 -+ __from_end - __from_next);
2.489 -+ if (!__from_chunk_end)
2.490 -+ __from_chunk_end = __from_end;
2.491 -+
2.492 -+ __from = __from_next;
2.493 -+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
2.494 -+ __from_chunk_end - __from_next,
2.495 -+ __to_end - __to_next, &__state);
2.496 -+ if (__conv == static_cast<size_t>(-1))
2.497 -+ {
2.498 -+ // In case of error, in order to stop at the exact place we
2.499 -+ // have to start again from the beginning with a series of
2.500 -+ // wcrtomb.
2.501 -+ for (; __from < __from_next; ++__from)
2.502 -+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
2.503 -+ __state = __tmp_state;
2.504 -+ __ret = error;
2.505 -+ }
2.506 -+ else if (__from_next && __from_next < __from_chunk_end)
2.507 -+ {
2.508 -+ __to_next += __conv;
2.509 -+ __ret = partial;
2.510 -+ }
2.511 -+ else
2.512 -+ {
2.513 -+ __from_next = __from_chunk_end;
2.514 -+ __to_next += __conv;
2.515 -+ }
2.516 -+
2.517 -+ if (__from_next < __from_end && __ret == ok)
2.518 -+ {
2.519 -+ extern_type __buf[MB_LEN_MAX];
2.520 -+ __tmp_state = __state;
2.521 -+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
2.522 -+ if (__conv > static_cast<size_t>(__to_end - __to_next))
2.523 -+ __ret = partial;
2.524 -+ else
2.525 -+ {
2.526 -+ memcpy(__to_next, __buf, __conv);
2.527 -+ __state = __tmp_state;
2.528 -+ __to_next += __conv;
2.529 -+ ++__from_next;
2.530 -+ }
2.531 -+ }
2.532 -+ }
2.533 -+
2.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.535 -+ __uselocale(__old);
2.536 -+#endif
2.537 -+
2.538 -+ return __ret;
2.539 -+ }
2.540 -+
2.541 -+ codecvt_base::result
2.542 -+ codecvt<wchar_t, char, mbstate_t>::
2.543 -+ do_in(state_type& __state, const extern_type* __from,
2.544 -+ const extern_type* __from_end, const extern_type*& __from_next,
2.545 -+ intern_type* __to, intern_type* __to_end,
2.546 -+ intern_type*& __to_next) const
2.547 -+ {
2.548 -+ result __ret = ok;
2.549 -+ state_type __tmp_state(__state);
2.550 -+
2.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.552 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
2.553 -+#endif
2.554 -+
2.555 -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
2.556 -+ // in case we store a L'\0' and then continue, in a loop.
2.557 -+ // NB: mbsnrtowcs is a GNU extension
2.558 -+ for (__from_next = __from, __to_next = __to;
2.559 -+ __from_next < __from_end && __to_next < __to_end
2.560 -+ && __ret == ok;)
2.561 -+ {
2.562 -+ const extern_type* __from_chunk_end;
2.563 -+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
2.564 -+ __from_end
2.565 -+ - __from_next));
2.566 -+ if (!__from_chunk_end)
2.567 -+ __from_chunk_end = __from_end;
2.568 -+
2.569 -+ __from = __from_next;
2.570 -+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
2.571 -+ __from_chunk_end - __from_next,
2.572 -+ __to_end - __to_next, &__state);
2.573 -+ if (__conv == static_cast<size_t>(-1))
2.574 -+ {
2.575 -+ // In case of error, in order to stop at the exact place we
2.576 -+ // have to start again from the beginning with a series of
2.577 -+ // mbrtowc.
2.578 -+ for (;; ++__to_next, __from += __conv)
2.579 -+ {
2.580 -+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
2.581 -+ &__tmp_state);
2.582 -+ if (__conv == static_cast<size_t>(-1)
2.583 -+ || __conv == static_cast<size_t>(-2))
2.584 -+ break;
2.585 -+ }
2.586 -+ __from_next = __from;
2.587 -+ __state = __tmp_state;
2.588 -+ __ret = error;
2.589 -+ }
2.590 -+ else if (__from_next && __from_next < __from_chunk_end)
2.591 -+ {
2.592 -+ // It is unclear what to return in this case (see DR 382).
2.593 -+ __to_next += __conv;
2.594 -+ __ret = partial;
2.595 -+ }
2.596 -+ else
2.597 -+ {
2.598 -+ __from_next = __from_chunk_end;
2.599 -+ __to_next += __conv;
2.600 -+ }
2.601 -+
2.602 -+ if (__from_next < __from_end && __ret == ok)
2.603 -+ {
2.604 -+ if (__to_next < __to_end)
2.605 -+ {
2.606 -+ // XXX Probably wrong for stateful encodings
2.607 -+ __tmp_state = __state;
2.608 -+ ++__from_next;
2.609 -+ *__to_next++ = L'\0';
2.610 -+ }
2.611 -+ else
2.612 -+ __ret = partial;
2.613 -+ }
2.614 -+ }
2.615 -+
2.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.617 -+ __uselocale(__old);
2.618 -+#endif
2.619 -+
2.620 -+ return __ret;
2.621 -+ }
2.622 -+
2.623 -+ int
2.624 -+ codecvt<wchar_t, char, mbstate_t>::
2.625 -+ do_encoding() const throw()
2.626 -+ {
2.627 -+ // XXX This implementation assumes that the encoding is
2.628 -+ // stateless and is either single-byte or variable-width.
2.629 -+ int __ret = 0;
2.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.631 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
2.632 -+#endif
2.633 -+ if (MB_CUR_MAX == 1)
2.634 -+ __ret = 1;
2.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.636 -+ __uselocale(__old);
2.637 -+#endif
2.638 -+ return __ret;
2.639 -+ }
2.640 -+
2.641 -+ int
2.642 -+ codecvt<wchar_t, char, mbstate_t>::
2.643 -+ do_max_length() const throw()
2.644 -+ {
2.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.646 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
2.647 -+#endif
2.648 -+ // XXX Probably wrong for stateful encodings.
2.649 -+ int __ret = MB_CUR_MAX;
2.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.651 -+ __uselocale(__old);
2.652 -+#endif
2.653 -+ return __ret;
2.654 -+ }
2.655 -+
2.656 -+ int
2.657 -+ codecvt<wchar_t, char, mbstate_t>::
2.658 -+ do_length(state_type& __state, const extern_type* __from,
2.659 -+ const extern_type* __end, size_t __max) const
2.660 -+ {
2.661 -+ int __ret = 0;
2.662 -+ state_type __tmp_state(__state);
2.663 -+
2.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.665 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
2.666 -+#endif
2.667 -+
2.668 -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
2.669 -+ // in case we advance past it and then continue, in a loop.
2.670 -+ // NB: mbsnrtowcs is a GNU extension
2.671 -+
2.672 -+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
2.673 -+ // its fourth parameter (it wouldn't with NULL as first parameter).
2.674 -+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
2.675 -+ * __max));
2.676 -+ while (__from < __end && __max)
2.677 -+ {
2.678 -+ const extern_type* __from_chunk_end;
2.679 -+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
2.680 -+ __end
2.681 -+ - __from));
2.682 -+ if (!__from_chunk_end)
2.683 -+ __from_chunk_end = __end;
2.684 -+
2.685 -+ const extern_type* __tmp_from = __from;
2.686 -+ size_t __conv = mbsnrtowcs(__to, &__from,
2.687 -+ __from_chunk_end - __from,
2.688 -+ __max, &__state);
2.689 -+ if (__conv == static_cast<size_t>(-1))
2.690 -+ {
2.691 -+ // In case of error, in order to stop at the exact place we
2.692 -+ // have to start again from the beginning with a series of
2.693 -+ // mbrtowc.
2.694 -+ for (__from = __tmp_from;; __from += __conv)
2.695 -+ {
2.696 -+ __conv = mbrtowc(NULL, __from, __end - __from,
2.697 -+ &__tmp_state);
2.698 -+ if (__conv == static_cast<size_t>(-1)
2.699 -+ || __conv == static_cast<size_t>(-2))
2.700 -+ break;
2.701 -+ }
2.702 -+ __state = __tmp_state;
2.703 -+ __ret += __from - __tmp_from;
2.704 -+ break;
2.705 -+ }
2.706 -+ if (!__from)
2.707 -+ __from = __from_chunk_end;
2.708 -+
2.709 -+ __ret += __from - __tmp_from;
2.710 -+ __max -= __conv;
2.711 -+
2.712 -+ if (__from < __end && __max)
2.713 -+ {
2.714 -+ // XXX Probably wrong for stateful encodings
2.715 -+ __tmp_state = __state;
2.716 -+ ++__from;
2.717 -+ ++__ret;
2.718 -+ --__max;
2.719 -+ }
2.720 -+ }
2.721 -+
2.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.723 -+ __uselocale(__old);
2.724 -+#endif
2.725 -+
2.726 -+ return __ret;
2.727 -+ }
2.728 -+#endif
2.729 -+}
2.730 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
2.731 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
2.732 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:35.000000000 +0200
2.733 -@@ -0,0 +1,80 @@
2.734 -+// std::collate implementation details, GNU version -*- C++ -*-
2.735 -+
2.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2.737 -+//
2.738 -+// This file is part of the GNU ISO C++ Library. This library is free
2.739 -+// software; you can redistribute it and/or modify it under the
2.740 -+// terms of the GNU General Public License as published by the
2.741 -+// Free Software Foundation; either version 2, or (at your option)
2.742 -+// any later version.
2.743 -+
2.744 -+// This library is distributed in the hope that it will be useful,
2.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.747 -+// GNU General Public License for more details.
2.748 -+
2.749 -+// You should have received a copy of the GNU General Public License along
2.750 -+// with this library; see the file COPYING. If not, write to the Free
2.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.752 -+// USA.
2.753 -+
2.754 -+// As a special exception, you may use this file as part of a free software
2.755 -+// library without restriction. Specifically, if other files instantiate
2.756 -+// templates or use macros or inline functions from this file, or you compile
2.757 -+// this file and link it with other files to produce an executable, this
2.758 -+// file does not by itself cause the resulting executable to be covered by
2.759 -+// the GNU General Public License. This exception does not however
2.760 -+// invalidate any other reasons why the executable file might be covered by
2.761 -+// the GNU General Public License.
2.762 -+
2.763 -+//
2.764 -+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
2.765 -+//
2.766 -+
2.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.768 -+
2.769 -+#include <locale>
2.770 -+#include <bits/c++locale_internal.h>
2.771 -+
2.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.773 -+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
2.774 -+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
2.775 -+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
2.776 -+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
2.777 -+#endif
2.778 -+
2.779 -+namespace std
2.780 -+{
2.781 -+ // These are basically extensions to char_traits, and perhaps should
2.782 -+ // be put there instead of here.
2.783 -+ template<>
2.784 -+ int
2.785 -+ collate<char>::_M_compare(const char* __one, const char* __two) const
2.786 -+ {
2.787 -+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
2.788 -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
2.789 -+ }
2.790 -+
2.791 -+ template<>
2.792 -+ size_t
2.793 -+ collate<char>::_M_transform(char* __to, const char* __from,
2.794 -+ size_t __n) const
2.795 -+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
2.796 -+
2.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.798 -+ template<>
2.799 -+ int
2.800 -+ collate<wchar_t>::_M_compare(const wchar_t* __one,
2.801 -+ const wchar_t* __two) const
2.802 -+ {
2.803 -+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
2.804 -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
2.805 -+ }
2.806 -+
2.807 -+ template<>
2.808 -+ size_t
2.809 -+ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
2.810 -+ size_t __n) const
2.811 -+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
2.812 -+#endif
2.813 -+}
2.814 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
2.815 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
2.816 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:35.000000000 +0200
2.817 -@@ -0,0 +1,300 @@
2.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
2.819 -+
2.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.821 -+//
2.822 -+// This file is part of the GNU ISO C++ Library. This library is free
2.823 -+// software; you can redistribute it and/or modify it under the
2.824 -+// terms of the GNU General Public License as published by the
2.825 -+// Free Software Foundation; either version 2, or (at your option)
2.826 -+// any later version.
2.827 -+
2.828 -+// This library is distributed in the hope that it will be useful,
2.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.831 -+// GNU General Public License for more details.
2.832 -+
2.833 -+// You should have received a copy of the GNU General Public License along
2.834 -+// with this library; see the file COPYING. If not, write to the Free
2.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.836 -+// USA.
2.837 -+
2.838 -+// As a special exception, you may use this file as part of a free software
2.839 -+// library without restriction. Specifically, if other files instantiate
2.840 -+// templates or use macros or inline functions from this file, or you compile
2.841 -+// this file and link it with other files to produce an executable, this
2.842 -+// file does not by itself cause the resulting executable to be covered by
2.843 -+// the GNU General Public License. This exception does not however
2.844 -+// invalidate any other reasons why the executable file might be covered by
2.845 -+// the GNU General Public License.
2.846 -+
2.847 -+//
2.848 -+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
2.849 -+//
2.850 -+
2.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.852 -+
2.853 -+#define _LIBC
2.854 -+#include <locale>
2.855 -+#undef _LIBC
2.856 -+#include <bits/c++locale_internal.h>
2.857 -+
2.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.859 -+#define __wctype_l(S, L) wctype((S))
2.860 -+#define __towupper_l(C, L) towupper((C))
2.861 -+#define __towlower_l(C, L) towlower((C))
2.862 -+#define __iswctype_l(C, M, L) iswctype((C), (M))
2.863 -+#endif
2.864 -+
2.865 -+namespace std
2.866 -+{
2.867 -+ // NB: The other ctype<char> specializations are in src/locale.cc and
2.868 -+ // various /config/os/* files.
2.869 -+ template<>
2.870 -+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
2.871 -+ : ctype<char>(0, false, __refs)
2.872 -+ {
2.873 -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
2.874 -+ {
2.875 -+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
2.876 -+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
2.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.878 -+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
2.879 -+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
2.880 -+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
2.881 -+#endif
2.882 -+ }
2.883 -+ }
2.884 -+
2.885 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.886 -+ ctype<wchar_t>::__wmask_type
2.887 -+ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
2.888 -+ {
2.889 -+ __wmask_type __ret;
2.890 -+ switch (__m)
2.891 -+ {
2.892 -+ case space:
2.893 -+ __ret = __wctype_l("space", _M_c_locale_ctype);
2.894 -+ break;
2.895 -+ case print:
2.896 -+ __ret = __wctype_l("print", _M_c_locale_ctype);
2.897 -+ break;
2.898 -+ case cntrl:
2.899 -+ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
2.900 -+ break;
2.901 -+ case upper:
2.902 -+ __ret = __wctype_l("upper", _M_c_locale_ctype);
2.903 -+ break;
2.904 -+ case lower:
2.905 -+ __ret = __wctype_l("lower", _M_c_locale_ctype);
2.906 -+ break;
2.907 -+ case alpha:
2.908 -+ __ret = __wctype_l("alpha", _M_c_locale_ctype);
2.909 -+ break;
2.910 -+ case digit:
2.911 -+ __ret = __wctype_l("digit", _M_c_locale_ctype);
2.912 -+ break;
2.913 -+ case punct:
2.914 -+ __ret = __wctype_l("punct", _M_c_locale_ctype);
2.915 -+ break;
2.916 -+ case xdigit:
2.917 -+ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
2.918 -+ break;
2.919 -+ case alnum:
2.920 -+ __ret = __wctype_l("alnum", _M_c_locale_ctype);
2.921 -+ break;
2.922 -+ case graph:
2.923 -+ __ret = __wctype_l("graph", _M_c_locale_ctype);
2.924 -+ break;
2.925 -+ default:
2.926 -+ __ret = __wmask_type();
2.927 -+ }
2.928 -+ return __ret;
2.929 -+ }
2.930 -+
2.931 -+ wchar_t
2.932 -+ ctype<wchar_t>::do_toupper(wchar_t __c) const
2.933 -+ { return __towupper_l(__c, _M_c_locale_ctype); }
2.934 -+
2.935 -+ const wchar_t*
2.936 -+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
2.937 -+ {
2.938 -+ while (__lo < __hi)
2.939 -+ {
2.940 -+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
2.941 -+ ++__lo;
2.942 -+ }
2.943 -+ return __hi;
2.944 -+ }
2.945 -+
2.946 -+ wchar_t
2.947 -+ ctype<wchar_t>::do_tolower(wchar_t __c) const
2.948 -+ { return __towlower_l(__c, _M_c_locale_ctype); }
2.949 -+
2.950 -+ const wchar_t*
2.951 -+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
2.952 -+ {
2.953 -+ while (__lo < __hi)
2.954 -+ {
2.955 -+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
2.956 -+ ++__lo;
2.957 -+ }
2.958 -+ return __hi;
2.959 -+ }
2.960 -+
2.961 -+ bool
2.962 -+ ctype<wchar_t>::
2.963 -+ do_is(mask __m, wchar_t __c) const
2.964 -+ {
2.965 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
2.966 -+ // library for blank.
2.967 -+ bool __ret = false;
2.968 -+ const size_t __bitmasksize = 11;
2.969 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
2.970 -+ if (__m & _M_bit[__bitcur]
2.971 -+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
2.972 -+ {
2.973 -+ __ret = true;
2.974 -+ break;
2.975 -+ }
2.976 -+ return __ret;
2.977 -+ }
2.978 -+
2.979 -+ const wchar_t*
2.980 -+ ctype<wchar_t>::
2.981 -+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
2.982 -+ {
2.983 -+ for (; __lo < __hi; ++__vec, ++__lo)
2.984 -+ {
2.985 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
2.986 -+ // library for blank.
2.987 -+ const size_t __bitmasksize = 11;
2.988 -+ mask __m = 0;
2.989 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
2.990 -+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
2.991 -+ __m |= _M_bit[__bitcur];
2.992 -+ *__vec = __m;
2.993 -+ }
2.994 -+ return __hi;
2.995 -+ }
2.996 -+
2.997 -+ const wchar_t*
2.998 -+ ctype<wchar_t>::
2.999 -+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
2.1000 -+ {
2.1001 -+ while (__lo < __hi && !this->do_is(__m, *__lo))
2.1002 -+ ++__lo;
2.1003 -+ return __lo;
2.1004 -+ }
2.1005 -+
2.1006 -+ const wchar_t*
2.1007 -+ ctype<wchar_t>::
2.1008 -+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
2.1009 -+ {
2.1010 -+ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
2.1011 -+ ++__lo;
2.1012 -+ return __lo;
2.1013 -+ }
2.1014 -+
2.1015 -+ wchar_t
2.1016 -+ ctype<wchar_t>::
2.1017 -+ do_widen(char __c) const
2.1018 -+ { return _M_widen[static_cast<unsigned char>(__c)]; }
2.1019 -+
2.1020 -+ const char*
2.1021 -+ ctype<wchar_t>::
2.1022 -+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
2.1023 -+ {
2.1024 -+ while (__lo < __hi)
2.1025 -+ {
2.1026 -+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
2.1027 -+ ++__lo;
2.1028 -+ ++__dest;
2.1029 -+ }
2.1030 -+ return __hi;
2.1031 -+ }
2.1032 -+
2.1033 -+ char
2.1034 -+ ctype<wchar_t>::
2.1035 -+ do_narrow(wchar_t __wc, char __dfault) const
2.1036 -+ {
2.1037 -+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
2.1038 -+ return _M_narrow[__wc];
2.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1040 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
2.1041 -+#endif
2.1042 -+ const int __c = wctob(__wc);
2.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1044 -+ __uselocale(__old);
2.1045 -+#endif
2.1046 -+ return (__c == EOF ? __dfault : static_cast<char>(__c));
2.1047 -+ }
2.1048 -+
2.1049 -+ const wchar_t*
2.1050 -+ ctype<wchar_t>::
2.1051 -+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
2.1052 -+ char* __dest) const
2.1053 -+ {
2.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1055 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
2.1056 -+#endif
2.1057 -+ if (_M_narrow_ok)
2.1058 -+ while (__lo < __hi)
2.1059 -+ {
2.1060 -+ if (*__lo >= 0 && *__lo < 128)
2.1061 -+ *__dest = _M_narrow[*__lo];
2.1062 -+ else
2.1063 -+ {
2.1064 -+ const int __c = wctob(*__lo);
2.1065 -+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
2.1066 -+ }
2.1067 -+ ++__lo;
2.1068 -+ ++__dest;
2.1069 -+ }
2.1070 -+ else
2.1071 -+ while (__lo < __hi)
2.1072 -+ {
2.1073 -+ const int __c = wctob(*__lo);
2.1074 -+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
2.1075 -+ ++__lo;
2.1076 -+ ++__dest;
2.1077 -+ }
2.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1079 -+ __uselocale(__old);
2.1080 -+#endif
2.1081 -+ return __hi;
2.1082 -+ }
2.1083 -+
2.1084 -+ void
2.1085 -+ ctype<wchar_t>::_M_initialize_ctype()
2.1086 -+ {
2.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1088 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
2.1089 -+#endif
2.1090 -+ wint_t __i;
2.1091 -+ for (__i = 0; __i < 128; ++__i)
2.1092 -+ {
2.1093 -+ const int __c = wctob(__i);
2.1094 -+ if (__c == EOF)
2.1095 -+ break;
2.1096 -+ else
2.1097 -+ _M_narrow[__i] = static_cast<char>(__c);
2.1098 -+ }
2.1099 -+ if (__i == 128)
2.1100 -+ _M_narrow_ok = true;
2.1101 -+ else
2.1102 -+ _M_narrow_ok = false;
2.1103 -+ for (size_t __j = 0;
2.1104 -+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
2.1105 -+ _M_widen[__j] = btowc(__j);
2.1106 -+
2.1107 -+ for (size_t __k = 0; __k <= 11; ++__k)
2.1108 -+ {
2.1109 -+ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
2.1110 -+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
2.1111 -+ }
2.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1113 -+ __uselocale(__old);
2.1114 -+#endif
2.1115 -+ }
2.1116 -+#endif // _GLIBCXX_USE_WCHAR_T
2.1117 -+}
2.1118 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
2.1119 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
2.1120 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:35.000000000 +0200
2.1121 -@@ -0,0 +1,100 @@
2.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
2.1123 -+
2.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
2.1125 -+//
2.1126 -+// This file is part of the GNU ISO C++ Library. This library is free
2.1127 -+// software; you can redistribute it and/or modify it under the
2.1128 -+// terms of the GNU General Public License as published by the
2.1129 -+// Free Software Foundation; either version 2, or (at your option)
2.1130 -+// any later version.
2.1131 -+
2.1132 -+// This library is distributed in the hope that it will be useful,
2.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.1135 -+// GNU General Public License for more details.
2.1136 -+
2.1137 -+// You should have received a copy of the GNU General Public License along
2.1138 -+// with this library; see the file COPYING. If not, write to the Free
2.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.1140 -+// USA.
2.1141 -+
2.1142 -+// As a special exception, you may use this file as part of a free software
2.1143 -+// library without restriction. Specifically, if other files instantiate
2.1144 -+// templates or use macros or inline functions from this file, or you compile
2.1145 -+// this file and link it with other files to produce an executable, this
2.1146 -+// file does not by itself cause the resulting executable to be covered by
2.1147 -+// the GNU General Public License. This exception does not however
2.1148 -+// invalidate any other reasons why the executable file might be covered by
2.1149 -+// the GNU General Public License.
2.1150 -+
2.1151 -+//
2.1152 -+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
2.1153 -+//
2.1154 -+
2.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.1156 -+
2.1157 -+#include <locale>
2.1158 -+#include <bits/c++locale_internal.h>
2.1159 -+
2.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
2.1161 -+#warning fix gettext stuff
2.1162 -+#endif
2.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
2.1164 -+extern "C" char *__dcgettext(const char *domainname,
2.1165 -+ const char *msgid, int category);
2.1166 -+#undef gettext
2.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
2.1168 -+#else
2.1169 -+#undef gettext
2.1170 -+#define gettext(msgid) (msgid)
2.1171 -+#endif
2.1172 -+
2.1173 -+namespace std
2.1174 -+{
2.1175 -+ // Specializations.
2.1176 -+ template<>
2.1177 -+ string
2.1178 -+ messages<char>::do_get(catalog, int, int, const string& __dfault) const
2.1179 -+ {
2.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1181 -+ __c_locale __old = __uselocale(_M_c_locale_messages);
2.1182 -+ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
2.1183 -+ __uselocale(__old);
2.1184 -+ return string(__msg);
2.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
2.1186 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.1187 -+ setlocale(LC_ALL, _M_name_messages);
2.1188 -+ const char* __msg = gettext(__dfault.c_str());
2.1189 -+ setlocale(LC_ALL, __old);
2.1190 -+ free(__old);
2.1191 -+ return string(__msg);
2.1192 -+#else
2.1193 -+ const char* __msg = gettext(__dfault.c_str());
2.1194 -+ return string(__msg);
2.1195 -+#endif
2.1196 -+ }
2.1197 -+
2.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.1199 -+ template<>
2.1200 -+ wstring
2.1201 -+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
2.1202 -+ {
2.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
2.1204 -+ __c_locale __old = __uselocale(_M_c_locale_messages);
2.1205 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
2.1206 -+ __uselocale(__old);
2.1207 -+ return _M_convert_from_char(__msg);
2.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
2.1209 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.1210 -+ setlocale(LC_ALL, _M_name_messages);
2.1211 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
2.1212 -+ setlocale(LC_ALL, __old);
2.1213 -+ free(__old);
2.1214 -+ return _M_convert_from_char(__msg);
2.1215 -+# else
2.1216 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
2.1217 -+ return _M_convert_from_char(__msg);
2.1218 -+# endif
2.1219 -+ }
2.1220 -+#endif
2.1221 -+}
2.1222 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
2.1223 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
2.1224 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:35.000000000 +0200
2.1225 -@@ -0,0 +1,118 @@
2.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
2.1227 -+
2.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.1229 -+//
2.1230 -+// This file is part of the GNU ISO C++ Library. This library is free
2.1231 -+// software; you can redistribute it and/or modify it under the
2.1232 -+// terms of the GNU General Public License as published by the
2.1233 -+// Free Software Foundation; either version 2, or (at your option)
2.1234 -+// any later version.
2.1235 -+
2.1236 -+// This library is distributed in the hope that it will be useful,
2.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.1239 -+// GNU General Public License for more details.
2.1240 -+
2.1241 -+// You should have received a copy of the GNU General Public License along
2.1242 -+// with this library; see the file COPYING. If not, write to the Free
2.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.1244 -+// USA.
2.1245 -+
2.1246 -+// As a special exception, you may use this file as part of a free software
2.1247 -+// library without restriction. Specifically, if other files instantiate
2.1248 -+// templates or use macros or inline functions from this file, or you compile
2.1249 -+// this file and link it with other files to produce an executable, this
2.1250 -+// file does not by itself cause the resulting executable to be covered by
2.1251 -+// the GNU General Public License. This exception does not however
2.1252 -+// invalidate any other reasons why the executable file might be covered by
2.1253 -+// the GNU General Public License.
2.1254 -+
2.1255 -+//
2.1256 -+// ISO C++ 14882: 22.2.7.1.2 messages functions
2.1257 -+//
2.1258 -+
2.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.1260 -+
2.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
2.1262 -+#warning fix prototypes for *textdomain funcs
2.1263 -+#endif
2.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
2.1265 -+extern "C" char *__textdomain(const char *domainname);
2.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
2.1267 -+ const char *dirname);
2.1268 -+#else
2.1269 -+#undef __textdomain
2.1270 -+#undef __bindtextdomain
2.1271 -+#define __textdomain(D) ((void)0)
2.1272 -+#define __bindtextdomain(D,P) ((void)0)
2.1273 -+#endif
2.1274 -+
2.1275 -+ // Non-virtual member functions.
2.1276 -+ template<typename _CharT>
2.1277 -+ messages<_CharT>::messages(size_t __refs)
2.1278 -+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
2.1279 -+ _M_name_messages(_S_get_c_name())
2.1280 -+ { }
2.1281 -+
2.1282 -+ template<typename _CharT>
2.1283 -+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
2.1284 -+ size_t __refs)
2.1285 -+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
2.1286 -+ _M_name_messages(__s)
2.1287 -+ {
2.1288 -+ char* __tmp = new char[std::strlen(__s) + 1];
2.1289 -+ std::strcpy(__tmp, __s);
2.1290 -+ _M_name_messages = __tmp;
2.1291 -+ }
2.1292 -+
2.1293 -+ template<typename _CharT>
2.1294 -+ typename messages<_CharT>::catalog
2.1295 -+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
2.1296 -+ const char* __dir) const
2.1297 -+ {
2.1298 -+ __bindtextdomain(__s.c_str(), __dir);
2.1299 -+ return this->do_open(__s, __loc);
2.1300 -+ }
2.1301 -+
2.1302 -+ // Virtual member functions.
2.1303 -+ template<typename _CharT>
2.1304 -+ messages<_CharT>::~messages()
2.1305 -+ {
2.1306 -+ if (_M_name_messages != _S_get_c_name())
2.1307 -+ delete [] _M_name_messages;
2.1308 -+ _S_destroy_c_locale(_M_c_locale_messages);
2.1309 -+ }
2.1310 -+
2.1311 -+ template<typename _CharT>
2.1312 -+ typename messages<_CharT>::catalog
2.1313 -+ messages<_CharT>::do_open(const basic_string<char>& __s,
2.1314 -+ const locale&) const
2.1315 -+ {
2.1316 -+ // No error checking is done, assume the catalog exists and can
2.1317 -+ // be used.
2.1318 -+ __textdomain(__s.c_str());
2.1319 -+ return 0;
2.1320 -+ }
2.1321 -+
2.1322 -+ template<typename _CharT>
2.1323 -+ void
2.1324 -+ messages<_CharT>::do_close(catalog) const
2.1325 -+ { }
2.1326 -+
2.1327 -+ // messages_byname
2.1328 -+ template<typename _CharT>
2.1329 -+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
2.1330 -+ : messages<_CharT>(__refs)
2.1331 -+ {
2.1332 -+ if (this->_M_name_messages != locale::facet::_S_get_c_name())
2.1333 -+ delete [] this->_M_name_messages;
2.1334 -+ char* __tmp = new char[std::strlen(__s) + 1];
2.1335 -+ std::strcpy(__tmp, __s);
2.1336 -+ this->_M_name_messages = __tmp;
2.1337 -+
2.1338 -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
2.1339 -+ {
2.1340 -+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
2.1341 -+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
2.1342 -+ }
2.1343 -+ }
2.1344 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
2.1345 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
2.1346 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:35.000000000 +0200
2.1347 -@@ -0,0 +1,692 @@
2.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
2.1349 -+
2.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.1351 -+//
2.1352 -+// This file is part of the GNU ISO C++ Library. This library is free
2.1353 -+// software; you can redistribute it and/or modify it under the
2.1354 -+// terms of the GNU General Public License as published by the
2.1355 -+// Free Software Foundation; either version 2, or (at your option)
2.1356 -+// any later version.
2.1357 -+
2.1358 -+// This library is distributed in the hope that it will be useful,
2.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.1361 -+// GNU General Public License for more details.
2.1362 -+
2.1363 -+// You should have received a copy of the GNU General Public License along
2.1364 -+// with this library; see the file COPYING. If not, write to the Free
2.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.1366 -+// USA.
2.1367 -+
2.1368 -+// As a special exception, you may use this file as part of a free software
2.1369 -+// library without restriction. Specifically, if other files instantiate
2.1370 -+// templates or use macros or inline functions from this file, or you compile
2.1371 -+// this file and link it with other files to produce an executable, this
2.1372 -+// file does not by itself cause the resulting executable to be covered by
2.1373 -+// the GNU General Public License. This exception does not however
2.1374 -+// invalidate any other reasons why the executable file might be covered by
2.1375 -+// the GNU General Public License.
2.1376 -+
2.1377 -+//
2.1378 -+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
2.1379 -+//
2.1380 -+
2.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.1382 -+
2.1383 -+#define _LIBC
2.1384 -+#include <locale>
2.1385 -+#undef _LIBC
2.1386 -+#include <bits/c++locale_internal.h>
2.1387 -+
2.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
2.1389 -+#warning optimize this for uclibc
2.1390 -+#warning tailor for stub locale support
2.1391 -+#endif
2.1392 -+
2.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.1394 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2.1395 -+#endif
2.1396 -+
2.1397 -+namespace std
2.1398 -+{
2.1399 -+ // Construct and return valid pattern consisting of some combination of:
2.1400 -+ // space none symbol sign value
2.1401 -+ money_base::pattern
2.1402 -+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
2.1403 -+ {
2.1404 -+ pattern __ret;
2.1405 -+
2.1406 -+ // This insanely complicated routine attempts to construct a valid
2.1407 -+ // pattern for use with monyepunct. A couple of invariants:
2.1408 -+
2.1409 -+ // if (__precedes) symbol -> value
2.1410 -+ // else value -> symbol
2.1411 -+
2.1412 -+ // if (__space) space
2.1413 -+ // else none
2.1414 -+
2.1415 -+ // none == never first
2.1416 -+ // space never first or last
2.1417 -+
2.1418 -+ // Any elegant implementations of this are welcome.
2.1419 -+ switch (__posn)
2.1420 -+ {
2.1421 -+ case 0:
2.1422 -+ case 1:
2.1423 -+ // 1 The sign precedes the value and symbol.
2.1424 -+ __ret.field[0] = sign;
2.1425 -+ if (__space)
2.1426 -+ {
2.1427 -+ // Pattern starts with sign.
2.1428 -+ if (__precedes)
2.1429 -+ {
2.1430 -+ __ret.field[1] = symbol;
2.1431 -+ __ret.field[3] = value;
2.1432 -+ }
2.1433 -+ else
2.1434 -+ {
2.1435 -+ __ret.field[1] = value;
2.1436 -+ __ret.field[3] = symbol;
2.1437 -+ }
2.1438 -+ __ret.field[2] = space;
2.1439 -+ }
2.1440 -+ else
2.1441 -+ {
2.1442 -+ // Pattern starts with sign and ends with none.
2.1443 -+ if (__precedes)
2.1444 -+ {
2.1445 -+ __ret.field[1] = symbol;
2.1446 -+ __ret.field[2] = value;
2.1447 -+ }
2.1448 -+ else
2.1449 -+ {
2.1450 -+ __ret.field[1] = value;
2.1451 -+ __ret.field[2] = symbol;
2.1452 -+ }
2.1453 -+ __ret.field[3] = none;
2.1454 -+ }
2.1455 -+ break;
2.1456 -+ case 2:
2.1457 -+ // 2 The sign follows the value and symbol.
2.1458 -+ if (__space)
2.1459 -+ {
2.1460 -+ // Pattern either ends with sign.
2.1461 -+ if (__precedes)
2.1462 -+ {
2.1463 -+ __ret.field[0] = symbol;
2.1464 -+ __ret.field[2] = value;
2.1465 -+ }
2.1466 -+ else
2.1467 -+ {
2.1468 -+ __ret.field[0] = value;
2.1469 -+ __ret.field[2] = symbol;
2.1470 -+ }
2.1471 -+ __ret.field[1] = space;
2.1472 -+ __ret.field[3] = sign;
2.1473 -+ }
2.1474 -+ else
2.1475 -+ {
2.1476 -+ // Pattern ends with sign then none.
2.1477 -+ if (__precedes)
2.1478 -+ {
2.1479 -+ __ret.field[0] = symbol;
2.1480 -+ __ret.field[1] = value;
2.1481 -+ }
2.1482 -+ else
2.1483 -+ {
2.1484 -+ __ret.field[0] = value;
2.1485 -+ __ret.field[1] = symbol;
2.1486 -+ }
2.1487 -+ __ret.field[2] = sign;
2.1488 -+ __ret.field[3] = none;
2.1489 -+ }
2.1490 -+ break;
2.1491 -+ case 3:
2.1492 -+ // 3 The sign immediately precedes the symbol.
2.1493 -+ if (__precedes)
2.1494 -+ {
2.1495 -+ __ret.field[0] = sign;
2.1496 -+ __ret.field[1] = symbol;
2.1497 -+ if (__space)
2.1498 -+ {
2.1499 -+ __ret.field[2] = space;
2.1500 -+ __ret.field[3] = value;
2.1501 -+ }
2.1502 -+ else
2.1503 -+ {
2.1504 -+ __ret.field[2] = value;
2.1505 -+ __ret.field[3] = none;
2.1506 -+ }
2.1507 -+ }
2.1508 -+ else
2.1509 -+ {
2.1510 -+ __ret.field[0] = value;
2.1511 -+ if (__space)
2.1512 -+ {
2.1513 -+ __ret.field[1] = space;
2.1514 -+ __ret.field[2] = sign;
2.1515 -+ __ret.field[3] = symbol;
2.1516 -+ }
2.1517 -+ else
2.1518 -+ {
2.1519 -+ __ret.field[1] = sign;
2.1520 -+ __ret.field[2] = symbol;
2.1521 -+ __ret.field[3] = none;
2.1522 -+ }
2.1523 -+ }
2.1524 -+ break;
2.1525 -+ case 4:
2.1526 -+ // 4 The sign immediately follows the symbol.
2.1527 -+ if (__precedes)
2.1528 -+ {
2.1529 -+ __ret.field[0] = symbol;
2.1530 -+ __ret.field[1] = sign;
2.1531 -+ if (__space)
2.1532 -+ {
2.1533 -+ __ret.field[2] = space;
2.1534 -+ __ret.field[3] = value;
2.1535 -+ }
2.1536 -+ else
2.1537 -+ {
2.1538 -+ __ret.field[2] = value;
2.1539 -+ __ret.field[3] = none;
2.1540 -+ }
2.1541 -+ }
2.1542 -+ else
2.1543 -+ {
2.1544 -+ __ret.field[0] = value;
2.1545 -+ if (__space)
2.1546 -+ {
2.1547 -+ __ret.field[1] = space;
2.1548 -+ __ret.field[2] = symbol;
2.1549 -+ __ret.field[3] = sign;
2.1550 -+ }
2.1551 -+ else
2.1552 -+ {
2.1553 -+ __ret.field[1] = symbol;
2.1554 -+ __ret.field[2] = sign;
2.1555 -+ __ret.field[3] = none;
2.1556 -+ }
2.1557 -+ }
2.1558 -+ break;
2.1559 -+ default:
2.1560 -+ ;
2.1561 -+ }
2.1562 -+ return __ret;
2.1563 -+ }
2.1564 -+
2.1565 -+ template<>
2.1566 -+ void
2.1567 -+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
2.1568 -+ const char*)
2.1569 -+ {
2.1570 -+ if (!_M_data)
2.1571 -+ _M_data = new __moneypunct_cache<char, true>;
2.1572 -+
2.1573 -+ if (!__cloc)
2.1574 -+ {
2.1575 -+ // "C" locale
2.1576 -+ _M_data->_M_decimal_point = '.';
2.1577 -+ _M_data->_M_thousands_sep = ',';
2.1578 -+ _M_data->_M_grouping = "";
2.1579 -+ _M_data->_M_grouping_size = 0;
2.1580 -+ _M_data->_M_curr_symbol = "";
2.1581 -+ _M_data->_M_curr_symbol_size = 0;
2.1582 -+ _M_data->_M_positive_sign = "";
2.1583 -+ _M_data->_M_positive_sign_size = 0;
2.1584 -+ _M_data->_M_negative_sign = "";
2.1585 -+ _M_data->_M_negative_sign_size = 0;
2.1586 -+ _M_data->_M_frac_digits = 0;
2.1587 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
2.1588 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
2.1589 -+
2.1590 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
2.1591 -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
2.1592 -+ }
2.1593 -+ else
2.1594 -+ {
2.1595 -+ // Named locale.
2.1596 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
2.1597 -+ __cloc));
2.1598 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
2.1599 -+ __cloc));
2.1600 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
2.1601 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.1602 -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
2.1603 -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
2.1604 -+
2.1605 -+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
2.1606 -+ if (!__nposn)
2.1607 -+ _M_data->_M_negative_sign = "()";
2.1608 -+ else
2.1609 -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
2.1610 -+ __cloc);
2.1611 -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
2.1612 -+
2.1613 -+ // _Intl == true
2.1614 -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
2.1615 -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
2.1616 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
2.1617 -+ __cloc));
2.1618 -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
2.1619 -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
2.1620 -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
2.1621 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2.1622 -+ __pposn);
2.1623 -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
2.1624 -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
2.1625 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2.1626 -+ __nposn);
2.1627 -+ }
2.1628 -+ }
2.1629 -+
2.1630 -+ template<>
2.1631 -+ void
2.1632 -+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
2.1633 -+ const char*)
2.1634 -+ {
2.1635 -+ if (!_M_data)
2.1636 -+ _M_data = new __moneypunct_cache<char, false>;
2.1637 -+
2.1638 -+ if (!__cloc)
2.1639 -+ {
2.1640 -+ // "C" locale
2.1641 -+ _M_data->_M_decimal_point = '.';
2.1642 -+ _M_data->_M_thousands_sep = ',';
2.1643 -+ _M_data->_M_grouping = "";
2.1644 -+ _M_data->_M_grouping_size = 0;
2.1645 -+ _M_data->_M_curr_symbol = "";
2.1646 -+ _M_data->_M_curr_symbol_size = 0;
2.1647 -+ _M_data->_M_positive_sign = "";
2.1648 -+ _M_data->_M_positive_sign_size = 0;
2.1649 -+ _M_data->_M_negative_sign = "";
2.1650 -+ _M_data->_M_negative_sign_size = 0;
2.1651 -+ _M_data->_M_frac_digits = 0;
2.1652 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
2.1653 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
2.1654 -+
2.1655 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
2.1656 -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
2.1657 -+ }
2.1658 -+ else
2.1659 -+ {
2.1660 -+ // Named locale.
2.1661 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
2.1662 -+ __cloc));
2.1663 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
2.1664 -+ __cloc));
2.1665 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
2.1666 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.1667 -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
2.1668 -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
2.1669 -+
2.1670 -+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
2.1671 -+ if (!__nposn)
2.1672 -+ _M_data->_M_negative_sign = "()";
2.1673 -+ else
2.1674 -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
2.1675 -+ __cloc);
2.1676 -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
2.1677 -+
2.1678 -+ // _Intl == false
2.1679 -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
2.1680 -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
2.1681 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2.1682 -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2.1683 -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2.1684 -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2.1685 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2.1686 -+ __pposn);
2.1687 -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2.1688 -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2.1689 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2.1690 -+ __nposn);
2.1691 -+ }
2.1692 -+ }
2.1693 -+
2.1694 -+ template<>
2.1695 -+ moneypunct<char, true>::~moneypunct()
2.1696 -+ { delete _M_data; }
2.1697 -+
2.1698 -+ template<>
2.1699 -+ moneypunct<char, false>::~moneypunct()
2.1700 -+ { delete _M_data; }
2.1701 -+
2.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.1703 -+ template<>
2.1704 -+ void
2.1705 -+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
2.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1707 -+ const char*)
2.1708 -+#else
2.1709 -+ const char* __name)
2.1710 -+#endif
2.1711 -+ {
2.1712 -+ if (!_M_data)
2.1713 -+ _M_data = new __moneypunct_cache<wchar_t, true>;
2.1714 -+
2.1715 -+ if (!__cloc)
2.1716 -+ {
2.1717 -+ // "C" locale
2.1718 -+ _M_data->_M_decimal_point = L'.';
2.1719 -+ _M_data->_M_thousands_sep = L',';
2.1720 -+ _M_data->_M_grouping = "";
2.1721 -+ _M_data->_M_grouping_size = 0;
2.1722 -+ _M_data->_M_curr_symbol = L"";
2.1723 -+ _M_data->_M_curr_symbol_size = 0;
2.1724 -+ _M_data->_M_positive_sign = L"";
2.1725 -+ _M_data->_M_positive_sign_size = 0;
2.1726 -+ _M_data->_M_negative_sign = L"";
2.1727 -+ _M_data->_M_negative_sign_size = 0;
2.1728 -+ _M_data->_M_frac_digits = 0;
2.1729 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
2.1730 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
2.1731 -+
2.1732 -+ // Use ctype::widen code without the facet...
2.1733 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
2.1734 -+ _M_data->_M_atoms[__i] =
2.1735 -+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
2.1736 -+ }
2.1737 -+ else
2.1738 -+ {
2.1739 -+ // Named locale.
2.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1741 -+ __c_locale __old = __uselocale(__cloc);
2.1742 -+#else
2.1743 -+ // Switch to named locale so that mbsrtowcs will work.
2.1744 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.1745 -+ setlocale(LC_ALL, __name);
2.1746 -+#endif
2.1747 -+
2.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
2.1749 -+#warning fix this... should be monetary
2.1750 -+#endif
2.1751 -+#ifdef __UCLIBC__
2.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
2.1753 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2.1754 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2.1755 -+# else
2.1756 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2.1757 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2.1758 -+# endif
2.1759 -+#else
2.1760 -+ union { char *__s; wchar_t __w; } __u;
2.1761 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
2.1762 -+ _M_data->_M_decimal_point = __u.__w;
2.1763 -+
2.1764 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
2.1765 -+ _M_data->_M_thousands_sep = __u.__w;
2.1766 -+#endif
2.1767 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
2.1768 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.1769 -+
2.1770 -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
2.1771 -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
2.1772 -+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
2.1773 -+
2.1774 -+ wchar_t* __wcs_ps = 0;
2.1775 -+ wchar_t* __wcs_ns = 0;
2.1776 -+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
2.1777 -+ try
2.1778 -+ {
2.1779 -+ mbstate_t __state;
2.1780 -+ size_t __len = strlen(__cpossign);
2.1781 -+ if (__len)
2.1782 -+ {
2.1783 -+ ++__len;
2.1784 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1785 -+ __wcs_ps = new wchar_t[__len];
2.1786 -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
2.1787 -+ _M_data->_M_positive_sign = __wcs_ps;
2.1788 -+ }
2.1789 -+ else
2.1790 -+ _M_data->_M_positive_sign = L"";
2.1791 -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
2.1792 -+
2.1793 -+ __len = strlen(__cnegsign);
2.1794 -+ if (!__nposn)
2.1795 -+ _M_data->_M_negative_sign = L"()";
2.1796 -+ else if (__len)
2.1797 -+ {
2.1798 -+ ++__len;
2.1799 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1800 -+ __wcs_ns = new wchar_t[__len];
2.1801 -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
2.1802 -+ _M_data->_M_negative_sign = __wcs_ns;
2.1803 -+ }
2.1804 -+ else
2.1805 -+ _M_data->_M_negative_sign = L"";
2.1806 -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
2.1807 -+
2.1808 -+ // _Intl == true.
2.1809 -+ __len = strlen(__ccurr);
2.1810 -+ if (__len)
2.1811 -+ {
2.1812 -+ ++__len;
2.1813 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1814 -+ wchar_t* __wcs = new wchar_t[__len];
2.1815 -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2.1816 -+ _M_data->_M_curr_symbol = __wcs;
2.1817 -+ }
2.1818 -+ else
2.1819 -+ _M_data->_M_curr_symbol = L"";
2.1820 -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
2.1821 -+ }
2.1822 -+ catch (...)
2.1823 -+ {
2.1824 -+ delete _M_data;
2.1825 -+ _M_data = 0;
2.1826 -+ delete __wcs_ps;
2.1827 -+ delete __wcs_ns;
2.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1829 -+ __uselocale(__old);
2.1830 -+#else
2.1831 -+ setlocale(LC_ALL, __old);
2.1832 -+ free(__old);
2.1833 -+#endif
2.1834 -+ __throw_exception_again;
2.1835 -+ }
2.1836 -+
2.1837 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
2.1838 -+ __cloc));
2.1839 -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
2.1840 -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
2.1841 -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
2.1842 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2.1843 -+ __pposn);
2.1844 -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
2.1845 -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
2.1846 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2.1847 -+ __nposn);
2.1848 -+
2.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1850 -+ __uselocale(__old);
2.1851 -+#else
2.1852 -+ setlocale(LC_ALL, __old);
2.1853 -+ free(__old);
2.1854 -+#endif
2.1855 -+ }
2.1856 -+ }
2.1857 -+
2.1858 -+ template<>
2.1859 -+ void
2.1860 -+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
2.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1862 -+ const char*)
2.1863 -+#else
2.1864 -+ const char* __name)
2.1865 -+#endif
2.1866 -+ {
2.1867 -+ if (!_M_data)
2.1868 -+ _M_data = new __moneypunct_cache<wchar_t, false>;
2.1869 -+
2.1870 -+ if (!__cloc)
2.1871 -+ {
2.1872 -+ // "C" locale
2.1873 -+ _M_data->_M_decimal_point = L'.';
2.1874 -+ _M_data->_M_thousands_sep = L',';
2.1875 -+ _M_data->_M_grouping = "";
2.1876 -+ _M_data->_M_grouping_size = 0;
2.1877 -+ _M_data->_M_curr_symbol = L"";
2.1878 -+ _M_data->_M_curr_symbol_size = 0;
2.1879 -+ _M_data->_M_positive_sign = L"";
2.1880 -+ _M_data->_M_positive_sign_size = 0;
2.1881 -+ _M_data->_M_negative_sign = L"";
2.1882 -+ _M_data->_M_negative_sign_size = 0;
2.1883 -+ _M_data->_M_frac_digits = 0;
2.1884 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
2.1885 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
2.1886 -+
2.1887 -+ // Use ctype::widen code without the facet...
2.1888 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
2.1889 -+ _M_data->_M_atoms[__i] =
2.1890 -+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
2.1891 -+ }
2.1892 -+ else
2.1893 -+ {
2.1894 -+ // Named locale.
2.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1896 -+ __c_locale __old = __uselocale(__cloc);
2.1897 -+#else
2.1898 -+ // Switch to named locale so that mbsrtowcs will work.
2.1899 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.1900 -+ setlocale(LC_ALL, __name);
2.1901 -+#endif
2.1902 -+
2.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
2.1904 -+#warning fix this... should be monetary
2.1905 -+#endif
2.1906 -+#ifdef __UCLIBC__
2.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
2.1908 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
2.1909 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
2.1910 -+# else
2.1911 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
2.1912 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
2.1913 -+# endif
2.1914 -+#else
2.1915 -+ union { char *__s; wchar_t __w; } __u;
2.1916 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
2.1917 -+ _M_data->_M_decimal_point = __u.__w;
2.1918 -+
2.1919 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
2.1920 -+ _M_data->_M_thousands_sep = __u.__w;
2.1921 -+#endif
2.1922 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
2.1923 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.1924 -+
2.1925 -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
2.1926 -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
2.1927 -+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
2.1928 -+
2.1929 -+ wchar_t* __wcs_ps = 0;
2.1930 -+ wchar_t* __wcs_ns = 0;
2.1931 -+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
2.1932 -+ try
2.1933 -+ {
2.1934 -+ mbstate_t __state;
2.1935 -+ size_t __len;
2.1936 -+ __len = strlen(__cpossign);
2.1937 -+ if (__len)
2.1938 -+ {
2.1939 -+ ++__len;
2.1940 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1941 -+ __wcs_ps = new wchar_t[__len];
2.1942 -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
2.1943 -+ _M_data->_M_positive_sign = __wcs_ps;
2.1944 -+ }
2.1945 -+ else
2.1946 -+ _M_data->_M_positive_sign = L"";
2.1947 -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
2.1948 -+
2.1949 -+ __len = strlen(__cnegsign);
2.1950 -+ if (!__nposn)
2.1951 -+ _M_data->_M_negative_sign = L"()";
2.1952 -+ else if (__len)
2.1953 -+ {
2.1954 -+ ++__len;
2.1955 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1956 -+ __wcs_ns = new wchar_t[__len];
2.1957 -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
2.1958 -+ _M_data->_M_negative_sign = __wcs_ns;
2.1959 -+ }
2.1960 -+ else
2.1961 -+ _M_data->_M_negative_sign = L"";
2.1962 -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
2.1963 -+
2.1964 -+ // _Intl == true.
2.1965 -+ __len = strlen(__ccurr);
2.1966 -+ if (__len)
2.1967 -+ {
2.1968 -+ ++__len;
2.1969 -+ memset(&__state, 0, sizeof(mbstate_t));
2.1970 -+ wchar_t* __wcs = new wchar_t[__len];
2.1971 -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
2.1972 -+ _M_data->_M_curr_symbol = __wcs;
2.1973 -+ }
2.1974 -+ else
2.1975 -+ _M_data->_M_curr_symbol = L"";
2.1976 -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
2.1977 -+ }
2.1978 -+ catch (...)
2.1979 -+ {
2.1980 -+ delete _M_data;
2.1981 -+ _M_data = 0;
2.1982 -+ delete __wcs_ps;
2.1983 -+ delete __wcs_ns;
2.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.1985 -+ __uselocale(__old);
2.1986 -+#else
2.1987 -+ setlocale(LC_ALL, __old);
2.1988 -+ free(__old);
2.1989 -+#endif
2.1990 -+ __throw_exception_again;
2.1991 -+ }
2.1992 -+
2.1993 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
2.1994 -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
2.1995 -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
2.1996 -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
2.1997 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
2.1998 -+ __pposn);
2.1999 -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
2.2000 -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
2.2001 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
2.2002 -+ __nposn);
2.2003 -+
2.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.2005 -+ __uselocale(__old);
2.2006 -+#else
2.2007 -+ setlocale(LC_ALL, __old);
2.2008 -+ free(__old);
2.2009 -+#endif
2.2010 -+ }
2.2011 -+ }
2.2012 -+
2.2013 -+ template<>
2.2014 -+ moneypunct<wchar_t, true>::~moneypunct()
2.2015 -+ {
2.2016 -+ if (_M_data->_M_positive_sign_size)
2.2017 -+ delete [] _M_data->_M_positive_sign;
2.2018 -+ if (_M_data->_M_negative_sign_size
2.2019 -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2.2020 -+ delete [] _M_data->_M_negative_sign;
2.2021 -+ if (_M_data->_M_curr_symbol_size)
2.2022 -+ delete [] _M_data->_M_curr_symbol;
2.2023 -+ delete _M_data;
2.2024 -+ }
2.2025 -+
2.2026 -+ template<>
2.2027 -+ moneypunct<wchar_t, false>::~moneypunct()
2.2028 -+ {
2.2029 -+ if (_M_data->_M_positive_sign_size)
2.2030 -+ delete [] _M_data->_M_positive_sign;
2.2031 -+ if (_M_data->_M_negative_sign_size
2.2032 -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
2.2033 -+ delete [] _M_data->_M_negative_sign;
2.2034 -+ if (_M_data->_M_curr_symbol_size)
2.2035 -+ delete [] _M_data->_M_curr_symbol;
2.2036 -+ delete _M_data;
2.2037 -+ }
2.2038 -+#endif
2.2039 -+}
2.2040 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
2.2041 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
2.2042 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:35.000000000 +0200
2.2043 -@@ -0,0 +1,160 @@
2.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
2.2045 -+
2.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.2047 -+//
2.2048 -+// This file is part of the GNU ISO C++ Library. This library is free
2.2049 -+// software; you can redistribute it and/or modify it under the
2.2050 -+// terms of the GNU General Public License as published by the
2.2051 -+// Free Software Foundation; either version 2, or (at your option)
2.2052 -+// any later version.
2.2053 -+
2.2054 -+// This library is distributed in the hope that it will be useful,
2.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.2057 -+// GNU General Public License for more details.
2.2058 -+
2.2059 -+// You should have received a copy of the GNU General Public License along
2.2060 -+// with this library; see the file COPYING. If not, write to the Free
2.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.2062 -+// USA.
2.2063 -+
2.2064 -+// As a special exception, you may use this file as part of a free software
2.2065 -+// library without restriction. Specifically, if other files instantiate
2.2066 -+// templates or use macros or inline functions from this file, or you compile
2.2067 -+// this file and link it with other files to produce an executable, this
2.2068 -+// file does not by itself cause the resulting executable to be covered by
2.2069 -+// the GNU General Public License. This exception does not however
2.2070 -+// invalidate any other reasons why the executable file might be covered by
2.2071 -+// the GNU General Public License.
2.2072 -+
2.2073 -+//
2.2074 -+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
2.2075 -+//
2.2076 -+
2.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.2078 -+
2.2079 -+#define _LIBC
2.2080 -+#include <locale>
2.2081 -+#undef _LIBC
2.2082 -+#include <bits/c++locale_internal.h>
2.2083 -+
2.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
2.2085 -+#warning tailor for stub locale support
2.2086 -+#endif
2.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.2088 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2.2089 -+#endif
2.2090 -+
2.2091 -+namespace std
2.2092 -+{
2.2093 -+ template<>
2.2094 -+ void
2.2095 -+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
2.2096 -+ {
2.2097 -+ if (!_M_data)
2.2098 -+ _M_data = new __numpunct_cache<char>;
2.2099 -+
2.2100 -+ if (!__cloc)
2.2101 -+ {
2.2102 -+ // "C" locale
2.2103 -+ _M_data->_M_grouping = "";
2.2104 -+ _M_data->_M_grouping_size = 0;
2.2105 -+ _M_data->_M_use_grouping = false;
2.2106 -+
2.2107 -+ _M_data->_M_decimal_point = '.';
2.2108 -+ _M_data->_M_thousands_sep = ',';
2.2109 -+
2.2110 -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2.2111 -+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
2.2112 -+
2.2113 -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2.2114 -+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
2.2115 -+ }
2.2116 -+ else
2.2117 -+ {
2.2118 -+ // Named locale.
2.2119 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
2.2120 -+ __cloc));
2.2121 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
2.2122 -+ __cloc));
2.2123 -+
2.2124 -+ // Check for NULL, which implies no grouping.
2.2125 -+ if (_M_data->_M_thousands_sep == '\0')
2.2126 -+ _M_data->_M_grouping = "";
2.2127 -+ else
2.2128 -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2.2129 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.2130 -+ }
2.2131 -+
2.2132 -+ // NB: There is no way to extact this info from posix locales.
2.2133 -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2.2134 -+ _M_data->_M_truename = "true";
2.2135 -+ _M_data->_M_truename_size = 4;
2.2136 -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2.2137 -+ _M_data->_M_falsename = "false";
2.2138 -+ _M_data->_M_falsename_size = 5;
2.2139 -+ }
2.2140 -+
2.2141 -+ template<>
2.2142 -+ numpunct<char>::~numpunct()
2.2143 -+ { delete _M_data; }
2.2144 -+
2.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.2146 -+ template<>
2.2147 -+ void
2.2148 -+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
2.2149 -+ {
2.2150 -+ if (!_M_data)
2.2151 -+ _M_data = new __numpunct_cache<wchar_t>;
2.2152 -+
2.2153 -+ if (!__cloc)
2.2154 -+ {
2.2155 -+ // "C" locale
2.2156 -+ _M_data->_M_grouping = "";
2.2157 -+ _M_data->_M_grouping_size = 0;
2.2158 -+ _M_data->_M_use_grouping = false;
2.2159 -+
2.2160 -+ _M_data->_M_decimal_point = L'.';
2.2161 -+ _M_data->_M_thousands_sep = L',';
2.2162 -+
2.2163 -+ // Use ctype::widen code without the facet...
2.2164 -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
2.2165 -+ _M_data->_M_atoms_out[__i] =
2.2166 -+ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
2.2167 -+
2.2168 -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
2.2169 -+ _M_data->_M_atoms_in[__j] =
2.2170 -+ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
2.2171 -+ }
2.2172 -+ else
2.2173 -+ {
2.2174 -+ // Named locale.
2.2175 -+ // NB: In the GNU model wchar_t is always 32 bit wide.
2.2176 -+ union { char *__s; wchar_t __w; } __u;
2.2177 -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
2.2178 -+ _M_data->_M_decimal_point = __u.__w;
2.2179 -+
2.2180 -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
2.2181 -+ _M_data->_M_thousands_sep = __u.__w;
2.2182 -+
2.2183 -+ if (_M_data->_M_thousands_sep == L'\0')
2.2184 -+ _M_data->_M_grouping = "";
2.2185 -+ else
2.2186 -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
2.2187 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
2.2188 -+ }
2.2189 -+
2.2190 -+ // NB: There is no way to extact this info from posix locales.
2.2191 -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
2.2192 -+ _M_data->_M_truename = L"true";
2.2193 -+ _M_data->_M_truename_size = 4;
2.2194 -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
2.2195 -+ _M_data->_M_falsename = L"false";
2.2196 -+ _M_data->_M_falsename_size = 5;
2.2197 -+ }
2.2198 -+
2.2199 -+ template<>
2.2200 -+ numpunct<wchar_t>::~numpunct()
2.2201 -+ { delete _M_data; }
2.2202 -+ #endif
2.2203 -+}
2.2204 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
2.2205 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
2.2206 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:35.000000000 +0200
2.2207 -@@ -0,0 +1,406 @@
2.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2.2209 -+
2.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.2211 -+//
2.2212 -+// This file is part of the GNU ISO C++ Library. This library is free
2.2213 -+// software; you can redistribute it and/or modify it under the
2.2214 -+// terms of the GNU General Public License as published by the
2.2215 -+// Free Software Foundation; either version 2, or (at your option)
2.2216 -+// any later version.
2.2217 -+
2.2218 -+// This library is distributed in the hope that it will be useful,
2.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.2221 -+// GNU General Public License for more details.
2.2222 -+
2.2223 -+// You should have received a copy of the GNU General Public License along
2.2224 -+// with this library; see the file COPYING. If not, write to the Free
2.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.2226 -+// USA.
2.2227 -+
2.2228 -+// As a special exception, you may use this file as part of a free software
2.2229 -+// library without restriction. Specifically, if other files instantiate
2.2230 -+// templates or use macros or inline functions from this file, or you compile
2.2231 -+// this file and link it with other files to produce an executable, this
2.2232 -+// file does not by itself cause the resulting executable to be covered by
2.2233 -+// the GNU General Public License. This exception does not however
2.2234 -+// invalidate any other reasons why the executable file might be covered by
2.2235 -+// the GNU General Public License.
2.2236 -+
2.2237 -+//
2.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
2.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
2.2240 -+//
2.2241 -+
2.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.2243 -+
2.2244 -+#include <locale>
2.2245 -+#include <bits/c++locale_internal.h>
2.2246 -+
2.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
2.2248 -+#warning tailor for stub locale support
2.2249 -+#endif
2.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
2.2251 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
2.2252 -+#endif
2.2253 -+
2.2254 -+namespace std
2.2255 -+{
2.2256 -+ template<>
2.2257 -+ void
2.2258 -+ __timepunct<char>::
2.2259 -+ _M_put(char* __s, size_t __maxlen, const char* __format,
2.2260 -+ const tm* __tm) const
2.2261 -+ {
2.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.2263 -+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
2.2264 -+ _M_c_locale_timepunct);
2.2265 -+#else
2.2266 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.2267 -+ setlocale(LC_ALL, _M_name_timepunct);
2.2268 -+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
2.2269 -+ setlocale(LC_ALL, __old);
2.2270 -+ free(__old);
2.2271 -+#endif
2.2272 -+ // Make sure __s is null terminated.
2.2273 -+ if (__len == 0)
2.2274 -+ __s[0] = '\0';
2.2275 -+ }
2.2276 -+
2.2277 -+ template<>
2.2278 -+ void
2.2279 -+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
2.2280 -+ {
2.2281 -+ if (!_M_data)
2.2282 -+ _M_data = new __timepunct_cache<char>;
2.2283 -+
2.2284 -+ if (!__cloc)
2.2285 -+ {
2.2286 -+ // "C" locale
2.2287 -+ _M_c_locale_timepunct = _S_get_c_locale();
2.2288 -+
2.2289 -+ _M_data->_M_date_format = "%m/%d/%y";
2.2290 -+ _M_data->_M_date_era_format = "%m/%d/%y";
2.2291 -+ _M_data->_M_time_format = "%H:%M:%S";
2.2292 -+ _M_data->_M_time_era_format = "%H:%M:%S";
2.2293 -+ _M_data->_M_date_time_format = "";
2.2294 -+ _M_data->_M_date_time_era_format = "";
2.2295 -+ _M_data->_M_am = "AM";
2.2296 -+ _M_data->_M_pm = "PM";
2.2297 -+ _M_data->_M_am_pm_format = "";
2.2298 -+
2.2299 -+ // Day names, starting with "C"'s Sunday.
2.2300 -+ _M_data->_M_day1 = "Sunday";
2.2301 -+ _M_data->_M_day2 = "Monday";
2.2302 -+ _M_data->_M_day3 = "Tuesday";
2.2303 -+ _M_data->_M_day4 = "Wednesday";
2.2304 -+ _M_data->_M_day5 = "Thursday";
2.2305 -+ _M_data->_M_day6 = "Friday";
2.2306 -+ _M_data->_M_day7 = "Saturday";
2.2307 -+
2.2308 -+ // Abbreviated day names, starting with "C"'s Sun.
2.2309 -+ _M_data->_M_aday1 = "Sun";
2.2310 -+ _M_data->_M_aday2 = "Mon";
2.2311 -+ _M_data->_M_aday3 = "Tue";
2.2312 -+ _M_data->_M_aday4 = "Wed";
2.2313 -+ _M_data->_M_aday5 = "Thu";
2.2314 -+ _M_data->_M_aday6 = "Fri";
2.2315 -+ _M_data->_M_aday7 = "Sat";
2.2316 -+
2.2317 -+ // Month names, starting with "C"'s January.
2.2318 -+ _M_data->_M_month01 = "January";
2.2319 -+ _M_data->_M_month02 = "February";
2.2320 -+ _M_data->_M_month03 = "March";
2.2321 -+ _M_data->_M_month04 = "April";
2.2322 -+ _M_data->_M_month05 = "May";
2.2323 -+ _M_data->_M_month06 = "June";
2.2324 -+ _M_data->_M_month07 = "July";
2.2325 -+ _M_data->_M_month08 = "August";
2.2326 -+ _M_data->_M_month09 = "September";
2.2327 -+ _M_data->_M_month10 = "October";
2.2328 -+ _M_data->_M_month11 = "November";
2.2329 -+ _M_data->_M_month12 = "December";
2.2330 -+
2.2331 -+ // Abbreviated month names, starting with "C"'s Jan.
2.2332 -+ _M_data->_M_amonth01 = "Jan";
2.2333 -+ _M_data->_M_amonth02 = "Feb";
2.2334 -+ _M_data->_M_amonth03 = "Mar";
2.2335 -+ _M_data->_M_amonth04 = "Apr";
2.2336 -+ _M_data->_M_amonth05 = "May";
2.2337 -+ _M_data->_M_amonth06 = "Jun";
2.2338 -+ _M_data->_M_amonth07 = "Jul";
2.2339 -+ _M_data->_M_amonth08 = "Aug";
2.2340 -+ _M_data->_M_amonth09 = "Sep";
2.2341 -+ _M_data->_M_amonth10 = "Oct";
2.2342 -+ _M_data->_M_amonth11 = "Nov";
2.2343 -+ _M_data->_M_amonth12 = "Dec";
2.2344 -+ }
2.2345 -+ else
2.2346 -+ {
2.2347 -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2.2348 -+
2.2349 -+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
2.2350 -+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
2.2351 -+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
2.2352 -+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
2.2353 -+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
2.2354 -+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
2.2355 -+ __cloc);
2.2356 -+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
2.2357 -+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
2.2358 -+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
2.2359 -+
2.2360 -+ // Day names, starting with "C"'s Sunday.
2.2361 -+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
2.2362 -+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
2.2363 -+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
2.2364 -+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
2.2365 -+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
2.2366 -+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
2.2367 -+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
2.2368 -+
2.2369 -+ // Abbreviated day names, starting with "C"'s Sun.
2.2370 -+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
2.2371 -+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
2.2372 -+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
2.2373 -+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
2.2374 -+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
2.2375 -+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
2.2376 -+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
2.2377 -+
2.2378 -+ // Month names, starting with "C"'s January.
2.2379 -+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
2.2380 -+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
2.2381 -+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
2.2382 -+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
2.2383 -+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
2.2384 -+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
2.2385 -+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
2.2386 -+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
2.2387 -+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
2.2388 -+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
2.2389 -+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
2.2390 -+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
2.2391 -+
2.2392 -+ // Abbreviated month names, starting with "C"'s Jan.
2.2393 -+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
2.2394 -+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
2.2395 -+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
2.2396 -+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
2.2397 -+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
2.2398 -+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
2.2399 -+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
2.2400 -+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
2.2401 -+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
2.2402 -+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
2.2403 -+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
2.2404 -+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
2.2405 -+ }
2.2406 -+ }
2.2407 -+
2.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
2.2409 -+ template<>
2.2410 -+ void
2.2411 -+ __timepunct<wchar_t>::
2.2412 -+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
2.2413 -+ const tm* __tm) const
2.2414 -+ {
2.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
2.2416 -+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
2.2417 -+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
2.2418 -+ _M_c_locale_timepunct);
2.2419 -+#else
2.2420 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
2.2421 -+ setlocale(LC_ALL, _M_name_timepunct);
2.2422 -+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
2.2423 -+ setlocale(LC_ALL, __old);
2.2424 -+ free(__old);
2.2425 -+#endif
2.2426 -+ // Make sure __s is null terminated.
2.2427 -+ if (__len == 0)
2.2428 -+ __s[0] = L'\0';
2.2429 -+ }
2.2430 -+
2.2431 -+ template<>
2.2432 -+ void
2.2433 -+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
2.2434 -+ {
2.2435 -+ if (!_M_data)
2.2436 -+ _M_data = new __timepunct_cache<wchar_t>;
2.2437 -+
2.2438 -+#warning wide time stuff
2.2439 -+// if (!__cloc)
2.2440 -+ {
2.2441 -+ // "C" locale
2.2442 -+ _M_c_locale_timepunct = _S_get_c_locale();
2.2443 -+
2.2444 -+ _M_data->_M_date_format = L"%m/%d/%y";
2.2445 -+ _M_data->_M_date_era_format = L"%m/%d/%y";
2.2446 -+ _M_data->_M_time_format = L"%H:%M:%S";
2.2447 -+ _M_data->_M_time_era_format = L"%H:%M:%S";
2.2448 -+ _M_data->_M_date_time_format = L"";
2.2449 -+ _M_data->_M_date_time_era_format = L"";
2.2450 -+ _M_data->_M_am = L"AM";
2.2451 -+ _M_data->_M_pm = L"PM";
2.2452 -+ _M_data->_M_am_pm_format = L"";
2.2453 -+
2.2454 -+ // Day names, starting with "C"'s Sunday.
2.2455 -+ _M_data->_M_day1 = L"Sunday";
2.2456 -+ _M_data->_M_day2 = L"Monday";
2.2457 -+ _M_data->_M_day3 = L"Tuesday";
2.2458 -+ _M_data->_M_day4 = L"Wednesday";
2.2459 -+ _M_data->_M_day5 = L"Thursday";
2.2460 -+ _M_data->_M_day6 = L"Friday";
2.2461 -+ _M_data->_M_day7 = L"Saturday";
2.2462 -+
2.2463 -+ // Abbreviated day names, starting with "C"'s Sun.
2.2464 -+ _M_data->_M_aday1 = L"Sun";
2.2465 -+ _M_data->_M_aday2 = L"Mon";
2.2466 -+ _M_data->_M_aday3 = L"Tue";
2.2467 -+ _M_data->_M_aday4 = L"Wed";
2.2468 -+ _M_data->_M_aday5 = L"Thu";
2.2469 -+ _M_data->_M_aday6 = L"Fri";
2.2470 -+ _M_data->_M_aday7 = L"Sat";
2.2471 -+
2.2472 -+ // Month names, starting with "C"'s January.
2.2473 -+ _M_data->_M_month01 = L"January";
2.2474 -+ _M_data->_M_month02 = L"February";
2.2475 -+ _M_data->_M_month03 = L"March";
2.2476 -+ _M_data->_M_month04 = L"April";
2.2477 -+ _M_data->_M_month05 = L"May";
2.2478 -+ _M_data->_M_month06 = L"June";
2.2479 -+ _M_data->_M_month07 = L"July";
2.2480 -+ _M_data->_M_month08 = L"August";
2.2481 -+ _M_data->_M_month09 = L"September";
2.2482 -+ _M_data->_M_month10 = L"October";
2.2483 -+ _M_data->_M_month11 = L"November";
2.2484 -+ _M_data->_M_month12 = L"December";
2.2485 -+
2.2486 -+ // Abbreviated month names, starting with "C"'s Jan.
2.2487 -+ _M_data->_M_amonth01 = L"Jan";
2.2488 -+ _M_data->_M_amonth02 = L"Feb";
2.2489 -+ _M_data->_M_amonth03 = L"Mar";
2.2490 -+ _M_data->_M_amonth04 = L"Apr";
2.2491 -+ _M_data->_M_amonth05 = L"May";
2.2492 -+ _M_data->_M_amonth06 = L"Jun";
2.2493 -+ _M_data->_M_amonth07 = L"Jul";
2.2494 -+ _M_data->_M_amonth08 = L"Aug";
2.2495 -+ _M_data->_M_amonth09 = L"Sep";
2.2496 -+ _M_data->_M_amonth10 = L"Oct";
2.2497 -+ _M_data->_M_amonth11 = L"Nov";
2.2498 -+ _M_data->_M_amonth12 = L"Dec";
2.2499 -+ }
2.2500 -+#if 0
2.2501 -+ else
2.2502 -+ {
2.2503 -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
2.2504 -+
2.2505 -+ union { char *__s; wchar_t *__w; } __u;
2.2506 -+
2.2507 -+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
2.2508 -+ _M_data->_M_date_format = __u.__w;
2.2509 -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
2.2510 -+ _M_data->_M_date_era_format = __u.__w;
2.2511 -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
2.2512 -+ _M_data->_M_time_format = __u.__w;
2.2513 -+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
2.2514 -+ _M_data->_M_time_era_format = __u.__w;
2.2515 -+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
2.2516 -+ _M_data->_M_date_time_format = __u.__w;
2.2517 -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
2.2518 -+ _M_data->_M_date_time_era_format = __u.__w;
2.2519 -+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
2.2520 -+ _M_data->_M_am = __u.__w;
2.2521 -+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
2.2522 -+ _M_data->_M_pm = __u.__w;
2.2523 -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
2.2524 -+ _M_data->_M_am_pm_format = __u.__w;
2.2525 -+
2.2526 -+ // Day names, starting with "C"'s Sunday.
2.2527 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
2.2528 -+ _M_data->_M_day1 = __u.__w;
2.2529 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
2.2530 -+ _M_data->_M_day2 = __u.__w;
2.2531 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
2.2532 -+ _M_data->_M_day3 = __u.__w;
2.2533 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
2.2534 -+ _M_data->_M_day4 = __u.__w;
2.2535 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
2.2536 -+ _M_data->_M_day5 = __u.__w;
2.2537 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
2.2538 -+ _M_data->_M_day6 = __u.__w;
2.2539 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
2.2540 -+ _M_data->_M_day7 = __u.__w;
2.2541 -+
2.2542 -+ // Abbreviated day names, starting with "C"'s Sun.
2.2543 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
2.2544 -+ _M_data->_M_aday1 = __u.__w;
2.2545 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
2.2546 -+ _M_data->_M_aday2 = __u.__w;
2.2547 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
2.2548 -+ _M_data->_M_aday3 = __u.__w;
2.2549 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
2.2550 -+ _M_data->_M_aday4 = __u.__w;
2.2551 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
2.2552 -+ _M_data->_M_aday5 = __u.__w;
2.2553 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
2.2554 -+ _M_data->_M_aday6 = __u.__w;
2.2555 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
2.2556 -+ _M_data->_M_aday7 = __u.__w;
2.2557 -+
2.2558 -+ // Month names, starting with "C"'s January.
2.2559 -+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
2.2560 -+ _M_data->_M_month01 = __u.__w;
2.2561 -+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
2.2562 -+ _M_data->_M_month02 = __u.__w;
2.2563 -+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
2.2564 -+ _M_data->_M_month03 = __u.__w;
2.2565 -+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
2.2566 -+ _M_data->_M_month04 = __u.__w;
2.2567 -+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
2.2568 -+ _M_data->_M_month05 = __u.__w;
2.2569 -+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
2.2570 -+ _M_data->_M_month06 = __u.__w;
2.2571 -+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
2.2572 -+ _M_data->_M_month07 = __u.__w;
2.2573 -+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
2.2574 -+ _M_data->_M_month08 = __u.__w;
2.2575 -+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
2.2576 -+ _M_data->_M_month09 = __u.__w;
2.2577 -+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
2.2578 -+ _M_data->_M_month10 = __u.__w;
2.2579 -+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
2.2580 -+ _M_data->_M_month11 = __u.__w;
2.2581 -+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
2.2582 -+ _M_data->_M_month12 = __u.__w;
2.2583 -+
2.2584 -+ // Abbreviated month names, starting with "C"'s Jan.
2.2585 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
2.2586 -+ _M_data->_M_amonth01 = __u.__w;
2.2587 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
2.2588 -+ _M_data->_M_amonth02 = __u.__w;
2.2589 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
2.2590 -+ _M_data->_M_amonth03 = __u.__w;
2.2591 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
2.2592 -+ _M_data->_M_amonth04 = __u.__w;
2.2593 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
2.2594 -+ _M_data->_M_amonth05 = __u.__w;
2.2595 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
2.2596 -+ _M_data->_M_amonth06 = __u.__w;
2.2597 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
2.2598 -+ _M_data->_M_amonth07 = __u.__w;
2.2599 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
2.2600 -+ _M_data->_M_amonth08 = __u.__w;
2.2601 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
2.2602 -+ _M_data->_M_amonth09 = __u.__w;
2.2603 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
2.2604 -+ _M_data->_M_amonth10 = __u.__w;
2.2605 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
2.2606 -+ _M_data->_M_amonth11 = __u.__w;
2.2607 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
2.2608 -+ _M_data->_M_amonth12 = __u.__w;
2.2609 -+ }
2.2610 -+#endif // 0
2.2611 -+ }
2.2612 -+#endif
2.2613 -+}
2.2614 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
2.2615 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
2.2616 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:35.000000000 +0200
2.2617 -@@ -0,0 +1,68 @@
2.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
2.2619 -+
2.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
2.2621 -+//
2.2622 -+// This file is part of the GNU ISO C++ Library. This library is free
2.2623 -+// software; you can redistribute it and/or modify it under the
2.2624 -+// terms of the GNU General Public License as published by the
2.2625 -+// Free Software Foundation; either version 2, or (at your option)
2.2626 -+// any later version.
2.2627 -+
2.2628 -+// This library is distributed in the hope that it will be useful,
2.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
2.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2.2631 -+// GNU General Public License for more details.
2.2632 -+
2.2633 -+// You should have received a copy of the GNU General Public License along
2.2634 -+// with this library; see the file COPYING. If not, write to the Free
2.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
2.2636 -+// USA.
2.2637 -+
2.2638 -+// As a special exception, you may use this file as part of a free software
2.2639 -+// library without restriction. Specifically, if other files instantiate
2.2640 -+// templates or use macros or inline functions from this file, or you compile
2.2641 -+// this file and link it with other files to produce an executable, this
2.2642 -+// file does not by itself cause the resulting executable to be covered by
2.2643 -+// the GNU General Public License. This exception does not however
2.2644 -+// invalidate any other reasons why the executable file might be covered by
2.2645 -+// the GNU General Public License.
2.2646 -+
2.2647 -+//
2.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
2.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
2.2650 -+//
2.2651 -+
2.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
2.2653 -+
2.2654 -+ template<typename _CharT>
2.2655 -+ __timepunct<_CharT>::__timepunct(size_t __refs)
2.2656 -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2.2657 -+ _M_name_timepunct(_S_get_c_name())
2.2658 -+ { _M_initialize_timepunct(); }
2.2659 -+
2.2660 -+ template<typename _CharT>
2.2661 -+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
2.2662 -+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
2.2663 -+ _M_name_timepunct(_S_get_c_name())
2.2664 -+ { _M_initialize_timepunct(); }
2.2665 -+
2.2666 -+ template<typename _CharT>
2.2667 -+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
2.2668 -+ size_t __refs)
2.2669 -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
2.2670 -+ _M_name_timepunct(__s)
2.2671 -+ {
2.2672 -+ char* __tmp = new char[std::strlen(__s) + 1];
2.2673 -+ std::strcpy(__tmp, __s);
2.2674 -+ _M_name_timepunct = __tmp;
2.2675 -+ _M_initialize_timepunct(__cloc);
2.2676 -+ }
2.2677 -+
2.2678 -+ template<typename _CharT>
2.2679 -+ __timepunct<_CharT>::~__timepunct()
2.2680 -+ {
2.2681 -+ if (_M_name_timepunct != _S_get_c_name())
2.2682 -+ delete [] _M_name_timepunct;
2.2683 -+ delete _M_data;
2.2684 -+ _S_destroy_c_locale(_M_c_locale_timepunct);
2.2685 -+ }
2.2686 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
2.2687 ---- gcc-4.3.0.orig/libstdc++-v3/configure 2008-02-29 01:00:39.000000000 +0100
2.2688 -+++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:35.000000000 +0200
2.2689 -@@ -14001,7 +14001,7 @@
2.2690 - enableval="$enable_clocale"
2.2691 -
2.2692 - case "$enableval" in
2.2693 -- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
2.2694 -+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
2.2695 - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
2.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
2.2697 - { (exit 1); exit 1; }; } ;;
2.2698 -@@ -14034,6 +14034,9 @@
2.2699 - # Default to "generic".
2.2700 - if test $enable_clocale_flag = auto; then
2.2701 - case ${target_os} in
2.2702 -+ linux-uclibc*)
2.2703 -+ enable_clocale_flag=uclibc
2.2704 -+ ;;
2.2705 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
2.2706 - enable_clocale_flag=gnu
2.2707 - ;;
2.2708 -@@ -14422,6 +14425,76 @@
2.2709 - CTIME_CC=config/locale/generic/time_members.cc
2.2710 - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
2.2711 - ;;
2.2712 -+ uclibc)
2.2713 -+ echo "$as_me:$LINENO: result: uclibc" >&5
2.2714 -+echo "${ECHO_T}uclibc" >&6
2.2715 -+
2.2716 -+ # Declare intention to use gettext, and add support for specific
2.2717 -+ # languages.
2.2718 -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
2.2719 -+ ALL_LINGUAS="de fr"
2.2720 -+
2.2721 -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
2.2722 -+ # Extract the first word of "msgfmt", so it can be a program name with args.
2.2723 -+set dummy msgfmt; ac_word=$2
2.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
2.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
2.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
2.2727 -+ echo $ECHO_N "(cached) $ECHO_C" >&6
2.2728 -+else
2.2729 -+ if test -n "$check_msgfmt"; then
2.2730 -+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
2.2731 -+else
2.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
2.2733 -+for as_dir in $PATH
2.2734 -+do
2.2735 -+ IFS=$as_save_IFS
2.2736 -+ test -z "$as_dir" && as_dir=.
2.2737 -+ for ac_exec_ext in '' $ac_executable_extensions; do
2.2738 -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
2.2739 -+ ac_cv_prog_check_msgfmt="yes"
2.2740 -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
2.2741 -+ break 2
2.2742 -+ fi
2.2743 -+done
2.2744 -+done
2.2745 -+
2.2746 -+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
2.2747 -+fi
2.2748 -+fi
2.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
2.2750 -+if test -n "$check_msgfmt"; then
2.2751 -+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
2.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
2.2753 -+else
2.2754 -+ echo "$as_me:$LINENO: result: no" >&5
2.2755 -+echo "${ECHO_T}no" >&6
2.2756 -+fi
2.2757 -+
2.2758 -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
2.2759 -+ USE_NLS=yes
2.2760 -+ fi
2.2761 -+ # Export the build objects.
2.2762 -+ for ling in $ALL_LINGUAS; do \
2.2763 -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
2.2764 -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
2.2765 -+ done
2.2766 -+
2.2767 -+
2.2768 -+
2.2769 -+ CLOCALE_H=config/locale/uclibc/c_locale.h
2.2770 -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
2.2771 -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
2.2772 -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
2.2773 -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
2.2774 -+ CMESSAGES_H=config/locale/uclibc/messages_members.h
2.2775 -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
2.2776 -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
2.2777 -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
2.2778 -+ CTIME_H=config/locale/uclibc/time_members.h
2.2779 -+ CTIME_CC=config/locale/uclibc/time_members.cc
2.2780 -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
2.2781 -+ ;;
2.2782 - esac
2.2783 -
2.2784 - # This is where the testsuite looks for locale catalogs, using the
2.2785 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h
2.2786 ---- gcc-4.3.0.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100
2.2787 -+++ gcc-4.3.0/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:45:35.000000000 +0200
2.2788 -@@ -106,7 +106,9 @@
2.2789 - using std::wmemcpy;
2.2790 - using std::wmemmove;
2.2791 - using std::wmemset;
2.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
2.2793 - using std::wcsftime;
2.2794 -+#endif
2.2795 -
2.2796 - #if _GLIBCXX_USE_C99
2.2797 - using std::wcstold;
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/patches/gcc/4.3.0/330-c99-complex-ugly-hack.patch Mon Aug 04 12:38:06 2008 +0000
3.3 @@ -0,0 +1,14 @@
3.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
3.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
3.6 +--- gcc-4.3.0.orig/libstdc++-v3/configure 2008-06-10 14:45:39.000000000 +0200
3.7 ++++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:54.000000000 +0200
3.8 +@@ -39006,6 +39006,9 @@
3.9 + cat >>conftest.$ac_ext <<_ACEOF
3.10 + /* end confdefs.h. */
3.11 + #include <complex.h>
3.12 ++#ifdef __UCLIBC__
3.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
3.14 ++#endif
3.15 + int
3.16 + main ()
3.17 + {
4.1 --- a/patches/gcc/4.3.0/330-uclibc-locale-no__x.patch Mon Aug 04 12:09:54 2008 +0000
4.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
4.3 @@ -1,224 +0,0 @@
4.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_203-uclibc-locale-no__x.patch
4.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
4.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200
4.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:45:39.000000000 +0200
4.8 -@@ -60,4 +60,49 @@
4.9 - extern "C" __typeof(wctype_l) __wctype_l;
4.10 - #endif
4.11 -
4.12 -+# define __nl_langinfo_l nl_langinfo_l
4.13 -+# define __strcoll_l strcoll_l
4.14 -+# define __strftime_l strftime_l
4.15 -+# define __strtod_l strtod_l
4.16 -+# define __strtof_l strtof_l
4.17 -+# define __strtold_l strtold_l
4.18 -+# define __strxfrm_l strxfrm_l
4.19 -+# define __newlocale newlocale
4.20 -+# define __freelocale freelocale
4.21 -+# define __duplocale duplocale
4.22 -+# define __uselocale uselocale
4.23 -+
4.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
4.25 -+# define __iswctype_l iswctype_l
4.26 -+# define __towlower_l towlower_l
4.27 -+# define __towupper_l towupper_l
4.28 -+# define __wcscoll_l wcscoll_l
4.29 -+# define __wcsftime_l wcsftime_l
4.30 -+# define __wcsxfrm_l wcsxfrm_l
4.31 -+# define __wctype_l wctype_l
4.32 -+# endif
4.33 -+
4.34 -+#else
4.35 -+# define __nl_langinfo_l(N, L) nl_langinfo((N))
4.36 -+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
4.37 -+# define __strtod_l(S, E, L) strtod((S), (E))
4.38 -+# define __strtof_l(S, E, L) strtof((S), (E))
4.39 -+# define __strtold_l(S, E, L) strtold((S), (E))
4.40 -+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
4.41 -+# warning should dummy __newlocale check for C|POSIX ?
4.42 -+# define __newlocale(a, b, c) NULL
4.43 -+# define __freelocale(a) ((void)0)
4.44 -+# define __duplocale(a) __c_locale()
4.45 -+//# define __uselocale ?
4.46 -+//
4.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
4.48 -+# define __iswctype_l(C, M, L) iswctype((C), (M))
4.49 -+# define __towlower_l(C, L) towlower((C))
4.50 -+# define __towupper_l(C, L) towupper((C))
4.51 -+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
4.52 -+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
4.53 -+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
4.54 -+# define __wctype_l(S, L) wctype((S))
4.55 -+# endif
4.56 -+
4.57 - #endif // GLIBC 2.3 and later
4.58 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
4.59 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200
4.60 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:39.000000000 +0200
4.61 -@@ -39,20 +39,6 @@
4.62 - #include <langinfo.h>
4.63 - #include <bits/c++locale_internal.h>
4.64 -
4.65 --#ifndef __UCLIBC_HAS_XLOCALE__
4.66 --#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
4.67 --#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
4.68 --#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
4.69 --#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
4.70 --#define __strtof_l(S, E, L) strtof((S), (E))
4.71 --#define __strtod_l(S, E, L) strtod((S), (E))
4.72 --#define __strtold_l(S, E, L) strtold((S), (E))
4.73 --#warning should dummy __newlocale check for C|POSIX ?
4.74 --#define __newlocale(a, b, c) NULL
4.75 --#define __freelocale(a) ((void)0)
4.76 --#define __duplocale(a) __c_locale()
4.77 --#endif
4.78 --
4.79 - namespace std
4.80 - {
4.81 - template<>
4.82 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
4.83 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200
4.84 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:39.000000000 +0200
4.85 -@@ -68,6 +68,7 @@
4.86 - {
4.87 - extern "C" __typeof(uselocale) __uselocale;
4.88 - }
4.89 -+#define __uselocale uselocale
4.90 - #endif
4.91 -
4.92 - namespace std
4.93 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc
4.94 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200
4.95 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:45:39.000000000 +0200
4.96 -@@ -36,13 +36,6 @@
4.97 - #include <locale>
4.98 - #include <bits/c++locale_internal.h>
4.99 -
4.100 --#ifndef __UCLIBC_HAS_XLOCALE__
4.101 --#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
4.102 --#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
4.103 --#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
4.104 --#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
4.105 --#endif
4.106 --
4.107 - namespace std
4.108 - {
4.109 - // These are basically extensions to char_traits, and perhaps should
4.110 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
4.111 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200
4.112 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:39.000000000 +0200
4.113 -@@ -38,13 +38,6 @@
4.114 - #undef _LIBC
4.115 - #include <bits/c++locale_internal.h>
4.116 -
4.117 --#ifndef __UCLIBC_HAS_XLOCALE__
4.118 --#define __wctype_l(S, L) wctype((S))
4.119 --#define __towupper_l(C, L) towupper((C))
4.120 --#define __towlower_l(C, L) towlower((C))
4.121 --#define __iswctype_l(C, M, L) iswctype((C), (M))
4.122 --#endif
4.123 --
4.124 - namespace std
4.125 - {
4.126 - // NB: The other ctype<char> specializations are in src/locale.cc and
4.127 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc
4.128 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200
4.129 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:45:39.000000000 +0200
4.130 -@@ -39,13 +39,10 @@
4.131 - #ifdef __UCLIBC_MJN3_ONLY__
4.132 - #warning fix gettext stuff
4.133 - #endif
4.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
4.135 --extern "C" char *__dcgettext(const char *domainname,
4.136 -- const char *msgid, int category);
4.137 - #undef gettext
4.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
4.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
4.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
4.141 - #else
4.142 --#undef gettext
4.143 - #define gettext(msgid) (msgid)
4.144 - #endif
4.145 -
4.146 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
4.147 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200
4.148 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:39.000000000 +0200
4.149 -@@ -36,15 +36,11 @@
4.150 - #ifdef __UCLIBC_MJN3_ONLY__
4.151 - #warning fix prototypes for *textdomain funcs
4.152 - #endif
4.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
4.154 --extern "C" char *__textdomain(const char *domainname);
4.155 --extern "C" char *__bindtextdomain(const char *domainname,
4.156 -- const char *dirname);
4.157 --#else
4.158 --#undef __textdomain
4.159 --#undef __bindtextdomain
4.160 --#define __textdomain(D) ((void)0)
4.161 --#define __bindtextdomain(D,P) ((void)0)
4.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
4.163 -+#undef textdomain
4.164 -+#undef bindtextdomain
4.165 -+#define textdomain(D) ((void)0)
4.166 -+#define bindtextdomain(D,P) ((void)0)
4.167 - #endif
4.168 -
4.169 - // Non-virtual member functions.
4.170 -@@ -70,7 +66,7 @@
4.171 - messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
4.172 - const char* __dir) const
4.173 - {
4.174 -- __bindtextdomain(__s.c_str(), __dir);
4.175 -+ bindtextdomain(__s.c_str(), __dir);
4.176 - return this->do_open(__s, __loc);
4.177 - }
4.178 -
4.179 -@@ -90,7 +86,7 @@
4.180 - {
4.181 - // No error checking is done, assume the catalog exists and can
4.182 - // be used.
4.183 -- __textdomain(__s.c_str());
4.184 -+ textdomain(__s.c_str());
4.185 - return 0;
4.186 - }
4.187 -
4.188 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
4.189 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200
4.190 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:39.000000000 +0200
4.191 -@@ -43,10 +43,6 @@
4.192 - #warning tailor for stub locale support
4.193 - #endif
4.194 -
4.195 --#ifndef __UCLIBC_HAS_XLOCALE__
4.196 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
4.197 --#endif
4.198 --
4.199 - namespace std
4.200 - {
4.201 - // Construct and return valid pattern consisting of some combination of:
4.202 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
4.203 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200
4.204 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:39.000000000 +0200
4.205 -@@ -41,9 +41,6 @@
4.206 - #ifdef __UCLIBC_MJN3_ONLY__
4.207 - #warning tailor for stub locale support
4.208 - #endif
4.209 --#ifndef __UCLIBC_HAS_XLOCALE__
4.210 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
4.211 --#endif
4.212 -
4.213 - namespace std
4.214 - {
4.215 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc
4.216 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200
4.217 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:45:39.000000000 +0200
4.218 -@@ -40,9 +40,6 @@
4.219 - #ifdef __UCLIBC_MJN3_ONLY__
4.220 - #warning tailor for stub locale support
4.221 - #endif
4.222 --#ifndef __UCLIBC_HAS_XLOCALE__
4.223 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
4.224 --#endif
4.225 -
4.226 - namespace std
4.227 - {
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/patches/gcc/4.3.0/340-index_macro.patch Mon Aug 04 12:38:06 2008 +0000
5.3 @@ -0,0 +1,27 @@
5.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
5.5 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
5.6 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
5.7 ++++ gcc-4.3.0/libstdc++-v3/include/ext/rope 2008-06-10 14:45:58.000000000 +0200
5.8 +@@ -59,6 +59,9 @@
5.9 + #include <bits/gthr.h>
5.10 + #include <tr1/functional>
5.11 +
5.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
5.13 ++#undef index
5.14 ++
5.15 + # ifdef __GC
5.16 + # define __GC_CONST const
5.17 + # else
5.18 +diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
5.19 +--- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
5.20 ++++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:45:58.000000000 +0200
5.21 +@@ -54,6 +54,9 @@
5.22 + #include <ext/memory> // For uninitialized_copy_n
5.23 + #include <ext/numeric> // For power
5.24 +
5.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
5.26 ++#undef index
5.27 ++
5.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
5.29 +
5.30 + using std::size_t;
6.1 --- a/patches/gcc/4.3.0/340-uclibc-locale-wchar_fix.patch Mon Aug 04 12:09:54 2008 +0000
6.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
6.3 @@ -1,51 +0,0 @@
6.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
6.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
6.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200
6.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:43.000000000 +0200
6.8 -@@ -401,7 +401,7 @@
6.9 - # ifdef __UCLIBC_HAS_XLOCALE__
6.10 - _M_data->_M_decimal_point = __cloc->decimal_point_wc;
6.11 - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
6.12 --# else
6.13 -+# elif defined __UCLIBC_HAS_LOCALE__
6.14 - _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
6.15 - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
6.16 - # endif
6.17 -@@ -556,7 +556,7 @@
6.18 - # ifdef __UCLIBC_HAS_XLOCALE__
6.19 - _M_data->_M_decimal_point = __cloc->decimal_point_wc;
6.20 - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
6.21 --# else
6.22 -+# elif defined __UCLIBC_HAS_LOCALE__
6.23 - _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
6.24 - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
6.25 - # endif
6.26 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
6.27 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200
6.28 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:43.000000000 +0200
6.29 -@@ -127,12 +127,25 @@
6.30 - {
6.31 - // Named locale.
6.32 - // NB: In the GNU model wchar_t is always 32 bit wide.
6.33 -+#ifdef __UCLIBC_MJN3_ONLY__
6.34 -+#warning fix this... should be numeric
6.35 -+#endif
6.36 -+#ifdef __UCLIBC__
6.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
6.38 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
6.39 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
6.40 -+# elif defined __UCLIBC_HAS_LOCALE__
6.41 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
6.42 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
6.43 -+# endif
6.44 -+#else
6.45 - union { char *__s; wchar_t __w; } __u;
6.46 - __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
6.47 - _M_data->_M_decimal_point = __u.__w;
6.48 -
6.49 - __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
6.50 - _M_data->_M_thousands_sep = __u.__w;
6.51 -+#endif
6.52 -
6.53 - if (_M_data->_M_thousands_sep == L'\0')
6.54 - _M_data->_M_grouping = "";
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/patches/gcc/4.3.0/350-libmudflap-susv3-legacy.patch Mon Aug 04 12:38:06 2008 +0000
7.3 @@ -0,0 +1,49 @@
7.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
7.5 +diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
7.6 +--- gcc-4.3.0.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
7.7 ++++ gcc-4.3.0/libmudflap/mf-hooks2.c 2008-06-10 14:46:02.000000000 +0200
7.8 +@@ -427,7 +427,7 @@
7.9 + {
7.10 + TRACE ("%s\n", __PRETTY_FUNCTION__);
7.11 + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
7.12 +- bzero (s, n);
7.13 ++ memset (s, 0, n);
7.14 + }
7.15 +
7.16 +
7.17 +@@ -437,7 +437,7 @@
7.18 + TRACE ("%s\n", __PRETTY_FUNCTION__);
7.19 + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
7.20 + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
7.21 +- bcopy (src, dest, n);
7.22 ++ memmove (dest, src, n);
7.23 + }
7.24 +
7.25 +
7.26 +@@ -447,7 +447,7 @@
7.27 + TRACE ("%s\n", __PRETTY_FUNCTION__);
7.28 + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
7.29 + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
7.30 +- return bcmp (s1, s2, n);
7.31 ++ return memcmp (s1, s2, n);
7.32 + }
7.33 +
7.34 +
7.35 +@@ -456,7 +456,7 @@
7.36 + size_t n = strlen (s);
7.37 + TRACE ("%s\n", __PRETTY_FUNCTION__);
7.38 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
7.39 +- return index (s, c);
7.40 ++ return strchr (s, c);
7.41 + }
7.42 +
7.43 +
7.44 +@@ -465,7 +465,7 @@
7.45 + size_t n = strlen (s);
7.46 + TRACE ("%s\n", __PRETTY_FUNCTION__);
7.47 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
7.48 +- return rindex (s, c);
7.49 ++ return strrchr (s, c);
7.50 + }
7.51 +
7.52 + /* XXX: stpcpy, memccpy */
8.1 --- a/patches/gcc/4.3.0/350-uclibc-locale-update.patch Mon Aug 04 12:09:54 2008 +0000
8.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
8.3 @@ -1,355 +0,0 @@
8.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_205-uclibc-locale-update.patch
8.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc
8.6 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:43.000000000 +0200
8.7 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:45:46.000000000 +0200
8.8 -@@ -46,16 +46,13 @@
8.9 - __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
8.10 - const __c_locale& __cloc)
8.11 - {
8.12 -- if (!(__err & ios_base::failbit))
8.13 -- {
8.14 -- char* __sanity;
8.15 -- errno = 0;
8.16 -- float __f = __strtof_l(__s, &__sanity, __cloc);
8.17 -- if (__sanity != __s && errno != ERANGE)
8.18 -- __v = __f;
8.19 -- else
8.20 -- __err |= ios_base::failbit;
8.21 -- }
8.22 -+ char* __sanity;
8.23 -+ errno = 0;
8.24 -+ float __f = __strtof_l(__s, &__sanity, __cloc);
8.25 -+ if (__sanity != __s && errno != ERANGE)
8.26 -+ __v = __f;
8.27 -+ else
8.28 -+ __err |= ios_base::failbit;
8.29 - }
8.30 -
8.31 - template<>
8.32 -@@ -63,16 +60,13 @@
8.33 - __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
8.34 - const __c_locale& __cloc)
8.35 - {
8.36 -- if (!(__err & ios_base::failbit))
8.37 -- {
8.38 -- char* __sanity;
8.39 -- errno = 0;
8.40 -- double __d = __strtod_l(__s, &__sanity, __cloc);
8.41 -- if (__sanity != __s && errno != ERANGE)
8.42 -- __v = __d;
8.43 -- else
8.44 -- __err |= ios_base::failbit;
8.45 -- }
8.46 -+ char* __sanity;
8.47 -+ errno = 0;
8.48 -+ double __d = __strtod_l(__s, &__sanity, __cloc);
8.49 -+ if (__sanity != __s && errno != ERANGE)
8.50 -+ __v = __d;
8.51 -+ else
8.52 -+ __err |= ios_base::failbit;
8.53 - }
8.54 -
8.55 - template<>
8.56 -@@ -80,16 +74,13 @@
8.57 - __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
8.58 - const __c_locale& __cloc)
8.59 - {
8.60 -- if (!(__err & ios_base::failbit))
8.61 -- {
8.62 -- char* __sanity;
8.63 -- errno = 0;
8.64 -- long double __ld = __strtold_l(__s, &__sanity, __cloc);
8.65 -- if (__sanity != __s && errno != ERANGE)
8.66 -- __v = __ld;
8.67 -- else
8.68 -- __err |= ios_base::failbit;
8.69 -- }
8.70 -+ char* __sanity;
8.71 -+ errno = 0;
8.72 -+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
8.73 -+ if (__sanity != __s && errno != ERANGE)
8.74 -+ __v = __ld;
8.75 -+ else
8.76 -+ __err |= ios_base::failbit;
8.77 - }
8.78 -
8.79 - void
8.80 -@@ -110,7 +101,7 @@
8.81 - void
8.82 - locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
8.83 - {
8.84 -- if (_S_get_c_locale() != __cloc)
8.85 -+ if (__cloc && _S_get_c_locale() != __cloc)
8.86 - __freelocale(__cloc);
8.87 - }
8.88 -
8.89 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h
8.90 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:43.000000000 +0200
8.91 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:45:46.000000000 +0200
8.92 -@@ -39,21 +39,23 @@
8.93 - #pragma GCC system_header
8.94 -
8.95 - #include <cstring> // get std::strlen
8.96 --#include <cstdio> // get std::snprintf or std::sprintf
8.97 -+#include <cstdio> // get std::vsnprintf or std::vsprintf
8.98 - #include <clocale>
8.99 - #include <langinfo.h> // For codecvt
8.100 - #ifdef __UCLIBC_MJN3_ONLY__
8.101 - #warning fix this
8.102 - #endif
8.103 --#ifdef __UCLIBC_HAS_LOCALE__
8.104 -+#ifdef _GLIBCXX_USE_ICONV
8.105 - #include <iconv.h> // For codecvt using iconv, iconv_t
8.106 - #endif
8.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
8.108 --#include <libintl.h> // For messages
8.109 -+#ifdef HAVE_LIBINTL_H
8.110 -+#include <libintl.h> // For messages
8.111 - #endif
8.112 -+#include <cstdarg>
8.113 -
8.114 - #ifdef __UCLIBC_MJN3_ONLY__
8.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
8.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
8.117 - #endif
8.118 - #define _GLIBCXX_C_LOCALE_GNU 1
8.119 -
8.120 -@@ -62,7 +64,7 @@
8.121 - #endif
8.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
8.123 - #define _GLIBCXX_NUM_CATEGORIES 0
8.124 --
8.125 -+
8.126 - #ifdef __UCLIBC_HAS_XLOCALE__
8.127 - namespace __gnu_cxx
8.128 - {
8.129 -@@ -79,22 +81,24 @@
8.130 - typedef int* __c_locale;
8.131 - #endif
8.132 -
8.133 -- // Convert numeric value of type _Tv to string and return length of
8.134 -- // string. If snprintf is available use it, otherwise fall back to
8.135 -- // the unsafe sprintf which, in general, can be dangerous and should
8.136 -+ // Convert numeric value of type double to string and return length of
8.137 -+ // string. If vsnprintf is available use it, otherwise fall back to
8.138 -+ // the unsafe vsprintf which, in general, can be dangerous and should
8.139 - // be avoided.
8.140 -- template<typename _Tv>
8.141 -- int
8.142 -- __convert_from_v(char* __out,
8.143 -- const int __size __attribute__ ((__unused__)),
8.144 -- const char* __fmt,
8.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
8.146 -- _Tv __v, const __c_locale& __cloc, int __prec)
8.147 -+ inline int
8.148 -+ __convert_from_v(const __c_locale&
8.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
8.150 -+ __cloc __attribute__ ((__unused__))
8.151 -+#endif
8.152 -+ ,
8.153 -+ char* __out,
8.154 -+ const int __size,
8.155 -+ const char* __fmt, ...)
8.156 - {
8.157 -+ va_list __args;
8.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
8.159 - __c_locale __old = __gnu_cxx::__uselocale(__cloc);
8.160 - #else
8.161 -- _Tv __v, const __c_locale&, int __prec)
8.162 -- {
8.163 - # ifdef __UCLIBC_HAS_LOCALE__
8.164 - char* __old = std::setlocale(LC_ALL, NULL);
8.165 - char* __sav = new char[std::strlen(__old) + 1];
8.166 -@@ -103,7 +107,9 @@
8.167 - # endif
8.168 - #endif
8.169 -
8.170 -- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
8.171 -+ va_start(__args, __fmt);
8.172 -+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
8.173 -+ va_end(__args);
8.174 -
8.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
8.176 - __gnu_cxx::__uselocale(__old);
8.177 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc
8.178 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:43.000000000 +0200
8.179 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:45:46.000000000 +0200
8.180 -@@ -33,9 +33,14 @@
8.181 -
8.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
8.183 -
8.184 -+#include <features.h>
8.185 -+#ifdef __UCLIBC_HAS_LOCALE__
8.186 - #define _LIBC
8.187 - #include <locale>
8.188 - #undef _LIBC
8.189 -+#else
8.190 -+#include <locale>
8.191 -+#endif
8.192 - #include <bits/c++locale_internal.h>
8.193 -
8.194 - namespace std
8.195 -@@ -138,20 +143,34 @@
8.196 - ctype<wchar_t>::
8.197 - do_is(mask __m, wchar_t __c) const
8.198 - {
8.199 -- // Highest bitmask in ctype_base == 10, but extra in "C"
8.200 -- // library for blank.
8.201 -+ // The case of __m == ctype_base::space is particularly important,
8.202 -+ // due to its use in many istream functions. Therefore we deal with
8.203 -+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
8.204 -+ // is the mask corresponding to ctype_base::space. NB: an encoding
8.205 -+ // change would not affect correctness!
8.206 - bool __ret = false;
8.207 -- const size_t __bitmasksize = 11;
8.208 -- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
8.209 -- if (__m & _M_bit[__bitcur]
8.210 -- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
8.211 -- {
8.212 -- __ret = true;
8.213 -- break;
8.214 -- }
8.215 -+ if (__m == _M_bit[5])
8.216 -+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
8.217 -+ else
8.218 -+ {
8.219 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
8.220 -+ // library for blank.
8.221 -+ const size_t __bitmasksize = 11;
8.222 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
8.223 -+ if (__m & _M_bit[__bitcur])
8.224 -+ {
8.225 -+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
8.226 -+ {
8.227 -+ __ret = true;
8.228 -+ break;
8.229 -+ }
8.230 -+ else if (__m == _M_bit[__bitcur])
8.231 -+ break;
8.232 -+ }
8.233 -+ }
8.234 - return __ret;
8.235 - }
8.236 --
8.237 -+
8.238 - const wchar_t*
8.239 - ctype<wchar_t>::
8.240 - do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
8.241 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
8.242 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:43.000000000 +0200
8.243 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:46.000000000 +0200
8.244 -@@ -47,18 +47,21 @@
8.245 - template<typename _CharT>
8.246 - messages<_CharT>::messages(size_t __refs)
8.247 - : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
8.248 -- _M_name_messages(_S_get_c_name())
8.249 -+ _M_name_messages(_S_get_c_name())
8.250 - { }
8.251 -
8.252 - template<typename _CharT>
8.253 - messages<_CharT>::messages(__c_locale __cloc, const char* __s,
8.254 - size_t __refs)
8.255 -- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
8.256 -- _M_name_messages(__s)
8.257 -+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
8.258 - {
8.259 -- char* __tmp = new char[std::strlen(__s) + 1];
8.260 -- std::strcpy(__tmp, __s);
8.261 -+ const size_t __len = std::strlen(__s) + 1;
8.262 -+ char* __tmp = new char[__len];
8.263 -+ std::memcpy(__tmp, __s, __len);
8.264 - _M_name_messages = __tmp;
8.265 -+
8.266 -+ // Last to avoid leaking memory if new throws.
8.267 -+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
8.268 - }
8.269 -
8.270 - template<typename _CharT>
8.271 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc
8.272 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200
8.273 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:45:46.000000000 +0200
8.274 -@@ -33,9 +33,14 @@
8.275 -
8.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
8.277 -
8.278 -+#include <features.h>
8.279 -+#ifdef __UCLIBC_HAS_LOCALE__
8.280 - #define _LIBC
8.281 - #include <locale>
8.282 - #undef _LIBC
8.283 -+#else
8.284 -+#include <locale>
8.285 -+#endif
8.286 - #include <bits/c++locale_internal.h>
8.287 -
8.288 - #ifdef __UCLIBC_MJN3_ONLY__
8.289 -@@ -206,7 +211,7 @@
8.290 - }
8.291 - break;
8.292 - default:
8.293 -- ;
8.294 -+ __ret = pattern();
8.295 - }
8.296 - return __ret;
8.297 - }
8.298 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc
8.299 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200
8.300 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:45:46.000000000 +0200
8.301 -@@ -33,9 +33,14 @@
8.302 -
8.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
8.304 -
8.305 -+#include <features.h>
8.306 -+#ifdef __UCLIBC_HAS_LOCALE__
8.307 - #define _LIBC
8.308 - #include <locale>
8.309 - #undef _LIBC
8.310 -+#else
8.311 -+#include <locale>
8.312 -+#endif
8.313 - #include <bits/c++locale_internal.h>
8.314 -
8.315 - #ifdef __UCLIBC_MJN3_ONLY__
8.316 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
8.317 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:39.000000000 +0200
8.318 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:46.000000000 +0200
8.319 -@@ -37,25 +37,33 @@
8.320 - template<typename _CharT>
8.321 - __timepunct<_CharT>::__timepunct(size_t __refs)
8.322 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
8.323 -- _M_name_timepunct(_S_get_c_name())
8.324 -+ _M_name_timepunct(_S_get_c_name())
8.325 - { _M_initialize_timepunct(); }
8.326 -
8.327 - template<typename _CharT>
8.328 - __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
8.329 - : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
8.330 -- _M_name_timepunct(_S_get_c_name())
8.331 -+ _M_name_timepunct(_S_get_c_name())
8.332 - { _M_initialize_timepunct(); }
8.333 -
8.334 - template<typename _CharT>
8.335 - __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
8.336 - size_t __refs)
8.337 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
8.338 -- _M_name_timepunct(__s)
8.339 -+ _M_name_timepunct(NULL)
8.340 - {
8.341 -- char* __tmp = new char[std::strlen(__s) + 1];
8.342 -- std::strcpy(__tmp, __s);
8.343 -+ const size_t __len = std::strlen(__s) + 1;
8.344 -+ char* __tmp = new char[__len];
8.345 -+ std::memcpy(__tmp, __s, __len);
8.346 - _M_name_timepunct = __tmp;
8.347 -- _M_initialize_timepunct(__cloc);
8.348 -+
8.349 -+ try
8.350 -+ { _M_initialize_timepunct(__cloc); }
8.351 -+ catch(...)
8.352 -+ {
8.353 -+ delete [] _M_name_timepunct;
8.354 -+ __throw_exception_again;
8.355 -+ }
8.356 - }
8.357 -
8.358 - template<typename _CharT>
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/patches/gcc/4.3.0/360-arm-softfloat.patch Mon Aug 04 12:38:06 2008 +0000
9.3 @@ -0,0 +1,29 @@
9.4 +diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
9.5 +--- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
9.6 ++++ gcc-4.3.1/gcc/config/arm/linux-elf.h 2008-07-23 15:30:57.000000000 +0200
9.7 +@@ -60,7 +60,7 @@
9.8 + %{shared:-lc} \
9.9 + %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
9.10 +
9.11 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
9.12 ++#define LIBGCC_SPEC "-lgcc"
9.13 +
9.14 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
9.15 +
9.16 +diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
9.17 +--- gcc-4.3.1.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
9.18 ++++ gcc-4.3.1/gcc/config/arm/t-linux 2008-07-23 19:15:25.000000000 +0200
9.19 +@@ -3,7 +3,12 @@
9.20 + TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
9.21 +
9.22 + LIB1ASMSRC = arm/lib1funcs.asm
9.23 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
9.24 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
9.25 ++ _call_via_rX _interwork_call_via_rX \
9.26 ++ _lshrdi3 _ashrdi3 _ashldi3 \
9.27 ++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
9.28 ++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
9.29 ++ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
9.30 +
9.31 + # MULTILIB_OPTIONS = mhard-float/msoft-float
9.32 + # MULTILIB_DIRNAMES = hard-float soft-float
10.1 --- a/patches/gcc/4.3.0/360-missing-execinfo_h.patch Mon Aug 04 12:09:54 2008 +0000
10.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
10.3 @@ -1,13 +0,0 @@
10.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_301-missing-execinfo_h.patch
10.5 -diff -durN gcc-4.3.0.orig/boehm-gc/include/gc.h gcc-4.3.0/boehm-gc/include/gc.h
10.6 ---- gcc-4.3.0.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
10.7 -+++ gcc-4.3.0/boehm-gc/include/gc.h 2008-06-10 14:45:50.000000000 +0200
10.8 -@@ -503,7 +503,7 @@
10.9 - #if defined(__linux__) || defined(__GLIBC__)
10.10 - # include <features.h>
10.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
10.12 -- && !defined(__ia64__)
10.13 -+ && !defined(__ia64__) && !defined(__UCLIBC__)
10.14 - # ifndef GC_HAVE_BUILTIN_BACKTRACE
10.15 - # define GC_HAVE_BUILTIN_BACKTRACE
10.16 - # endif
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/patches/gcc/4.3.0/370-alpha-signal_h.patch Mon Aug 04 12:38:06 2008 +0000
11.3 @@ -0,0 +1,17 @@
11.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500
11.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500
11.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */
11.7 + /* Do code reading to identify a signal frame, and set the frame
11.8 + state data appropriately. See unwind-dw2.c for the structs. */
11.9 +
11.10 ++/* Don't use this if inhibit_libc is set
11.11 ++ The build for this target will fail trying to include missing headers */
11.12 ++#ifndef inhibit_libc
11.13 + #include <signal.h>
11.14 + #include <sys/ucontext.h>
11.15 +
11.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
11.17 + fs->retaddr_column = 64;
11.18 + return _URC_NO_REASON;
11.19 + }
11.20 ++#endif /* inhibit_libc */
12.1 --- a/patches/gcc/4.3.0/370-c99-complex-ugly-hack.patch Mon Aug 04 12:09:54 2008 +0000
12.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
12.3 @@ -1,14 +0,0 @@
12.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_303-c99-complex-ugly-hack.patch
12.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/configure gcc-4.3.0/libstdc++-v3/configure
12.6 ---- gcc-4.3.0.orig/libstdc++-v3/configure 2008-06-10 14:45:39.000000000 +0200
12.7 -+++ gcc-4.3.0/libstdc++-v3/configure 2008-06-10 14:45:54.000000000 +0200
12.8 -@@ -39006,6 +39006,9 @@
12.9 - cat >>conftest.$ac_ext <<_ACEOF
12.10 - /* end confdefs.h. */
12.11 - #include <complex.h>
12.12 -+#ifdef __UCLIBC__
12.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
12.14 -+#endif
12.15 - int
12.16 - main ()
12.17 - {
13.1 --- a/patches/gcc/4.3.0/380-index_macro.patch Mon Aug 04 12:09:54 2008 +0000
13.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
13.3 @@ -1,27 +0,0 @@
13.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_304-index_macro.patch
13.5 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/rope gcc-4.3.0/libstdc++-v3/include/ext/rope
13.6 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
13.7 -+++ gcc-4.3.0/libstdc++-v3/include/ext/rope 2008-06-10 14:45:58.000000000 +0200
13.8 -@@ -59,6 +59,9 @@
13.9 - #include <bits/gthr.h>
13.10 - #include <tr1/functional>
13.11 -
13.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
13.13 -+#undef index
13.14 -+
13.15 - # ifdef __GC
13.16 - # define __GC_CONST const
13.17 - # else
13.18 -diff -durN gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h
13.19 ---- gcc-4.3.0.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
13.20 -+++ gcc-4.3.0/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:45:58.000000000 +0200
13.21 -@@ -54,6 +54,9 @@
13.22 - #include <ext/memory> // For uninitialized_copy_n
13.23 - #include <ext/numeric> // For power
13.24 -
13.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
13.26 -+#undef index
13.27 -+
13.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
13.29 -
13.30 - using std::size_t;
14.1 --- a/patches/gcc/4.3.0/390-libmudflap-susv3-legacy.patch Mon Aug 04 12:09:54 2008 +0000
14.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
14.3 @@ -1,49 +0,0 @@
14.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_305-libmudflap-susv3-legacy.patch
14.5 -diff -durN gcc-4.3.0.orig/libmudflap/mf-hooks2.c gcc-4.3.0/libmudflap/mf-hooks2.c
14.6 ---- gcc-4.3.0.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
14.7 -+++ gcc-4.3.0/libmudflap/mf-hooks2.c 2008-06-10 14:46:02.000000000 +0200
14.8 -@@ -427,7 +427,7 @@
14.9 - {
14.10 - TRACE ("%s\n", __PRETTY_FUNCTION__);
14.11 - MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
14.12 -- bzero (s, n);
14.13 -+ memset (s, 0, n);
14.14 - }
14.15 -
14.16 -
14.17 -@@ -437,7 +437,7 @@
14.18 - TRACE ("%s\n", __PRETTY_FUNCTION__);
14.19 - MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
14.20 - MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
14.21 -- bcopy (src, dest, n);
14.22 -+ memmove (dest, src, n);
14.23 - }
14.24 -
14.25 -
14.26 -@@ -447,7 +447,7 @@
14.27 - TRACE ("%s\n", __PRETTY_FUNCTION__);
14.28 - MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
14.29 - MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
14.30 -- return bcmp (s1, s2, n);
14.31 -+ return memcmp (s1, s2, n);
14.32 - }
14.33 -
14.34 -
14.35 -@@ -456,7 +456,7 @@
14.36 - size_t n = strlen (s);
14.37 - TRACE ("%s\n", __PRETTY_FUNCTION__);
14.38 - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
14.39 -- return index (s, c);
14.40 -+ return strchr (s, c);
14.41 - }
14.42 -
14.43 -
14.44 -@@ -465,7 +465,7 @@
14.45 - size_t n = strlen (s);
14.46 - TRACE ("%s\n", __PRETTY_FUNCTION__);
14.47 - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
14.48 -- return rindex (s, c);
14.49 -+ return strrchr (s, c);
14.50 - }
14.51 -
14.52 - /* XXX: stpcpy, memccpy */
15.1 --- a/patches/gcc/4.3.0/400-libstdc++-namespace.patch Mon Aug 04 12:09:54 2008 +0000
15.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
15.3 @@ -1,38 +0,0 @@
15.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.0/uclibc/90_all_306-libstdc++-namespace.patch
15.5 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
15.6 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h
15.7 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:45:50.000000000 +0200
15.8 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:46:05.000000000 +0200
15.9 -@@ -32,7 +32,8 @@
15.10 - //
15.11 -
15.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
15.13 --
15.14 -+namespace std
15.15 -+{
15.16 - #ifdef __UCLIBC_MJN3_ONLY__
15.17 - #warning fix prototypes for *textdomain funcs
15.18 - #endif
15.19 -@@ -115,3 +116,4 @@
15.20 - this->_S_create_c_locale(this->_M_c_locale_messages, __s);
15.21 - }
15.22 - }
15.23 -+}
15.24 -diff -durN gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h
15.25 ---- gcc-4.3.0.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:45:50.000000000 +0200
15.26 -+++ gcc-4.3.0/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:46:05.000000000 +0200
15.27 -@@ -33,7 +33,8 @@
15.28 - //
15.29 -
15.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
15.31 --
15.32 -+namespace std
15.33 -+{
15.34 - template<typename _CharT>
15.35 - __timepunct<_CharT>::__timepunct(size_t __refs)
15.36 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
15.37 -@@ -74,3 +75,4 @@
15.38 - delete _M_data;
15.39 - _S_destroy_c_locale(_M_c_locale_timepunct);
15.40 - }
15.41 -+}
16.1 --- a/patches/gcc/4.3.0/410-arm-softfloat.patch Mon Aug 04 12:09:54 2008 +0000
16.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
16.3 @@ -1,29 +0,0 @@
16.4 -diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
16.5 ---- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
16.6 -+++ gcc-4.3.1/gcc/config/arm/linux-elf.h 2008-07-23 15:30:57.000000000 +0200
16.7 -@@ -60,7 +60,7 @@
16.8 - %{shared:-lc} \
16.9 - %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
16.10 -
16.11 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
16.12 -+#define LIBGCC_SPEC "-lgcc"
16.13 -
16.14 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
16.15 -
16.16 -diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
16.17 ---- gcc-4.3.1.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
16.18 -+++ gcc-4.3.1/gcc/config/arm/t-linux 2008-07-23 19:15:25.000000000 +0200
16.19 -@@ -3,7 +3,12 @@
16.20 - TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
16.21 -
16.22 - LIB1ASMSRC = arm/lib1funcs.asm
16.23 --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
16.24 -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
16.25 -+ _call_via_rX _interwork_call_via_rX \
16.26 -+ _lshrdi3 _ashrdi3 _ashldi3 \
16.27 -+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
16.28 -+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
16.29 -+ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
16.30 -
16.31 - # MULTILIB_OPTIONS = mhard-float/msoft-float
16.32 - # MULTILIB_DIRNAMES = hard-float soft-float
17.1 --- a/patches/gcc/4.3.0/420-alpha-signal_h.patch Mon Aug 04 12:09:54 2008 +0000
17.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
17.3 @@ -1,17 +0,0 @@
17.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500
17.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500
17.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */
17.7 - /* Do code reading to identify a signal frame, and set the frame
17.8 - state data appropriately. See unwind-dw2.c for the structs. */
17.9 -
17.10 -+/* Don't use this if inhibit_libc is set
17.11 -+ The build for this target will fail trying to include missing headers */
17.12 -+#ifndef inhibit_libc
17.13 - #include <signal.h>
17.14 - #include <sys/ucontext.h>
17.15 -
17.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
17.17 - fs->retaddr_column = 64;
17.18 - return _URC_NO_REASON;
17.19 - }
17.20 -+#endif /* inhibit_libc */
18.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
18.2 +++ b/patches/gcc/4.3.1/270-missing-execinfo_h.patch Mon Aug 04 12:38:06 2008 +0000
18.3 @@ -0,0 +1,13 @@
18.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
18.5 +diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
18.6 +--- gcc-4.3.1.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
18.7 ++++ gcc-4.3.1/boehm-gc/include/gc.h 2008-06-10 14:58:54.000000000 +0200
18.8 +@@ -503,7 +503,7 @@
18.9 + #if defined(__linux__) || defined(__GLIBC__)
18.10 + # include <features.h>
18.11 + # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
18.12 +- && !defined(__ia64__)
18.13 ++ && !defined(__ia64__) && !defined(__UCLIBC__)
18.14 + # ifndef GC_HAVE_BUILTIN_BACKTRACE
18.15 + # define GC_HAVE_BUILTIN_BACKTRACE
18.16 + # endif
19.1 --- a/patches/gcc/4.3.1/270-uclibc-locale.patch Mon Aug 04 12:09:54 2008 +0000
19.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
19.3 @@ -1,2794 +0,0 @@
19.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_200-uclibc-locale.patch
19.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 gcc-4.3.1/libstdc++-v3/acinclude.m4
19.6 ---- gcc-4.3.1.orig/libstdc++-v3/acinclude.m4 2008-04-25 18:52:57.000000000 +0200
19.7 -+++ gcc-4.3.1/libstdc++-v3/acinclude.m4 2008-06-10 14:58:39.000000000 +0200
19.8 -@@ -1349,7 +1349,7 @@
19.9 - AC_DEFUN([GLIBCXX_ENABLE_CLOCALE], [
19.10 - GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@],
19.11 - [use MODEL for target locale package],
19.12 -- [permit generic|gnu|ieee_1003.1-2001|yes|no|auto])
19.13 -+ [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto])
19.14 -
19.15 - # Deal with gettext issues. Default to not using it (=no) until we detect
19.16 - # support for it later. Let the user turn it off via --e/d, but let that
19.17 -@@ -1370,6 +1370,9 @@
19.18 - # Default to "generic".
19.19 - if test $enable_clocale_flag = auto; then
19.20 - case ${target_os} in
19.21 -+ *-uclibc*)
19.22 -+ enable_clocale_flag=uclibc
19.23 -+ ;;
19.24 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
19.25 - enable_clocale_flag=gnu
19.26 - ;;
19.27 -@@ -1541,6 +1544,40 @@
19.28 - CTIME_CC=config/locale/generic/time_members.cc
19.29 - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
19.30 - ;;
19.31 -+ uclibc)
19.32 -+ AC_MSG_RESULT(uclibc)
19.33 -+
19.34 -+ # Declare intention to use gettext, and add support for specific
19.35 -+ # languages.
19.36 -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
19.37 -+ ALL_LINGUAS="de fr"
19.38 -+
19.39 -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
19.40 -+ AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no)
19.41 -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
19.42 -+ USE_NLS=yes
19.43 -+ fi
19.44 -+ # Export the build objects.
19.45 -+ for ling in $ALL_LINGUAS; do \
19.46 -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
19.47 -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
19.48 -+ done
19.49 -+ AC_SUBST(glibcxx_MOFILES)
19.50 -+ AC_SUBST(glibcxx_POFILES)
19.51 -+
19.52 -+ CLOCALE_H=config/locale/uclibc/c_locale.h
19.53 -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
19.54 -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
19.55 -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
19.56 -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
19.57 -+ CMESSAGES_H=config/locale/uclibc/messages_members.h
19.58 -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
19.59 -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
19.60 -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
19.61 -+ CTIME_H=config/locale/uclibc/time_members.h
19.62 -+ CTIME_CC=config/locale/uclibc/time_members.cc
19.63 -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
19.64 -+ ;;
19.65 - esac
19.66 -
19.67 - # This is where the testsuite looks for locale catalogs, using the
19.68 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
19.69 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1970-01-01 01:00:00.000000000 +0100
19.70 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:39.000000000 +0200
19.71 -@@ -0,0 +1,63 @@
19.72 -+// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*-
19.73 -+
19.74 -+// Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
19.75 -+//
19.76 -+// This file is part of the GNU ISO C++ Library. This library is free
19.77 -+// software; you can redistribute it and/or modify it under the
19.78 -+// terms of the GNU General Public License as published by the
19.79 -+// Free Software Foundation; either version 2, or (at your option)
19.80 -+// any later version.
19.81 -+
19.82 -+// This library is distributed in the hope that it will be useful,
19.83 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.84 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.85 -+// GNU General Public License for more details.
19.86 -+
19.87 -+// You should have received a copy of the GNU General Public License along
19.88 -+// with this library; see the file COPYING. If not, write to the Free
19.89 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.90 -+// USA.
19.91 -+
19.92 -+// As a special exception, you may use this file as part of a free software
19.93 -+// library without restriction. Specifically, if other files instantiate
19.94 -+// templates or use macros or inline functions from this file, or you compile
19.95 -+// this file and link it with other files to produce an executable, this
19.96 -+// file does not by itself cause the resulting executable to be covered by
19.97 -+// the GNU General Public License. This exception does not however
19.98 -+// invalidate any other reasons why the executable file might be covered by
19.99 -+// the GNU General Public License.
19.100 -+
19.101 -+// Written by Jakub Jelinek <jakub@redhat.com>
19.102 -+
19.103 -+#include <bits/c++config.h>
19.104 -+#include <clocale>
19.105 -+
19.106 -+#ifdef __UCLIBC_MJN3_ONLY__
19.107 -+#warning clean this up
19.108 -+#endif
19.109 -+
19.110 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.111 -+
19.112 -+extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l;
19.113 -+extern "C" __typeof(strcoll_l) __strcoll_l;
19.114 -+extern "C" __typeof(strftime_l) __strftime_l;
19.115 -+extern "C" __typeof(strtod_l) __strtod_l;
19.116 -+extern "C" __typeof(strtof_l) __strtof_l;
19.117 -+extern "C" __typeof(strtold_l) __strtold_l;
19.118 -+extern "C" __typeof(strxfrm_l) __strxfrm_l;
19.119 -+extern "C" __typeof(newlocale) __newlocale;
19.120 -+extern "C" __typeof(freelocale) __freelocale;
19.121 -+extern "C" __typeof(duplocale) __duplocale;
19.122 -+extern "C" __typeof(uselocale) __uselocale;
19.123 -+
19.124 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.125 -+extern "C" __typeof(iswctype_l) __iswctype_l;
19.126 -+extern "C" __typeof(towlower_l) __towlower_l;
19.127 -+extern "C" __typeof(towupper_l) __towupper_l;
19.128 -+extern "C" __typeof(wcscoll_l) __wcscoll_l;
19.129 -+extern "C" __typeof(wcsftime_l) __wcsftime_l;
19.130 -+extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l;
19.131 -+extern "C" __typeof(wctype_l) __wctype_l;
19.132 -+#endif
19.133 -+
19.134 -+#endif // GLIBC 2.3 and later
19.135 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
19.136 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 1970-01-01 01:00:00.000000000 +0100
19.137 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:39.000000000 +0200
19.138 -@@ -0,0 +1,160 @@
19.139 -+// Wrapper for underlying C-language localization -*- C++ -*-
19.140 -+
19.141 -+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
19.142 -+//
19.143 -+// This file is part of the GNU ISO C++ Library. This library is free
19.144 -+// software; you can redistribute it and/or modify it under the
19.145 -+// terms of the GNU General Public License as published by the
19.146 -+// Free Software Foundation; either version 2, or (at your option)
19.147 -+// any later version.
19.148 -+
19.149 -+// This library is distributed in the hope that it will be useful,
19.150 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.151 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.152 -+// GNU General Public License for more details.
19.153 -+
19.154 -+// You should have received a copy of the GNU General Public License along
19.155 -+// with this library; see the file COPYING. If not, write to the Free
19.156 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.157 -+// USA.
19.158 -+
19.159 -+// As a special exception, you may use this file as part of a free software
19.160 -+// library without restriction. Specifically, if other files instantiate
19.161 -+// templates or use macros or inline functions from this file, or you compile
19.162 -+// this file and link it with other files to produce an executable, this
19.163 -+// file does not by itself cause the resulting executable to be covered by
19.164 -+// the GNU General Public License. This exception does not however
19.165 -+// invalidate any other reasons why the executable file might be covered by
19.166 -+// the GNU General Public License.
19.167 -+
19.168 -+//
19.169 -+// ISO C++ 14882: 22.8 Standard locale categories.
19.170 -+//
19.171 -+
19.172 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.173 -+
19.174 -+#include <cerrno> // For errno
19.175 -+#include <locale>
19.176 -+#include <stdexcept>
19.177 -+#include <langinfo.h>
19.178 -+#include <bits/c++locale_internal.h>
19.179 -+
19.180 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.181 -+#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
19.182 -+#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
19.183 -+#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
19.184 -+#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
19.185 -+#define __strtof_l(S, E, L) strtof((S), (E))
19.186 -+#define __strtod_l(S, E, L) strtod((S), (E))
19.187 -+#define __strtold_l(S, E, L) strtold((S), (E))
19.188 -+#warning should dummy __newlocale check for C|POSIX ?
19.189 -+#define __newlocale(a, b, c) NULL
19.190 -+#define __freelocale(a) ((void)0)
19.191 -+#define __duplocale(a) __c_locale()
19.192 -+#endif
19.193 -+
19.194 -+namespace std
19.195 -+{
19.196 -+ template<>
19.197 -+ void
19.198 -+ __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
19.199 -+ const __c_locale& __cloc)
19.200 -+ {
19.201 -+ if (!(__err & ios_base::failbit))
19.202 -+ {
19.203 -+ char* __sanity;
19.204 -+ errno = 0;
19.205 -+ float __f = __strtof_l(__s, &__sanity, __cloc);
19.206 -+ if (__sanity != __s && errno != ERANGE)
19.207 -+ __v = __f;
19.208 -+ else
19.209 -+ __err |= ios_base::failbit;
19.210 -+ }
19.211 -+ }
19.212 -+
19.213 -+ template<>
19.214 -+ void
19.215 -+ __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
19.216 -+ const __c_locale& __cloc)
19.217 -+ {
19.218 -+ if (!(__err & ios_base::failbit))
19.219 -+ {
19.220 -+ char* __sanity;
19.221 -+ errno = 0;
19.222 -+ double __d = __strtod_l(__s, &__sanity, __cloc);
19.223 -+ if (__sanity != __s && errno != ERANGE)
19.224 -+ __v = __d;
19.225 -+ else
19.226 -+ __err |= ios_base::failbit;
19.227 -+ }
19.228 -+ }
19.229 -+
19.230 -+ template<>
19.231 -+ void
19.232 -+ __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
19.233 -+ const __c_locale& __cloc)
19.234 -+ {
19.235 -+ if (!(__err & ios_base::failbit))
19.236 -+ {
19.237 -+ char* __sanity;
19.238 -+ errno = 0;
19.239 -+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
19.240 -+ if (__sanity != __s && errno != ERANGE)
19.241 -+ __v = __ld;
19.242 -+ else
19.243 -+ __err |= ios_base::failbit;
19.244 -+ }
19.245 -+ }
19.246 -+
19.247 -+ void
19.248 -+ locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s,
19.249 -+ __c_locale __old)
19.250 -+ {
19.251 -+ __cloc = __newlocale(1 << LC_ALL, __s, __old);
19.252 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.253 -+ if (!__cloc)
19.254 -+ {
19.255 -+ // This named locale is not supported by the underlying OS.
19.256 -+ __throw_runtime_error(__N("locale::facet::_S_create_c_locale "
19.257 -+ "name not valid"));
19.258 -+ }
19.259 -+#endif
19.260 -+ }
19.261 -+
19.262 -+ void
19.263 -+ locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
19.264 -+ {
19.265 -+ if (_S_get_c_locale() != __cloc)
19.266 -+ __freelocale(__cloc);
19.267 -+ }
19.268 -+
19.269 -+ __c_locale
19.270 -+ locale::facet::_S_clone_c_locale(__c_locale& __cloc)
19.271 -+ { return __duplocale(__cloc); }
19.272 -+} // namespace std
19.273 -+
19.274 -+namespace __gnu_cxx
19.275 -+{
19.276 -+ const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] =
19.277 -+ {
19.278 -+ "LC_CTYPE",
19.279 -+ "LC_NUMERIC",
19.280 -+ "LC_TIME",
19.281 -+ "LC_COLLATE",
19.282 -+ "LC_MONETARY",
19.283 -+ "LC_MESSAGES",
19.284 -+#if _GLIBCXX_NUM_CATEGORIES != 0
19.285 -+ "LC_PAPER",
19.286 -+ "LC_NAME",
19.287 -+ "LC_ADDRESS",
19.288 -+ "LC_TELEPHONE",
19.289 -+ "LC_MEASUREMENT",
19.290 -+ "LC_IDENTIFICATION"
19.291 -+#endif
19.292 -+ };
19.293 -+}
19.294 -+
19.295 -+namespace std
19.296 -+{
19.297 -+ const char* const* const locale::_S_categories = __gnu_cxx::category_names;
19.298 -+} // namespace std
19.299 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
19.300 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 1970-01-01 01:00:00.000000000 +0100
19.301 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:39.000000000 +0200
19.302 -@@ -0,0 +1,117 @@
19.303 -+// Wrapper for underlying C-language localization -*- C++ -*-
19.304 -+
19.305 -+// Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
19.306 -+//
19.307 -+// This file is part of the GNU ISO C++ Library. This library is free
19.308 -+// software; you can redistribute it and/or modify it under the
19.309 -+// terms of the GNU General Public License as published by the
19.310 -+// Free Software Foundation; either version 2, or (at your option)
19.311 -+// any later version.
19.312 -+
19.313 -+// This library is distributed in the hope that it will be useful,
19.314 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.315 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.316 -+// GNU General Public License for more details.
19.317 -+
19.318 -+// You should have received a copy of the GNU General Public License along
19.319 -+// with this library; see the file COPYING. If not, write to the Free
19.320 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.321 -+// USA.
19.322 -+
19.323 -+// As a special exception, you may use this file as part of a free software
19.324 -+// library without restriction. Specifically, if other files instantiate
19.325 -+// templates or use macros or inline functions from this file, or you compile
19.326 -+// this file and link it with other files to produce an executable, this
19.327 -+// file does not by itself cause the resulting executable to be covered by
19.328 -+// the GNU General Public License. This exception does not however
19.329 -+// invalidate any other reasons why the executable file might be covered by
19.330 -+// the GNU General Public License.
19.331 -+
19.332 -+//
19.333 -+// ISO C++ 14882: 22.8 Standard locale categories.
19.334 -+//
19.335 -+
19.336 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.337 -+
19.338 -+#ifndef _C_LOCALE_H
19.339 -+#define _C_LOCALE_H 1
19.340 -+
19.341 -+#pragma GCC system_header
19.342 -+
19.343 -+#include <cstring> // get std::strlen
19.344 -+#include <cstdio> // get std::snprintf or std::sprintf
19.345 -+#include <clocale>
19.346 -+#include <langinfo.h> // For codecvt
19.347 -+#ifdef __UCLIBC_MJN3_ONLY__
19.348 -+#warning fix this
19.349 -+#endif
19.350 -+#ifdef __UCLIBC_HAS_LOCALE__
19.351 -+#include <iconv.h> // For codecvt using iconv, iconv_t
19.352 -+#endif
19.353 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
19.354 -+#include <libintl.h> // For messages
19.355 -+#endif
19.356 -+
19.357 -+#ifdef __UCLIBC_MJN3_ONLY__
19.358 -+#warning what is _GLIBCXX_C_LOCALE_GNU for
19.359 -+#endif
19.360 -+#define _GLIBCXX_C_LOCALE_GNU 1
19.361 -+
19.362 -+#ifdef __UCLIBC_MJN3_ONLY__
19.363 -+#warning fix categories
19.364 -+#endif
19.365 -+// #define _GLIBCXX_NUM_CATEGORIES 6
19.366 -+#define _GLIBCXX_NUM_CATEGORIES 0
19.367 -+
19.368 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.369 -+namespace __gnu_cxx
19.370 -+{
19.371 -+ extern "C" __typeof(uselocale) __uselocale;
19.372 -+}
19.373 -+#endif
19.374 -+
19.375 -+namespace std
19.376 -+{
19.377 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.378 -+ typedef __locale_t __c_locale;
19.379 -+#else
19.380 -+ typedef int* __c_locale;
19.381 -+#endif
19.382 -+
19.383 -+ // Convert numeric value of type _Tv to string and return length of
19.384 -+ // string. If snprintf is available use it, otherwise fall back to
19.385 -+ // the unsafe sprintf which, in general, can be dangerous and should
19.386 -+ // be avoided.
19.387 -+ template<typename _Tv>
19.388 -+ int
19.389 -+ __convert_from_v(char* __out,
19.390 -+ const int __size __attribute__ ((__unused__)),
19.391 -+ const char* __fmt,
19.392 -+#ifdef __UCLIBC_HAS_XCLOCALE__
19.393 -+ _Tv __v, const __c_locale& __cloc, int __prec)
19.394 -+ {
19.395 -+ __c_locale __old = __gnu_cxx::__uselocale(__cloc);
19.396 -+#else
19.397 -+ _Tv __v, const __c_locale&, int __prec)
19.398 -+ {
19.399 -+# ifdef __UCLIBC_HAS_LOCALE__
19.400 -+ char* __old = std::setlocale(LC_ALL, NULL);
19.401 -+ char* __sav = new char[std::strlen(__old) + 1];
19.402 -+ std::strcpy(__sav, __old);
19.403 -+ std::setlocale(LC_ALL, "C");
19.404 -+# endif
19.405 -+#endif
19.406 -+
19.407 -+ const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
19.408 -+
19.409 -+#ifdef __UCLIBC_HAS_XCLOCALE__
19.410 -+ __gnu_cxx::__uselocale(__old);
19.411 -+#elif defined __UCLIBC_HAS_LOCALE__
19.412 -+ std::setlocale(LC_ALL, __sav);
19.413 -+ delete [] __sav;
19.414 -+#endif
19.415 -+ return __ret;
19.416 -+ }
19.417 -+}
19.418 -+
19.419 -+#endif
19.420 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc
19.421 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1970-01-01 01:00:00.000000000 +0100
19.422 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2008-06-10 14:58:39.000000000 +0200
19.423 -@@ -0,0 +1,306 @@
19.424 -+// std::codecvt implementation details, GNU version -*- C++ -*-
19.425 -+
19.426 -+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
19.427 -+//
19.428 -+// This file is part of the GNU ISO C++ Library. This library is free
19.429 -+// software; you can redistribute it and/or modify it under the
19.430 -+// terms of the GNU General Public License as published by the
19.431 -+// Free Software Foundation; either version 2, or (at your option)
19.432 -+// any later version.
19.433 -+
19.434 -+// This library is distributed in the hope that it will be useful,
19.435 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.436 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.437 -+// GNU General Public License for more details.
19.438 -+
19.439 -+// You should have received a copy of the GNU General Public License along
19.440 -+// with this library; see the file COPYING. If not, write to the Free
19.441 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.442 -+// USA.
19.443 -+
19.444 -+// As a special exception, you may use this file as part of a free software
19.445 -+// library without restriction. Specifically, if other files instantiate
19.446 -+// templates or use macros or inline functions from this file, or you compile
19.447 -+// this file and link it with other files to produce an executable, this
19.448 -+// file does not by itself cause the resulting executable to be covered by
19.449 -+// the GNU General Public License. This exception does not however
19.450 -+// invalidate any other reasons why the executable file might be covered by
19.451 -+// the GNU General Public License.
19.452 -+
19.453 -+//
19.454 -+// ISO C++ 14882: 22.2.1.5 - Template class codecvt
19.455 -+//
19.456 -+
19.457 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.458 -+
19.459 -+#include <locale>
19.460 -+#include <bits/c++locale_internal.h>
19.461 -+
19.462 -+namespace std
19.463 -+{
19.464 -+ // Specializations.
19.465 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.466 -+ codecvt_base::result
19.467 -+ codecvt<wchar_t, char, mbstate_t>::
19.468 -+ do_out(state_type& __state, const intern_type* __from,
19.469 -+ const intern_type* __from_end, const intern_type*& __from_next,
19.470 -+ extern_type* __to, extern_type* __to_end,
19.471 -+ extern_type*& __to_next) const
19.472 -+ {
19.473 -+ result __ret = ok;
19.474 -+ state_type __tmp_state(__state);
19.475 -+
19.476 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.477 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
19.478 -+#endif
19.479 -+
19.480 -+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
19.481 -+ // in case we fall back to wcrtomb and then continue, in a loop.
19.482 -+ // NB: wcsnrtombs is a GNU extension
19.483 -+ for (__from_next = __from, __to_next = __to;
19.484 -+ __from_next < __from_end && __to_next < __to_end
19.485 -+ && __ret == ok;)
19.486 -+ {
19.487 -+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
19.488 -+ __from_end - __from_next);
19.489 -+ if (!__from_chunk_end)
19.490 -+ __from_chunk_end = __from_end;
19.491 -+
19.492 -+ __from = __from_next;
19.493 -+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
19.494 -+ __from_chunk_end - __from_next,
19.495 -+ __to_end - __to_next, &__state);
19.496 -+ if (__conv == static_cast<size_t>(-1))
19.497 -+ {
19.498 -+ // In case of error, in order to stop at the exact place we
19.499 -+ // have to start again from the beginning with a series of
19.500 -+ // wcrtomb.
19.501 -+ for (; __from < __from_next; ++__from)
19.502 -+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
19.503 -+ __state = __tmp_state;
19.504 -+ __ret = error;
19.505 -+ }
19.506 -+ else if (__from_next && __from_next < __from_chunk_end)
19.507 -+ {
19.508 -+ __to_next += __conv;
19.509 -+ __ret = partial;
19.510 -+ }
19.511 -+ else
19.512 -+ {
19.513 -+ __from_next = __from_chunk_end;
19.514 -+ __to_next += __conv;
19.515 -+ }
19.516 -+
19.517 -+ if (__from_next < __from_end && __ret == ok)
19.518 -+ {
19.519 -+ extern_type __buf[MB_LEN_MAX];
19.520 -+ __tmp_state = __state;
19.521 -+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
19.522 -+ if (__conv > static_cast<size_t>(__to_end - __to_next))
19.523 -+ __ret = partial;
19.524 -+ else
19.525 -+ {
19.526 -+ memcpy(__to_next, __buf, __conv);
19.527 -+ __state = __tmp_state;
19.528 -+ __to_next += __conv;
19.529 -+ ++__from_next;
19.530 -+ }
19.531 -+ }
19.532 -+ }
19.533 -+
19.534 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.535 -+ __uselocale(__old);
19.536 -+#endif
19.537 -+
19.538 -+ return __ret;
19.539 -+ }
19.540 -+
19.541 -+ codecvt_base::result
19.542 -+ codecvt<wchar_t, char, mbstate_t>::
19.543 -+ do_in(state_type& __state, const extern_type* __from,
19.544 -+ const extern_type* __from_end, const extern_type*& __from_next,
19.545 -+ intern_type* __to, intern_type* __to_end,
19.546 -+ intern_type*& __to_next) const
19.547 -+ {
19.548 -+ result __ret = ok;
19.549 -+ state_type __tmp_state(__state);
19.550 -+
19.551 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.552 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
19.553 -+#endif
19.554 -+
19.555 -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
19.556 -+ // in case we store a L'\0' and then continue, in a loop.
19.557 -+ // NB: mbsnrtowcs is a GNU extension
19.558 -+ for (__from_next = __from, __to_next = __to;
19.559 -+ __from_next < __from_end && __to_next < __to_end
19.560 -+ && __ret == ok;)
19.561 -+ {
19.562 -+ const extern_type* __from_chunk_end;
19.563 -+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
19.564 -+ __from_end
19.565 -+ - __from_next));
19.566 -+ if (!__from_chunk_end)
19.567 -+ __from_chunk_end = __from_end;
19.568 -+
19.569 -+ __from = __from_next;
19.570 -+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
19.571 -+ __from_chunk_end - __from_next,
19.572 -+ __to_end - __to_next, &__state);
19.573 -+ if (__conv == static_cast<size_t>(-1))
19.574 -+ {
19.575 -+ // In case of error, in order to stop at the exact place we
19.576 -+ // have to start again from the beginning with a series of
19.577 -+ // mbrtowc.
19.578 -+ for (;; ++__to_next, __from += __conv)
19.579 -+ {
19.580 -+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
19.581 -+ &__tmp_state);
19.582 -+ if (__conv == static_cast<size_t>(-1)
19.583 -+ || __conv == static_cast<size_t>(-2))
19.584 -+ break;
19.585 -+ }
19.586 -+ __from_next = __from;
19.587 -+ __state = __tmp_state;
19.588 -+ __ret = error;
19.589 -+ }
19.590 -+ else if (__from_next && __from_next < __from_chunk_end)
19.591 -+ {
19.592 -+ // It is unclear what to return in this case (see DR 382).
19.593 -+ __to_next += __conv;
19.594 -+ __ret = partial;
19.595 -+ }
19.596 -+ else
19.597 -+ {
19.598 -+ __from_next = __from_chunk_end;
19.599 -+ __to_next += __conv;
19.600 -+ }
19.601 -+
19.602 -+ if (__from_next < __from_end && __ret == ok)
19.603 -+ {
19.604 -+ if (__to_next < __to_end)
19.605 -+ {
19.606 -+ // XXX Probably wrong for stateful encodings
19.607 -+ __tmp_state = __state;
19.608 -+ ++__from_next;
19.609 -+ *__to_next++ = L'\0';
19.610 -+ }
19.611 -+ else
19.612 -+ __ret = partial;
19.613 -+ }
19.614 -+ }
19.615 -+
19.616 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.617 -+ __uselocale(__old);
19.618 -+#endif
19.619 -+
19.620 -+ return __ret;
19.621 -+ }
19.622 -+
19.623 -+ int
19.624 -+ codecvt<wchar_t, char, mbstate_t>::
19.625 -+ do_encoding() const throw()
19.626 -+ {
19.627 -+ // XXX This implementation assumes that the encoding is
19.628 -+ // stateless and is either single-byte or variable-width.
19.629 -+ int __ret = 0;
19.630 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.631 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
19.632 -+#endif
19.633 -+ if (MB_CUR_MAX == 1)
19.634 -+ __ret = 1;
19.635 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.636 -+ __uselocale(__old);
19.637 -+#endif
19.638 -+ return __ret;
19.639 -+ }
19.640 -+
19.641 -+ int
19.642 -+ codecvt<wchar_t, char, mbstate_t>::
19.643 -+ do_max_length() const throw()
19.644 -+ {
19.645 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.646 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
19.647 -+#endif
19.648 -+ // XXX Probably wrong for stateful encodings.
19.649 -+ int __ret = MB_CUR_MAX;
19.650 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.651 -+ __uselocale(__old);
19.652 -+#endif
19.653 -+ return __ret;
19.654 -+ }
19.655 -+
19.656 -+ int
19.657 -+ codecvt<wchar_t, char, mbstate_t>::
19.658 -+ do_length(state_type& __state, const extern_type* __from,
19.659 -+ const extern_type* __end, size_t __max) const
19.660 -+ {
19.661 -+ int __ret = 0;
19.662 -+ state_type __tmp_state(__state);
19.663 -+
19.664 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.665 -+ __c_locale __old = __uselocale(_M_c_locale_codecvt);
19.666 -+#endif
19.667 -+
19.668 -+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
19.669 -+ // in case we advance past it and then continue, in a loop.
19.670 -+ // NB: mbsnrtowcs is a GNU extension
19.671 -+
19.672 -+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
19.673 -+ // its fourth parameter (it wouldn't with NULL as first parameter).
19.674 -+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
19.675 -+ * __max));
19.676 -+ while (__from < __end && __max)
19.677 -+ {
19.678 -+ const extern_type* __from_chunk_end;
19.679 -+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
19.680 -+ __end
19.681 -+ - __from));
19.682 -+ if (!__from_chunk_end)
19.683 -+ __from_chunk_end = __end;
19.684 -+
19.685 -+ const extern_type* __tmp_from = __from;
19.686 -+ size_t __conv = mbsnrtowcs(__to, &__from,
19.687 -+ __from_chunk_end - __from,
19.688 -+ __max, &__state);
19.689 -+ if (__conv == static_cast<size_t>(-1))
19.690 -+ {
19.691 -+ // In case of error, in order to stop at the exact place we
19.692 -+ // have to start again from the beginning with a series of
19.693 -+ // mbrtowc.
19.694 -+ for (__from = __tmp_from;; __from += __conv)
19.695 -+ {
19.696 -+ __conv = mbrtowc(NULL, __from, __end - __from,
19.697 -+ &__tmp_state);
19.698 -+ if (__conv == static_cast<size_t>(-1)
19.699 -+ || __conv == static_cast<size_t>(-2))
19.700 -+ break;
19.701 -+ }
19.702 -+ __state = __tmp_state;
19.703 -+ __ret += __from - __tmp_from;
19.704 -+ break;
19.705 -+ }
19.706 -+ if (!__from)
19.707 -+ __from = __from_chunk_end;
19.708 -+
19.709 -+ __ret += __from - __tmp_from;
19.710 -+ __max -= __conv;
19.711 -+
19.712 -+ if (__from < __end && __max)
19.713 -+ {
19.714 -+ // XXX Probably wrong for stateful encodings
19.715 -+ __tmp_state = __state;
19.716 -+ ++__from;
19.717 -+ ++__ret;
19.718 -+ --__max;
19.719 -+ }
19.720 -+ }
19.721 -+
19.722 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.723 -+ __uselocale(__old);
19.724 -+#endif
19.725 -+
19.726 -+ return __ret;
19.727 -+ }
19.728 -+#endif
19.729 -+}
19.730 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
19.731 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 1970-01-01 01:00:00.000000000 +0100
19.732 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:39.000000000 +0200
19.733 -@@ -0,0 +1,80 @@
19.734 -+// std::collate implementation details, GNU version -*- C++ -*-
19.735 -+
19.736 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
19.737 -+//
19.738 -+// This file is part of the GNU ISO C++ Library. This library is free
19.739 -+// software; you can redistribute it and/or modify it under the
19.740 -+// terms of the GNU General Public License as published by the
19.741 -+// Free Software Foundation; either version 2, or (at your option)
19.742 -+// any later version.
19.743 -+
19.744 -+// This library is distributed in the hope that it will be useful,
19.745 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.746 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.747 -+// GNU General Public License for more details.
19.748 -+
19.749 -+// You should have received a copy of the GNU General Public License along
19.750 -+// with this library; see the file COPYING. If not, write to the Free
19.751 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.752 -+// USA.
19.753 -+
19.754 -+// As a special exception, you may use this file as part of a free software
19.755 -+// library without restriction. Specifically, if other files instantiate
19.756 -+// templates or use macros or inline functions from this file, or you compile
19.757 -+// this file and link it with other files to produce an executable, this
19.758 -+// file does not by itself cause the resulting executable to be covered by
19.759 -+// the GNU General Public License. This exception does not however
19.760 -+// invalidate any other reasons why the executable file might be covered by
19.761 -+// the GNU General Public License.
19.762 -+
19.763 -+//
19.764 -+// ISO C++ 14882: 22.2.4.1.2 collate virtual functions
19.765 -+//
19.766 -+
19.767 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.768 -+
19.769 -+#include <locale>
19.770 -+#include <bits/c++locale_internal.h>
19.771 -+
19.772 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.773 -+#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
19.774 -+#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
19.775 -+#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
19.776 -+#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
19.777 -+#endif
19.778 -+
19.779 -+namespace std
19.780 -+{
19.781 -+ // These are basically extensions to char_traits, and perhaps should
19.782 -+ // be put there instead of here.
19.783 -+ template<>
19.784 -+ int
19.785 -+ collate<char>::_M_compare(const char* __one, const char* __two) const
19.786 -+ {
19.787 -+ int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate);
19.788 -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
19.789 -+ }
19.790 -+
19.791 -+ template<>
19.792 -+ size_t
19.793 -+ collate<char>::_M_transform(char* __to, const char* __from,
19.794 -+ size_t __n) const
19.795 -+ { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); }
19.796 -+
19.797 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.798 -+ template<>
19.799 -+ int
19.800 -+ collate<wchar_t>::_M_compare(const wchar_t* __one,
19.801 -+ const wchar_t* __two) const
19.802 -+ {
19.803 -+ int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate);
19.804 -+ return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0);
19.805 -+ }
19.806 -+
19.807 -+ template<>
19.808 -+ size_t
19.809 -+ collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from,
19.810 -+ size_t __n) const
19.811 -+ { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); }
19.812 -+#endif
19.813 -+}
19.814 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
19.815 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1970-01-01 01:00:00.000000000 +0100
19.816 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:39.000000000 +0200
19.817 -@@ -0,0 +1,300 @@
19.818 -+// std::ctype implementation details, GNU version -*- C++ -*-
19.819 -+
19.820 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.821 -+//
19.822 -+// This file is part of the GNU ISO C++ Library. This library is free
19.823 -+// software; you can redistribute it and/or modify it under the
19.824 -+// terms of the GNU General Public License as published by the
19.825 -+// Free Software Foundation; either version 2, or (at your option)
19.826 -+// any later version.
19.827 -+
19.828 -+// This library is distributed in the hope that it will be useful,
19.829 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.830 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.831 -+// GNU General Public License for more details.
19.832 -+
19.833 -+// You should have received a copy of the GNU General Public License along
19.834 -+// with this library; see the file COPYING. If not, write to the Free
19.835 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.836 -+// USA.
19.837 -+
19.838 -+// As a special exception, you may use this file as part of a free software
19.839 -+// library without restriction. Specifically, if other files instantiate
19.840 -+// templates or use macros or inline functions from this file, or you compile
19.841 -+// this file and link it with other files to produce an executable, this
19.842 -+// file does not by itself cause the resulting executable to be covered by
19.843 -+// the GNU General Public License. This exception does not however
19.844 -+// invalidate any other reasons why the executable file might be covered by
19.845 -+// the GNU General Public License.
19.846 -+
19.847 -+//
19.848 -+// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions.
19.849 -+//
19.850 -+
19.851 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.852 -+
19.853 -+#define _LIBC
19.854 -+#include <locale>
19.855 -+#undef _LIBC
19.856 -+#include <bits/c++locale_internal.h>
19.857 -+
19.858 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.859 -+#define __wctype_l(S, L) wctype((S))
19.860 -+#define __towupper_l(C, L) towupper((C))
19.861 -+#define __towlower_l(C, L) towlower((C))
19.862 -+#define __iswctype_l(C, M, L) iswctype((C), (M))
19.863 -+#endif
19.864 -+
19.865 -+namespace std
19.866 -+{
19.867 -+ // NB: The other ctype<char> specializations are in src/locale.cc and
19.868 -+ // various /config/os/* files.
19.869 -+ template<>
19.870 -+ ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
19.871 -+ : ctype<char>(0, false, __refs)
19.872 -+ {
19.873 -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
19.874 -+ {
19.875 -+ this->_S_destroy_c_locale(this->_M_c_locale_ctype);
19.876 -+ this->_S_create_c_locale(this->_M_c_locale_ctype, __s);
19.877 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.878 -+ this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper;
19.879 -+ this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower;
19.880 -+ this->_M_table = this->_M_c_locale_ctype->__ctype_b;
19.881 -+#endif
19.882 -+ }
19.883 -+ }
19.884 -+
19.885 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.886 -+ ctype<wchar_t>::__wmask_type
19.887 -+ ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
19.888 -+ {
19.889 -+ __wmask_type __ret;
19.890 -+ switch (__m)
19.891 -+ {
19.892 -+ case space:
19.893 -+ __ret = __wctype_l("space", _M_c_locale_ctype);
19.894 -+ break;
19.895 -+ case print:
19.896 -+ __ret = __wctype_l("print", _M_c_locale_ctype);
19.897 -+ break;
19.898 -+ case cntrl:
19.899 -+ __ret = __wctype_l("cntrl", _M_c_locale_ctype);
19.900 -+ break;
19.901 -+ case upper:
19.902 -+ __ret = __wctype_l("upper", _M_c_locale_ctype);
19.903 -+ break;
19.904 -+ case lower:
19.905 -+ __ret = __wctype_l("lower", _M_c_locale_ctype);
19.906 -+ break;
19.907 -+ case alpha:
19.908 -+ __ret = __wctype_l("alpha", _M_c_locale_ctype);
19.909 -+ break;
19.910 -+ case digit:
19.911 -+ __ret = __wctype_l("digit", _M_c_locale_ctype);
19.912 -+ break;
19.913 -+ case punct:
19.914 -+ __ret = __wctype_l("punct", _M_c_locale_ctype);
19.915 -+ break;
19.916 -+ case xdigit:
19.917 -+ __ret = __wctype_l("xdigit", _M_c_locale_ctype);
19.918 -+ break;
19.919 -+ case alnum:
19.920 -+ __ret = __wctype_l("alnum", _M_c_locale_ctype);
19.921 -+ break;
19.922 -+ case graph:
19.923 -+ __ret = __wctype_l("graph", _M_c_locale_ctype);
19.924 -+ break;
19.925 -+ default:
19.926 -+ __ret = __wmask_type();
19.927 -+ }
19.928 -+ return __ret;
19.929 -+ }
19.930 -+
19.931 -+ wchar_t
19.932 -+ ctype<wchar_t>::do_toupper(wchar_t __c) const
19.933 -+ { return __towupper_l(__c, _M_c_locale_ctype); }
19.934 -+
19.935 -+ const wchar_t*
19.936 -+ ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const
19.937 -+ {
19.938 -+ while (__lo < __hi)
19.939 -+ {
19.940 -+ *__lo = __towupper_l(*__lo, _M_c_locale_ctype);
19.941 -+ ++__lo;
19.942 -+ }
19.943 -+ return __hi;
19.944 -+ }
19.945 -+
19.946 -+ wchar_t
19.947 -+ ctype<wchar_t>::do_tolower(wchar_t __c) const
19.948 -+ { return __towlower_l(__c, _M_c_locale_ctype); }
19.949 -+
19.950 -+ const wchar_t*
19.951 -+ ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const
19.952 -+ {
19.953 -+ while (__lo < __hi)
19.954 -+ {
19.955 -+ *__lo = __towlower_l(*__lo, _M_c_locale_ctype);
19.956 -+ ++__lo;
19.957 -+ }
19.958 -+ return __hi;
19.959 -+ }
19.960 -+
19.961 -+ bool
19.962 -+ ctype<wchar_t>::
19.963 -+ do_is(mask __m, wchar_t __c) const
19.964 -+ {
19.965 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
19.966 -+ // library for blank.
19.967 -+ bool __ret = false;
19.968 -+ const size_t __bitmasksize = 11;
19.969 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
19.970 -+ if (__m & _M_bit[__bitcur]
19.971 -+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
19.972 -+ {
19.973 -+ __ret = true;
19.974 -+ break;
19.975 -+ }
19.976 -+ return __ret;
19.977 -+ }
19.978 -+
19.979 -+ const wchar_t*
19.980 -+ ctype<wchar_t>::
19.981 -+ do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
19.982 -+ {
19.983 -+ for (; __lo < __hi; ++__vec, ++__lo)
19.984 -+ {
19.985 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
19.986 -+ // library for blank.
19.987 -+ const size_t __bitmasksize = 11;
19.988 -+ mask __m = 0;
19.989 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
19.990 -+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
19.991 -+ __m |= _M_bit[__bitcur];
19.992 -+ *__vec = __m;
19.993 -+ }
19.994 -+ return __hi;
19.995 -+ }
19.996 -+
19.997 -+ const wchar_t*
19.998 -+ ctype<wchar_t>::
19.999 -+ do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const
19.1000 -+ {
19.1001 -+ while (__lo < __hi && !this->do_is(__m, *__lo))
19.1002 -+ ++__lo;
19.1003 -+ return __lo;
19.1004 -+ }
19.1005 -+
19.1006 -+ const wchar_t*
19.1007 -+ ctype<wchar_t>::
19.1008 -+ do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
19.1009 -+ {
19.1010 -+ while (__lo < __hi && this->do_is(__m, *__lo) != 0)
19.1011 -+ ++__lo;
19.1012 -+ return __lo;
19.1013 -+ }
19.1014 -+
19.1015 -+ wchar_t
19.1016 -+ ctype<wchar_t>::
19.1017 -+ do_widen(char __c) const
19.1018 -+ { return _M_widen[static_cast<unsigned char>(__c)]; }
19.1019 -+
19.1020 -+ const char*
19.1021 -+ ctype<wchar_t>::
19.1022 -+ do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
19.1023 -+ {
19.1024 -+ while (__lo < __hi)
19.1025 -+ {
19.1026 -+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
19.1027 -+ ++__lo;
19.1028 -+ ++__dest;
19.1029 -+ }
19.1030 -+ return __hi;
19.1031 -+ }
19.1032 -+
19.1033 -+ char
19.1034 -+ ctype<wchar_t>::
19.1035 -+ do_narrow(wchar_t __wc, char __dfault) const
19.1036 -+ {
19.1037 -+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
19.1038 -+ return _M_narrow[__wc];
19.1039 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1040 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
19.1041 -+#endif
19.1042 -+ const int __c = wctob(__wc);
19.1043 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1044 -+ __uselocale(__old);
19.1045 -+#endif
19.1046 -+ return (__c == EOF ? __dfault : static_cast<char>(__c));
19.1047 -+ }
19.1048 -+
19.1049 -+ const wchar_t*
19.1050 -+ ctype<wchar_t>::
19.1051 -+ do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
19.1052 -+ char* __dest) const
19.1053 -+ {
19.1054 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1055 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
19.1056 -+#endif
19.1057 -+ if (_M_narrow_ok)
19.1058 -+ while (__lo < __hi)
19.1059 -+ {
19.1060 -+ if (*__lo >= 0 && *__lo < 128)
19.1061 -+ *__dest = _M_narrow[*__lo];
19.1062 -+ else
19.1063 -+ {
19.1064 -+ const int __c = wctob(*__lo);
19.1065 -+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
19.1066 -+ }
19.1067 -+ ++__lo;
19.1068 -+ ++__dest;
19.1069 -+ }
19.1070 -+ else
19.1071 -+ while (__lo < __hi)
19.1072 -+ {
19.1073 -+ const int __c = wctob(*__lo);
19.1074 -+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
19.1075 -+ ++__lo;
19.1076 -+ ++__dest;
19.1077 -+ }
19.1078 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1079 -+ __uselocale(__old);
19.1080 -+#endif
19.1081 -+ return __hi;
19.1082 -+ }
19.1083 -+
19.1084 -+ void
19.1085 -+ ctype<wchar_t>::_M_initialize_ctype()
19.1086 -+ {
19.1087 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1088 -+ __c_locale __old = __uselocale(_M_c_locale_ctype);
19.1089 -+#endif
19.1090 -+ wint_t __i;
19.1091 -+ for (__i = 0; __i < 128; ++__i)
19.1092 -+ {
19.1093 -+ const int __c = wctob(__i);
19.1094 -+ if (__c == EOF)
19.1095 -+ break;
19.1096 -+ else
19.1097 -+ _M_narrow[__i] = static_cast<char>(__c);
19.1098 -+ }
19.1099 -+ if (__i == 128)
19.1100 -+ _M_narrow_ok = true;
19.1101 -+ else
19.1102 -+ _M_narrow_ok = false;
19.1103 -+ for (size_t __j = 0;
19.1104 -+ __j < sizeof(_M_widen) / sizeof(wint_t); ++__j)
19.1105 -+ _M_widen[__j] = btowc(__j);
19.1106 -+
19.1107 -+ for (size_t __k = 0; __k <= 11; ++__k)
19.1108 -+ {
19.1109 -+ _M_bit[__k] = static_cast<mask>(_ISbit(__k));
19.1110 -+ _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]);
19.1111 -+ }
19.1112 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1113 -+ __uselocale(__old);
19.1114 -+#endif
19.1115 -+ }
19.1116 -+#endif // _GLIBCXX_USE_WCHAR_T
19.1117 -+}
19.1118 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
19.1119 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 1970-01-01 01:00:00.000000000 +0100
19.1120 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:39.000000000 +0200
19.1121 -@@ -0,0 +1,100 @@
19.1122 -+// std::messages implementation details, GNU version -*- C++ -*-
19.1123 -+
19.1124 -+// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
19.1125 -+//
19.1126 -+// This file is part of the GNU ISO C++ Library. This library is free
19.1127 -+// software; you can redistribute it and/or modify it under the
19.1128 -+// terms of the GNU General Public License as published by the
19.1129 -+// Free Software Foundation; either version 2, or (at your option)
19.1130 -+// any later version.
19.1131 -+
19.1132 -+// This library is distributed in the hope that it will be useful,
19.1133 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.1134 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.1135 -+// GNU General Public License for more details.
19.1136 -+
19.1137 -+// You should have received a copy of the GNU General Public License along
19.1138 -+// with this library; see the file COPYING. If not, write to the Free
19.1139 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.1140 -+// USA.
19.1141 -+
19.1142 -+// As a special exception, you may use this file as part of a free software
19.1143 -+// library without restriction. Specifically, if other files instantiate
19.1144 -+// templates or use macros or inline functions from this file, or you compile
19.1145 -+// this file and link it with other files to produce an executable, this
19.1146 -+// file does not by itself cause the resulting executable to be covered by
19.1147 -+// the GNU General Public License. This exception does not however
19.1148 -+// invalidate any other reasons why the executable file might be covered by
19.1149 -+// the GNU General Public License.
19.1150 -+
19.1151 -+//
19.1152 -+// ISO C++ 14882: 22.2.7.1.2 messages virtual functions
19.1153 -+//
19.1154 -+
19.1155 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.1156 -+
19.1157 -+#include <locale>
19.1158 -+#include <bits/c++locale_internal.h>
19.1159 -+
19.1160 -+#ifdef __UCLIBC_MJN3_ONLY__
19.1161 -+#warning fix gettext stuff
19.1162 -+#endif
19.1163 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
19.1164 -+extern "C" char *__dcgettext(const char *domainname,
19.1165 -+ const char *msgid, int category);
19.1166 -+#undef gettext
19.1167 -+#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
19.1168 -+#else
19.1169 -+#undef gettext
19.1170 -+#define gettext(msgid) (msgid)
19.1171 -+#endif
19.1172 -+
19.1173 -+namespace std
19.1174 -+{
19.1175 -+ // Specializations.
19.1176 -+ template<>
19.1177 -+ string
19.1178 -+ messages<char>::do_get(catalog, int, int, const string& __dfault) const
19.1179 -+ {
19.1180 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1181 -+ __c_locale __old = __uselocale(_M_c_locale_messages);
19.1182 -+ const char* __msg = const_cast<const char*>(gettext(__dfault.c_str()));
19.1183 -+ __uselocale(__old);
19.1184 -+ return string(__msg);
19.1185 -+#elif defined __UCLIBC_HAS_LOCALE__
19.1186 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.1187 -+ setlocale(LC_ALL, _M_name_messages);
19.1188 -+ const char* __msg = gettext(__dfault.c_str());
19.1189 -+ setlocale(LC_ALL, __old);
19.1190 -+ free(__old);
19.1191 -+ return string(__msg);
19.1192 -+#else
19.1193 -+ const char* __msg = gettext(__dfault.c_str());
19.1194 -+ return string(__msg);
19.1195 -+#endif
19.1196 -+ }
19.1197 -+
19.1198 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.1199 -+ template<>
19.1200 -+ wstring
19.1201 -+ messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
19.1202 -+ {
19.1203 -+# ifdef __UCLIBC_HAS_XLOCALE__
19.1204 -+ __c_locale __old = __uselocale(_M_c_locale_messages);
19.1205 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
19.1206 -+ __uselocale(__old);
19.1207 -+ return _M_convert_from_char(__msg);
19.1208 -+# elif defined __UCLIBC_HAS_LOCALE__
19.1209 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.1210 -+ setlocale(LC_ALL, _M_name_messages);
19.1211 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
19.1212 -+ setlocale(LC_ALL, __old);
19.1213 -+ free(__old);
19.1214 -+ return _M_convert_from_char(__msg);
19.1215 -+# else
19.1216 -+ char* __msg = gettext(_M_convert_to_char(__dfault));
19.1217 -+ return _M_convert_from_char(__msg);
19.1218 -+# endif
19.1219 -+ }
19.1220 -+#endif
19.1221 -+}
19.1222 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
19.1223 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 1970-01-01 01:00:00.000000000 +0100
19.1224 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:39.000000000 +0200
19.1225 -@@ -0,0 +1,118 @@
19.1226 -+// std::messages implementation details, GNU version -*- C++ -*-
19.1227 -+
19.1228 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.1229 -+//
19.1230 -+// This file is part of the GNU ISO C++ Library. This library is free
19.1231 -+// software; you can redistribute it and/or modify it under the
19.1232 -+// terms of the GNU General Public License as published by the
19.1233 -+// Free Software Foundation; either version 2, or (at your option)
19.1234 -+// any later version.
19.1235 -+
19.1236 -+// This library is distributed in the hope that it will be useful,
19.1237 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.1238 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.1239 -+// GNU General Public License for more details.
19.1240 -+
19.1241 -+// You should have received a copy of the GNU General Public License along
19.1242 -+// with this library; see the file COPYING. If not, write to the Free
19.1243 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.1244 -+// USA.
19.1245 -+
19.1246 -+// As a special exception, you may use this file as part of a free software
19.1247 -+// library without restriction. Specifically, if other files instantiate
19.1248 -+// templates or use macros or inline functions from this file, or you compile
19.1249 -+// this file and link it with other files to produce an executable, this
19.1250 -+// file does not by itself cause the resulting executable to be covered by
19.1251 -+// the GNU General Public License. This exception does not however
19.1252 -+// invalidate any other reasons why the executable file might be covered by
19.1253 -+// the GNU General Public License.
19.1254 -+
19.1255 -+//
19.1256 -+// ISO C++ 14882: 22.2.7.1.2 messages functions
19.1257 -+//
19.1258 -+
19.1259 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.1260 -+
19.1261 -+#ifdef __UCLIBC_MJN3_ONLY__
19.1262 -+#warning fix prototypes for *textdomain funcs
19.1263 -+#endif
19.1264 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
19.1265 -+extern "C" char *__textdomain(const char *domainname);
19.1266 -+extern "C" char *__bindtextdomain(const char *domainname,
19.1267 -+ const char *dirname);
19.1268 -+#else
19.1269 -+#undef __textdomain
19.1270 -+#undef __bindtextdomain
19.1271 -+#define __textdomain(D) ((void)0)
19.1272 -+#define __bindtextdomain(D,P) ((void)0)
19.1273 -+#endif
19.1274 -+
19.1275 -+ // Non-virtual member functions.
19.1276 -+ template<typename _CharT>
19.1277 -+ messages<_CharT>::messages(size_t __refs)
19.1278 -+ : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
19.1279 -+ _M_name_messages(_S_get_c_name())
19.1280 -+ { }
19.1281 -+
19.1282 -+ template<typename _CharT>
19.1283 -+ messages<_CharT>::messages(__c_locale __cloc, const char* __s,
19.1284 -+ size_t __refs)
19.1285 -+ : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
19.1286 -+ _M_name_messages(__s)
19.1287 -+ {
19.1288 -+ char* __tmp = new char[std::strlen(__s) + 1];
19.1289 -+ std::strcpy(__tmp, __s);
19.1290 -+ _M_name_messages = __tmp;
19.1291 -+ }
19.1292 -+
19.1293 -+ template<typename _CharT>
19.1294 -+ typename messages<_CharT>::catalog
19.1295 -+ messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
19.1296 -+ const char* __dir) const
19.1297 -+ {
19.1298 -+ __bindtextdomain(__s.c_str(), __dir);
19.1299 -+ return this->do_open(__s, __loc);
19.1300 -+ }
19.1301 -+
19.1302 -+ // Virtual member functions.
19.1303 -+ template<typename _CharT>
19.1304 -+ messages<_CharT>::~messages()
19.1305 -+ {
19.1306 -+ if (_M_name_messages != _S_get_c_name())
19.1307 -+ delete [] _M_name_messages;
19.1308 -+ _S_destroy_c_locale(_M_c_locale_messages);
19.1309 -+ }
19.1310 -+
19.1311 -+ template<typename _CharT>
19.1312 -+ typename messages<_CharT>::catalog
19.1313 -+ messages<_CharT>::do_open(const basic_string<char>& __s,
19.1314 -+ const locale&) const
19.1315 -+ {
19.1316 -+ // No error checking is done, assume the catalog exists and can
19.1317 -+ // be used.
19.1318 -+ __textdomain(__s.c_str());
19.1319 -+ return 0;
19.1320 -+ }
19.1321 -+
19.1322 -+ template<typename _CharT>
19.1323 -+ void
19.1324 -+ messages<_CharT>::do_close(catalog) const
19.1325 -+ { }
19.1326 -+
19.1327 -+ // messages_byname
19.1328 -+ template<typename _CharT>
19.1329 -+ messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs)
19.1330 -+ : messages<_CharT>(__refs)
19.1331 -+ {
19.1332 -+ if (this->_M_name_messages != locale::facet::_S_get_c_name())
19.1333 -+ delete [] this->_M_name_messages;
19.1334 -+ char* __tmp = new char[std::strlen(__s) + 1];
19.1335 -+ std::strcpy(__tmp, __s);
19.1336 -+ this->_M_name_messages = __tmp;
19.1337 -+
19.1338 -+ if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
19.1339 -+ {
19.1340 -+ this->_S_destroy_c_locale(this->_M_c_locale_messages);
19.1341 -+ this->_S_create_c_locale(this->_M_c_locale_messages, __s);
19.1342 -+ }
19.1343 -+ }
19.1344 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
19.1345 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1970-01-01 01:00:00.000000000 +0100
19.1346 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:39.000000000 +0200
19.1347 -@@ -0,0 +1,692 @@
19.1348 -+// std::moneypunct implementation details, GNU version -*- C++ -*-
19.1349 -+
19.1350 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.1351 -+//
19.1352 -+// This file is part of the GNU ISO C++ Library. This library is free
19.1353 -+// software; you can redistribute it and/or modify it under the
19.1354 -+// terms of the GNU General Public License as published by the
19.1355 -+// Free Software Foundation; either version 2, or (at your option)
19.1356 -+// any later version.
19.1357 -+
19.1358 -+// This library is distributed in the hope that it will be useful,
19.1359 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.1360 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.1361 -+// GNU General Public License for more details.
19.1362 -+
19.1363 -+// You should have received a copy of the GNU General Public License along
19.1364 -+// with this library; see the file COPYING. If not, write to the Free
19.1365 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.1366 -+// USA.
19.1367 -+
19.1368 -+// As a special exception, you may use this file as part of a free software
19.1369 -+// library without restriction. Specifically, if other files instantiate
19.1370 -+// templates or use macros or inline functions from this file, or you compile
19.1371 -+// this file and link it with other files to produce an executable, this
19.1372 -+// file does not by itself cause the resulting executable to be covered by
19.1373 -+// the GNU General Public License. This exception does not however
19.1374 -+// invalidate any other reasons why the executable file might be covered by
19.1375 -+// the GNU General Public License.
19.1376 -+
19.1377 -+//
19.1378 -+// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions
19.1379 -+//
19.1380 -+
19.1381 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.1382 -+
19.1383 -+#define _LIBC
19.1384 -+#include <locale>
19.1385 -+#undef _LIBC
19.1386 -+#include <bits/c++locale_internal.h>
19.1387 -+
19.1388 -+#ifdef __UCLIBC_MJN3_ONLY__
19.1389 -+#warning optimize this for uclibc
19.1390 -+#warning tailor for stub locale support
19.1391 -+#endif
19.1392 -+
19.1393 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.1394 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
19.1395 -+#endif
19.1396 -+
19.1397 -+namespace std
19.1398 -+{
19.1399 -+ // Construct and return valid pattern consisting of some combination of:
19.1400 -+ // space none symbol sign value
19.1401 -+ money_base::pattern
19.1402 -+ money_base::_S_construct_pattern(char __precedes, char __space, char __posn)
19.1403 -+ {
19.1404 -+ pattern __ret;
19.1405 -+
19.1406 -+ // This insanely complicated routine attempts to construct a valid
19.1407 -+ // pattern for use with monyepunct. A couple of invariants:
19.1408 -+
19.1409 -+ // if (__precedes) symbol -> value
19.1410 -+ // else value -> symbol
19.1411 -+
19.1412 -+ // if (__space) space
19.1413 -+ // else none
19.1414 -+
19.1415 -+ // none == never first
19.1416 -+ // space never first or last
19.1417 -+
19.1418 -+ // Any elegant implementations of this are welcome.
19.1419 -+ switch (__posn)
19.1420 -+ {
19.1421 -+ case 0:
19.1422 -+ case 1:
19.1423 -+ // 1 The sign precedes the value and symbol.
19.1424 -+ __ret.field[0] = sign;
19.1425 -+ if (__space)
19.1426 -+ {
19.1427 -+ // Pattern starts with sign.
19.1428 -+ if (__precedes)
19.1429 -+ {
19.1430 -+ __ret.field[1] = symbol;
19.1431 -+ __ret.field[3] = value;
19.1432 -+ }
19.1433 -+ else
19.1434 -+ {
19.1435 -+ __ret.field[1] = value;
19.1436 -+ __ret.field[3] = symbol;
19.1437 -+ }
19.1438 -+ __ret.field[2] = space;
19.1439 -+ }
19.1440 -+ else
19.1441 -+ {
19.1442 -+ // Pattern starts with sign and ends with none.
19.1443 -+ if (__precedes)
19.1444 -+ {
19.1445 -+ __ret.field[1] = symbol;
19.1446 -+ __ret.field[2] = value;
19.1447 -+ }
19.1448 -+ else
19.1449 -+ {
19.1450 -+ __ret.field[1] = value;
19.1451 -+ __ret.field[2] = symbol;
19.1452 -+ }
19.1453 -+ __ret.field[3] = none;
19.1454 -+ }
19.1455 -+ break;
19.1456 -+ case 2:
19.1457 -+ // 2 The sign follows the value and symbol.
19.1458 -+ if (__space)
19.1459 -+ {
19.1460 -+ // Pattern either ends with sign.
19.1461 -+ if (__precedes)
19.1462 -+ {
19.1463 -+ __ret.field[0] = symbol;
19.1464 -+ __ret.field[2] = value;
19.1465 -+ }
19.1466 -+ else
19.1467 -+ {
19.1468 -+ __ret.field[0] = value;
19.1469 -+ __ret.field[2] = symbol;
19.1470 -+ }
19.1471 -+ __ret.field[1] = space;
19.1472 -+ __ret.field[3] = sign;
19.1473 -+ }
19.1474 -+ else
19.1475 -+ {
19.1476 -+ // Pattern ends with sign then none.
19.1477 -+ if (__precedes)
19.1478 -+ {
19.1479 -+ __ret.field[0] = symbol;
19.1480 -+ __ret.field[1] = value;
19.1481 -+ }
19.1482 -+ else
19.1483 -+ {
19.1484 -+ __ret.field[0] = value;
19.1485 -+ __ret.field[1] = symbol;
19.1486 -+ }
19.1487 -+ __ret.field[2] = sign;
19.1488 -+ __ret.field[3] = none;
19.1489 -+ }
19.1490 -+ break;
19.1491 -+ case 3:
19.1492 -+ // 3 The sign immediately precedes the symbol.
19.1493 -+ if (__precedes)
19.1494 -+ {
19.1495 -+ __ret.field[0] = sign;
19.1496 -+ __ret.field[1] = symbol;
19.1497 -+ if (__space)
19.1498 -+ {
19.1499 -+ __ret.field[2] = space;
19.1500 -+ __ret.field[3] = value;
19.1501 -+ }
19.1502 -+ else
19.1503 -+ {
19.1504 -+ __ret.field[2] = value;
19.1505 -+ __ret.field[3] = none;
19.1506 -+ }
19.1507 -+ }
19.1508 -+ else
19.1509 -+ {
19.1510 -+ __ret.field[0] = value;
19.1511 -+ if (__space)
19.1512 -+ {
19.1513 -+ __ret.field[1] = space;
19.1514 -+ __ret.field[2] = sign;
19.1515 -+ __ret.field[3] = symbol;
19.1516 -+ }
19.1517 -+ else
19.1518 -+ {
19.1519 -+ __ret.field[1] = sign;
19.1520 -+ __ret.field[2] = symbol;
19.1521 -+ __ret.field[3] = none;
19.1522 -+ }
19.1523 -+ }
19.1524 -+ break;
19.1525 -+ case 4:
19.1526 -+ // 4 The sign immediately follows the symbol.
19.1527 -+ if (__precedes)
19.1528 -+ {
19.1529 -+ __ret.field[0] = symbol;
19.1530 -+ __ret.field[1] = sign;
19.1531 -+ if (__space)
19.1532 -+ {
19.1533 -+ __ret.field[2] = space;
19.1534 -+ __ret.field[3] = value;
19.1535 -+ }
19.1536 -+ else
19.1537 -+ {
19.1538 -+ __ret.field[2] = value;
19.1539 -+ __ret.field[3] = none;
19.1540 -+ }
19.1541 -+ }
19.1542 -+ else
19.1543 -+ {
19.1544 -+ __ret.field[0] = value;
19.1545 -+ if (__space)
19.1546 -+ {
19.1547 -+ __ret.field[1] = space;
19.1548 -+ __ret.field[2] = symbol;
19.1549 -+ __ret.field[3] = sign;
19.1550 -+ }
19.1551 -+ else
19.1552 -+ {
19.1553 -+ __ret.field[1] = symbol;
19.1554 -+ __ret.field[2] = sign;
19.1555 -+ __ret.field[3] = none;
19.1556 -+ }
19.1557 -+ }
19.1558 -+ break;
19.1559 -+ default:
19.1560 -+ ;
19.1561 -+ }
19.1562 -+ return __ret;
19.1563 -+ }
19.1564 -+
19.1565 -+ template<>
19.1566 -+ void
19.1567 -+ moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc,
19.1568 -+ const char*)
19.1569 -+ {
19.1570 -+ if (!_M_data)
19.1571 -+ _M_data = new __moneypunct_cache<char, true>;
19.1572 -+
19.1573 -+ if (!__cloc)
19.1574 -+ {
19.1575 -+ // "C" locale
19.1576 -+ _M_data->_M_decimal_point = '.';
19.1577 -+ _M_data->_M_thousands_sep = ',';
19.1578 -+ _M_data->_M_grouping = "";
19.1579 -+ _M_data->_M_grouping_size = 0;
19.1580 -+ _M_data->_M_curr_symbol = "";
19.1581 -+ _M_data->_M_curr_symbol_size = 0;
19.1582 -+ _M_data->_M_positive_sign = "";
19.1583 -+ _M_data->_M_positive_sign_size = 0;
19.1584 -+ _M_data->_M_negative_sign = "";
19.1585 -+ _M_data->_M_negative_sign_size = 0;
19.1586 -+ _M_data->_M_frac_digits = 0;
19.1587 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
19.1588 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
19.1589 -+
19.1590 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
19.1591 -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
19.1592 -+ }
19.1593 -+ else
19.1594 -+ {
19.1595 -+ // Named locale.
19.1596 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
19.1597 -+ __cloc));
19.1598 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
19.1599 -+ __cloc));
19.1600 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
19.1601 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.1602 -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
19.1603 -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
19.1604 -+
19.1605 -+ char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
19.1606 -+ if (!__nposn)
19.1607 -+ _M_data->_M_negative_sign = "()";
19.1608 -+ else
19.1609 -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
19.1610 -+ __cloc);
19.1611 -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
19.1612 -+
19.1613 -+ // _Intl == true
19.1614 -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
19.1615 -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
19.1616 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
19.1617 -+ __cloc));
19.1618 -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
19.1619 -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
19.1620 -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
19.1621 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
19.1622 -+ __pposn);
19.1623 -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
19.1624 -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
19.1625 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
19.1626 -+ __nposn);
19.1627 -+ }
19.1628 -+ }
19.1629 -+
19.1630 -+ template<>
19.1631 -+ void
19.1632 -+ moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc,
19.1633 -+ const char*)
19.1634 -+ {
19.1635 -+ if (!_M_data)
19.1636 -+ _M_data = new __moneypunct_cache<char, false>;
19.1637 -+
19.1638 -+ if (!__cloc)
19.1639 -+ {
19.1640 -+ // "C" locale
19.1641 -+ _M_data->_M_decimal_point = '.';
19.1642 -+ _M_data->_M_thousands_sep = ',';
19.1643 -+ _M_data->_M_grouping = "";
19.1644 -+ _M_data->_M_grouping_size = 0;
19.1645 -+ _M_data->_M_curr_symbol = "";
19.1646 -+ _M_data->_M_curr_symbol_size = 0;
19.1647 -+ _M_data->_M_positive_sign = "";
19.1648 -+ _M_data->_M_positive_sign_size = 0;
19.1649 -+ _M_data->_M_negative_sign = "";
19.1650 -+ _M_data->_M_negative_sign_size = 0;
19.1651 -+ _M_data->_M_frac_digits = 0;
19.1652 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
19.1653 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
19.1654 -+
19.1655 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
19.1656 -+ _M_data->_M_atoms[__i] = money_base::_S_atoms[__i];
19.1657 -+ }
19.1658 -+ else
19.1659 -+ {
19.1660 -+ // Named locale.
19.1661 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT,
19.1662 -+ __cloc));
19.1663 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP,
19.1664 -+ __cloc));
19.1665 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
19.1666 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.1667 -+ _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
19.1668 -+ _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign);
19.1669 -+
19.1670 -+ char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
19.1671 -+ if (!__nposn)
19.1672 -+ _M_data->_M_negative_sign = "()";
19.1673 -+ else
19.1674 -+ _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN,
19.1675 -+ __cloc);
19.1676 -+ _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign);
19.1677 -+
19.1678 -+ // _Intl == false
19.1679 -+ _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
19.1680 -+ _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol);
19.1681 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
19.1682 -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
19.1683 -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
19.1684 -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
19.1685 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
19.1686 -+ __pposn);
19.1687 -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
19.1688 -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
19.1689 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
19.1690 -+ __nposn);
19.1691 -+ }
19.1692 -+ }
19.1693 -+
19.1694 -+ template<>
19.1695 -+ moneypunct<char, true>::~moneypunct()
19.1696 -+ { delete _M_data; }
19.1697 -+
19.1698 -+ template<>
19.1699 -+ moneypunct<char, false>::~moneypunct()
19.1700 -+ { delete _M_data; }
19.1701 -+
19.1702 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.1703 -+ template<>
19.1704 -+ void
19.1705 -+ moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc,
19.1706 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1707 -+ const char*)
19.1708 -+#else
19.1709 -+ const char* __name)
19.1710 -+#endif
19.1711 -+ {
19.1712 -+ if (!_M_data)
19.1713 -+ _M_data = new __moneypunct_cache<wchar_t, true>;
19.1714 -+
19.1715 -+ if (!__cloc)
19.1716 -+ {
19.1717 -+ // "C" locale
19.1718 -+ _M_data->_M_decimal_point = L'.';
19.1719 -+ _M_data->_M_thousands_sep = L',';
19.1720 -+ _M_data->_M_grouping = "";
19.1721 -+ _M_data->_M_grouping_size = 0;
19.1722 -+ _M_data->_M_curr_symbol = L"";
19.1723 -+ _M_data->_M_curr_symbol_size = 0;
19.1724 -+ _M_data->_M_positive_sign = L"";
19.1725 -+ _M_data->_M_positive_sign_size = 0;
19.1726 -+ _M_data->_M_negative_sign = L"";
19.1727 -+ _M_data->_M_negative_sign_size = 0;
19.1728 -+ _M_data->_M_frac_digits = 0;
19.1729 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
19.1730 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
19.1731 -+
19.1732 -+ // Use ctype::widen code without the facet...
19.1733 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
19.1734 -+ _M_data->_M_atoms[__i] =
19.1735 -+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
19.1736 -+ }
19.1737 -+ else
19.1738 -+ {
19.1739 -+ // Named locale.
19.1740 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1741 -+ __c_locale __old = __uselocale(__cloc);
19.1742 -+#else
19.1743 -+ // Switch to named locale so that mbsrtowcs will work.
19.1744 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.1745 -+ setlocale(LC_ALL, __name);
19.1746 -+#endif
19.1747 -+
19.1748 -+#ifdef __UCLIBC_MJN3_ONLY__
19.1749 -+#warning fix this... should be monetary
19.1750 -+#endif
19.1751 -+#ifdef __UCLIBC__
19.1752 -+# ifdef __UCLIBC_HAS_XLOCALE__
19.1753 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
19.1754 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
19.1755 -+# else
19.1756 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
19.1757 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
19.1758 -+# endif
19.1759 -+#else
19.1760 -+ union { char *__s; wchar_t __w; } __u;
19.1761 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
19.1762 -+ _M_data->_M_decimal_point = __u.__w;
19.1763 -+
19.1764 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
19.1765 -+ _M_data->_M_thousands_sep = __u.__w;
19.1766 -+#endif
19.1767 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
19.1768 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.1769 -+
19.1770 -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
19.1771 -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
19.1772 -+ const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc);
19.1773 -+
19.1774 -+ wchar_t* __wcs_ps = 0;
19.1775 -+ wchar_t* __wcs_ns = 0;
19.1776 -+ const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc));
19.1777 -+ try
19.1778 -+ {
19.1779 -+ mbstate_t __state;
19.1780 -+ size_t __len = strlen(__cpossign);
19.1781 -+ if (__len)
19.1782 -+ {
19.1783 -+ ++__len;
19.1784 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1785 -+ __wcs_ps = new wchar_t[__len];
19.1786 -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
19.1787 -+ _M_data->_M_positive_sign = __wcs_ps;
19.1788 -+ }
19.1789 -+ else
19.1790 -+ _M_data->_M_positive_sign = L"";
19.1791 -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
19.1792 -+
19.1793 -+ __len = strlen(__cnegsign);
19.1794 -+ if (!__nposn)
19.1795 -+ _M_data->_M_negative_sign = L"()";
19.1796 -+ else if (__len)
19.1797 -+ {
19.1798 -+ ++__len;
19.1799 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1800 -+ __wcs_ns = new wchar_t[__len];
19.1801 -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
19.1802 -+ _M_data->_M_negative_sign = __wcs_ns;
19.1803 -+ }
19.1804 -+ else
19.1805 -+ _M_data->_M_negative_sign = L"";
19.1806 -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
19.1807 -+
19.1808 -+ // _Intl == true.
19.1809 -+ __len = strlen(__ccurr);
19.1810 -+ if (__len)
19.1811 -+ {
19.1812 -+ ++__len;
19.1813 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1814 -+ wchar_t* __wcs = new wchar_t[__len];
19.1815 -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
19.1816 -+ _M_data->_M_curr_symbol = __wcs;
19.1817 -+ }
19.1818 -+ else
19.1819 -+ _M_data->_M_curr_symbol = L"";
19.1820 -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
19.1821 -+ }
19.1822 -+ catch (...)
19.1823 -+ {
19.1824 -+ delete _M_data;
19.1825 -+ _M_data = 0;
19.1826 -+ delete __wcs_ps;
19.1827 -+ delete __wcs_ns;
19.1828 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1829 -+ __uselocale(__old);
19.1830 -+#else
19.1831 -+ setlocale(LC_ALL, __old);
19.1832 -+ free(__old);
19.1833 -+#endif
19.1834 -+ __throw_exception_again;
19.1835 -+ }
19.1836 -+
19.1837 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS,
19.1838 -+ __cloc));
19.1839 -+ char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc));
19.1840 -+ char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc));
19.1841 -+ char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc));
19.1842 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
19.1843 -+ __pposn);
19.1844 -+ char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc));
19.1845 -+ char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc));
19.1846 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
19.1847 -+ __nposn);
19.1848 -+
19.1849 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1850 -+ __uselocale(__old);
19.1851 -+#else
19.1852 -+ setlocale(LC_ALL, __old);
19.1853 -+ free(__old);
19.1854 -+#endif
19.1855 -+ }
19.1856 -+ }
19.1857 -+
19.1858 -+ template<>
19.1859 -+ void
19.1860 -+ moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc,
19.1861 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1862 -+ const char*)
19.1863 -+#else
19.1864 -+ const char* __name)
19.1865 -+#endif
19.1866 -+ {
19.1867 -+ if (!_M_data)
19.1868 -+ _M_data = new __moneypunct_cache<wchar_t, false>;
19.1869 -+
19.1870 -+ if (!__cloc)
19.1871 -+ {
19.1872 -+ // "C" locale
19.1873 -+ _M_data->_M_decimal_point = L'.';
19.1874 -+ _M_data->_M_thousands_sep = L',';
19.1875 -+ _M_data->_M_grouping = "";
19.1876 -+ _M_data->_M_grouping_size = 0;
19.1877 -+ _M_data->_M_curr_symbol = L"";
19.1878 -+ _M_data->_M_curr_symbol_size = 0;
19.1879 -+ _M_data->_M_positive_sign = L"";
19.1880 -+ _M_data->_M_positive_sign_size = 0;
19.1881 -+ _M_data->_M_negative_sign = L"";
19.1882 -+ _M_data->_M_negative_sign_size = 0;
19.1883 -+ _M_data->_M_frac_digits = 0;
19.1884 -+ _M_data->_M_pos_format = money_base::_S_default_pattern;
19.1885 -+ _M_data->_M_neg_format = money_base::_S_default_pattern;
19.1886 -+
19.1887 -+ // Use ctype::widen code without the facet...
19.1888 -+ for (size_t __i = 0; __i < money_base::_S_end; ++__i)
19.1889 -+ _M_data->_M_atoms[__i] =
19.1890 -+ static_cast<wchar_t>(money_base::_S_atoms[__i]);
19.1891 -+ }
19.1892 -+ else
19.1893 -+ {
19.1894 -+ // Named locale.
19.1895 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1896 -+ __c_locale __old = __uselocale(__cloc);
19.1897 -+#else
19.1898 -+ // Switch to named locale so that mbsrtowcs will work.
19.1899 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.1900 -+ setlocale(LC_ALL, __name);
19.1901 -+#endif
19.1902 -+
19.1903 -+#ifdef __UCLIBC_MJN3_ONLY__
19.1904 -+#warning fix this... should be monetary
19.1905 -+#endif
19.1906 -+#ifdef __UCLIBC__
19.1907 -+# ifdef __UCLIBC_HAS_XLOCALE__
19.1908 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
19.1909 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
19.1910 -+# else
19.1911 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
19.1912 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
19.1913 -+# endif
19.1914 -+#else
19.1915 -+ union { char *__s; wchar_t __w; } __u;
19.1916 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc);
19.1917 -+ _M_data->_M_decimal_point = __u.__w;
19.1918 -+
19.1919 -+ __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc);
19.1920 -+ _M_data->_M_thousands_sep = __u.__w;
19.1921 -+#endif
19.1922 -+ _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc);
19.1923 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.1924 -+
19.1925 -+ const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc);
19.1926 -+ const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc);
19.1927 -+ const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc);
19.1928 -+
19.1929 -+ wchar_t* __wcs_ps = 0;
19.1930 -+ wchar_t* __wcs_ns = 0;
19.1931 -+ const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc));
19.1932 -+ try
19.1933 -+ {
19.1934 -+ mbstate_t __state;
19.1935 -+ size_t __len;
19.1936 -+ __len = strlen(__cpossign);
19.1937 -+ if (__len)
19.1938 -+ {
19.1939 -+ ++__len;
19.1940 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1941 -+ __wcs_ps = new wchar_t[__len];
19.1942 -+ mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state);
19.1943 -+ _M_data->_M_positive_sign = __wcs_ps;
19.1944 -+ }
19.1945 -+ else
19.1946 -+ _M_data->_M_positive_sign = L"";
19.1947 -+ _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign);
19.1948 -+
19.1949 -+ __len = strlen(__cnegsign);
19.1950 -+ if (!__nposn)
19.1951 -+ _M_data->_M_negative_sign = L"()";
19.1952 -+ else if (__len)
19.1953 -+ {
19.1954 -+ ++__len;
19.1955 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1956 -+ __wcs_ns = new wchar_t[__len];
19.1957 -+ mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state);
19.1958 -+ _M_data->_M_negative_sign = __wcs_ns;
19.1959 -+ }
19.1960 -+ else
19.1961 -+ _M_data->_M_negative_sign = L"";
19.1962 -+ _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign);
19.1963 -+
19.1964 -+ // _Intl == true.
19.1965 -+ __len = strlen(__ccurr);
19.1966 -+ if (__len)
19.1967 -+ {
19.1968 -+ ++__len;
19.1969 -+ memset(&__state, 0, sizeof(mbstate_t));
19.1970 -+ wchar_t* __wcs = new wchar_t[__len];
19.1971 -+ mbsrtowcs(__wcs, &__ccurr, __len, &__state);
19.1972 -+ _M_data->_M_curr_symbol = __wcs;
19.1973 -+ }
19.1974 -+ else
19.1975 -+ _M_data->_M_curr_symbol = L"";
19.1976 -+ _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol);
19.1977 -+ }
19.1978 -+ catch (...)
19.1979 -+ {
19.1980 -+ delete _M_data;
19.1981 -+ _M_data = 0;
19.1982 -+ delete __wcs_ps;
19.1983 -+ delete __wcs_ns;
19.1984 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.1985 -+ __uselocale(__old);
19.1986 -+#else
19.1987 -+ setlocale(LC_ALL, __old);
19.1988 -+ free(__old);
19.1989 -+#endif
19.1990 -+ __throw_exception_again;
19.1991 -+ }
19.1992 -+
19.1993 -+ _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc));
19.1994 -+ char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc));
19.1995 -+ char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc));
19.1996 -+ char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc));
19.1997 -+ _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace,
19.1998 -+ __pposn);
19.1999 -+ char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc));
19.2000 -+ char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc));
19.2001 -+ _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace,
19.2002 -+ __nposn);
19.2003 -+
19.2004 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.2005 -+ __uselocale(__old);
19.2006 -+#else
19.2007 -+ setlocale(LC_ALL, __old);
19.2008 -+ free(__old);
19.2009 -+#endif
19.2010 -+ }
19.2011 -+ }
19.2012 -+
19.2013 -+ template<>
19.2014 -+ moneypunct<wchar_t, true>::~moneypunct()
19.2015 -+ {
19.2016 -+ if (_M_data->_M_positive_sign_size)
19.2017 -+ delete [] _M_data->_M_positive_sign;
19.2018 -+ if (_M_data->_M_negative_sign_size
19.2019 -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
19.2020 -+ delete [] _M_data->_M_negative_sign;
19.2021 -+ if (_M_data->_M_curr_symbol_size)
19.2022 -+ delete [] _M_data->_M_curr_symbol;
19.2023 -+ delete _M_data;
19.2024 -+ }
19.2025 -+
19.2026 -+ template<>
19.2027 -+ moneypunct<wchar_t, false>::~moneypunct()
19.2028 -+ {
19.2029 -+ if (_M_data->_M_positive_sign_size)
19.2030 -+ delete [] _M_data->_M_positive_sign;
19.2031 -+ if (_M_data->_M_negative_sign_size
19.2032 -+ && wcscmp(_M_data->_M_negative_sign, L"()") != 0)
19.2033 -+ delete [] _M_data->_M_negative_sign;
19.2034 -+ if (_M_data->_M_curr_symbol_size)
19.2035 -+ delete [] _M_data->_M_curr_symbol;
19.2036 -+ delete _M_data;
19.2037 -+ }
19.2038 -+#endif
19.2039 -+}
19.2040 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
19.2041 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1970-01-01 01:00:00.000000000 +0100
19.2042 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:39.000000000 +0200
19.2043 -@@ -0,0 +1,160 @@
19.2044 -+// std::numpunct implementation details, GNU version -*- C++ -*-
19.2045 -+
19.2046 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.2047 -+//
19.2048 -+// This file is part of the GNU ISO C++ Library. This library is free
19.2049 -+// software; you can redistribute it and/or modify it under the
19.2050 -+// terms of the GNU General Public License as published by the
19.2051 -+// Free Software Foundation; either version 2, or (at your option)
19.2052 -+// any later version.
19.2053 -+
19.2054 -+// This library is distributed in the hope that it will be useful,
19.2055 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.2056 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.2057 -+// GNU General Public License for more details.
19.2058 -+
19.2059 -+// You should have received a copy of the GNU General Public License along
19.2060 -+// with this library; see the file COPYING. If not, write to the Free
19.2061 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.2062 -+// USA.
19.2063 -+
19.2064 -+// As a special exception, you may use this file as part of a free software
19.2065 -+// library without restriction. Specifically, if other files instantiate
19.2066 -+// templates or use macros or inline functions from this file, or you compile
19.2067 -+// this file and link it with other files to produce an executable, this
19.2068 -+// file does not by itself cause the resulting executable to be covered by
19.2069 -+// the GNU General Public License. This exception does not however
19.2070 -+// invalidate any other reasons why the executable file might be covered by
19.2071 -+// the GNU General Public License.
19.2072 -+
19.2073 -+//
19.2074 -+// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions
19.2075 -+//
19.2076 -+
19.2077 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.2078 -+
19.2079 -+#define _LIBC
19.2080 -+#include <locale>
19.2081 -+#undef _LIBC
19.2082 -+#include <bits/c++locale_internal.h>
19.2083 -+
19.2084 -+#ifdef __UCLIBC_MJN3_ONLY__
19.2085 -+#warning tailor for stub locale support
19.2086 -+#endif
19.2087 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.2088 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
19.2089 -+#endif
19.2090 -+
19.2091 -+namespace std
19.2092 -+{
19.2093 -+ template<>
19.2094 -+ void
19.2095 -+ numpunct<char>::_M_initialize_numpunct(__c_locale __cloc)
19.2096 -+ {
19.2097 -+ if (!_M_data)
19.2098 -+ _M_data = new __numpunct_cache<char>;
19.2099 -+
19.2100 -+ if (!__cloc)
19.2101 -+ {
19.2102 -+ // "C" locale
19.2103 -+ _M_data->_M_grouping = "";
19.2104 -+ _M_data->_M_grouping_size = 0;
19.2105 -+ _M_data->_M_use_grouping = false;
19.2106 -+
19.2107 -+ _M_data->_M_decimal_point = '.';
19.2108 -+ _M_data->_M_thousands_sep = ',';
19.2109 -+
19.2110 -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
19.2111 -+ _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i];
19.2112 -+
19.2113 -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
19.2114 -+ _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j];
19.2115 -+ }
19.2116 -+ else
19.2117 -+ {
19.2118 -+ // Named locale.
19.2119 -+ _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT,
19.2120 -+ __cloc));
19.2121 -+ _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP,
19.2122 -+ __cloc));
19.2123 -+
19.2124 -+ // Check for NULL, which implies no grouping.
19.2125 -+ if (_M_data->_M_thousands_sep == '\0')
19.2126 -+ _M_data->_M_grouping = "";
19.2127 -+ else
19.2128 -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
19.2129 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.2130 -+ }
19.2131 -+
19.2132 -+ // NB: There is no way to extact this info from posix locales.
19.2133 -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
19.2134 -+ _M_data->_M_truename = "true";
19.2135 -+ _M_data->_M_truename_size = 4;
19.2136 -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
19.2137 -+ _M_data->_M_falsename = "false";
19.2138 -+ _M_data->_M_falsename_size = 5;
19.2139 -+ }
19.2140 -+
19.2141 -+ template<>
19.2142 -+ numpunct<char>::~numpunct()
19.2143 -+ { delete _M_data; }
19.2144 -+
19.2145 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.2146 -+ template<>
19.2147 -+ void
19.2148 -+ numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc)
19.2149 -+ {
19.2150 -+ if (!_M_data)
19.2151 -+ _M_data = new __numpunct_cache<wchar_t>;
19.2152 -+
19.2153 -+ if (!__cloc)
19.2154 -+ {
19.2155 -+ // "C" locale
19.2156 -+ _M_data->_M_grouping = "";
19.2157 -+ _M_data->_M_grouping_size = 0;
19.2158 -+ _M_data->_M_use_grouping = false;
19.2159 -+
19.2160 -+ _M_data->_M_decimal_point = L'.';
19.2161 -+ _M_data->_M_thousands_sep = L',';
19.2162 -+
19.2163 -+ // Use ctype::widen code without the facet...
19.2164 -+ for (size_t __i = 0; __i < __num_base::_S_oend; ++__i)
19.2165 -+ _M_data->_M_atoms_out[__i] =
19.2166 -+ static_cast<wchar_t>(__num_base::_S_atoms_out[__i]);
19.2167 -+
19.2168 -+ for (size_t __j = 0; __j < __num_base::_S_iend; ++__j)
19.2169 -+ _M_data->_M_atoms_in[__j] =
19.2170 -+ static_cast<wchar_t>(__num_base::_S_atoms_in[__j]);
19.2171 -+ }
19.2172 -+ else
19.2173 -+ {
19.2174 -+ // Named locale.
19.2175 -+ // NB: In the GNU model wchar_t is always 32 bit wide.
19.2176 -+ union { char *__s; wchar_t __w; } __u;
19.2177 -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
19.2178 -+ _M_data->_M_decimal_point = __u.__w;
19.2179 -+
19.2180 -+ __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
19.2181 -+ _M_data->_M_thousands_sep = __u.__w;
19.2182 -+
19.2183 -+ if (_M_data->_M_thousands_sep == L'\0')
19.2184 -+ _M_data->_M_grouping = "";
19.2185 -+ else
19.2186 -+ _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc);
19.2187 -+ _M_data->_M_grouping_size = strlen(_M_data->_M_grouping);
19.2188 -+ }
19.2189 -+
19.2190 -+ // NB: There is no way to extact this info from posix locales.
19.2191 -+ // _M_truename = __nl_langinfo_l(YESSTR, __cloc);
19.2192 -+ _M_data->_M_truename = L"true";
19.2193 -+ _M_data->_M_truename_size = 4;
19.2194 -+ // _M_falsename = __nl_langinfo_l(NOSTR, __cloc);
19.2195 -+ _M_data->_M_falsename = L"false";
19.2196 -+ _M_data->_M_falsename_size = 5;
19.2197 -+ }
19.2198 -+
19.2199 -+ template<>
19.2200 -+ numpunct<wchar_t>::~numpunct()
19.2201 -+ { delete _M_data; }
19.2202 -+ #endif
19.2203 -+}
19.2204 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
19.2205 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 1970-01-01 01:00:00.000000000 +0100
19.2206 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:39.000000000 +0200
19.2207 -@@ -0,0 +1,406 @@
19.2208 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
19.2209 -+
19.2210 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.2211 -+//
19.2212 -+// This file is part of the GNU ISO C++ Library. This library is free
19.2213 -+// software; you can redistribute it and/or modify it under the
19.2214 -+// terms of the GNU General Public License as published by the
19.2215 -+// Free Software Foundation; either version 2, or (at your option)
19.2216 -+// any later version.
19.2217 -+
19.2218 -+// This library is distributed in the hope that it will be useful,
19.2219 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.2220 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.2221 -+// GNU General Public License for more details.
19.2222 -+
19.2223 -+// You should have received a copy of the GNU General Public License along
19.2224 -+// with this library; see the file COPYING. If not, write to the Free
19.2225 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.2226 -+// USA.
19.2227 -+
19.2228 -+// As a special exception, you may use this file as part of a free software
19.2229 -+// library without restriction. Specifically, if other files instantiate
19.2230 -+// templates or use macros or inline functions from this file, or you compile
19.2231 -+// this file and link it with other files to produce an executable, this
19.2232 -+// file does not by itself cause the resulting executable to be covered by
19.2233 -+// the GNU General Public License. This exception does not however
19.2234 -+// invalidate any other reasons why the executable file might be covered by
19.2235 -+// the GNU General Public License.
19.2236 -+
19.2237 -+//
19.2238 -+// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions
19.2239 -+// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions
19.2240 -+//
19.2241 -+
19.2242 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.2243 -+
19.2244 -+#include <locale>
19.2245 -+#include <bits/c++locale_internal.h>
19.2246 -+
19.2247 -+#ifdef __UCLIBC_MJN3_ONLY__
19.2248 -+#warning tailor for stub locale support
19.2249 -+#endif
19.2250 -+#ifndef __UCLIBC_HAS_XLOCALE__
19.2251 -+#define __nl_langinfo_l(N, L) nl_langinfo((N))
19.2252 -+#endif
19.2253 -+
19.2254 -+namespace std
19.2255 -+{
19.2256 -+ template<>
19.2257 -+ void
19.2258 -+ __timepunct<char>::
19.2259 -+ _M_put(char* __s, size_t __maxlen, const char* __format,
19.2260 -+ const tm* __tm) const
19.2261 -+ {
19.2262 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.2263 -+ const size_t __len = __strftime_l(__s, __maxlen, __format, __tm,
19.2264 -+ _M_c_locale_timepunct);
19.2265 -+#else
19.2266 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.2267 -+ setlocale(LC_ALL, _M_name_timepunct);
19.2268 -+ const size_t __len = strftime(__s, __maxlen, __format, __tm);
19.2269 -+ setlocale(LC_ALL, __old);
19.2270 -+ free(__old);
19.2271 -+#endif
19.2272 -+ // Make sure __s is null terminated.
19.2273 -+ if (__len == 0)
19.2274 -+ __s[0] = '\0';
19.2275 -+ }
19.2276 -+
19.2277 -+ template<>
19.2278 -+ void
19.2279 -+ __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc)
19.2280 -+ {
19.2281 -+ if (!_M_data)
19.2282 -+ _M_data = new __timepunct_cache<char>;
19.2283 -+
19.2284 -+ if (!__cloc)
19.2285 -+ {
19.2286 -+ // "C" locale
19.2287 -+ _M_c_locale_timepunct = _S_get_c_locale();
19.2288 -+
19.2289 -+ _M_data->_M_date_format = "%m/%d/%y";
19.2290 -+ _M_data->_M_date_era_format = "%m/%d/%y";
19.2291 -+ _M_data->_M_time_format = "%H:%M:%S";
19.2292 -+ _M_data->_M_time_era_format = "%H:%M:%S";
19.2293 -+ _M_data->_M_date_time_format = "";
19.2294 -+ _M_data->_M_date_time_era_format = "";
19.2295 -+ _M_data->_M_am = "AM";
19.2296 -+ _M_data->_M_pm = "PM";
19.2297 -+ _M_data->_M_am_pm_format = "";
19.2298 -+
19.2299 -+ // Day names, starting with "C"'s Sunday.
19.2300 -+ _M_data->_M_day1 = "Sunday";
19.2301 -+ _M_data->_M_day2 = "Monday";
19.2302 -+ _M_data->_M_day3 = "Tuesday";
19.2303 -+ _M_data->_M_day4 = "Wednesday";
19.2304 -+ _M_data->_M_day5 = "Thursday";
19.2305 -+ _M_data->_M_day6 = "Friday";
19.2306 -+ _M_data->_M_day7 = "Saturday";
19.2307 -+
19.2308 -+ // Abbreviated day names, starting with "C"'s Sun.
19.2309 -+ _M_data->_M_aday1 = "Sun";
19.2310 -+ _M_data->_M_aday2 = "Mon";
19.2311 -+ _M_data->_M_aday3 = "Tue";
19.2312 -+ _M_data->_M_aday4 = "Wed";
19.2313 -+ _M_data->_M_aday5 = "Thu";
19.2314 -+ _M_data->_M_aday6 = "Fri";
19.2315 -+ _M_data->_M_aday7 = "Sat";
19.2316 -+
19.2317 -+ // Month names, starting with "C"'s January.
19.2318 -+ _M_data->_M_month01 = "January";
19.2319 -+ _M_data->_M_month02 = "February";
19.2320 -+ _M_data->_M_month03 = "March";
19.2321 -+ _M_data->_M_month04 = "April";
19.2322 -+ _M_data->_M_month05 = "May";
19.2323 -+ _M_data->_M_month06 = "June";
19.2324 -+ _M_data->_M_month07 = "July";
19.2325 -+ _M_data->_M_month08 = "August";
19.2326 -+ _M_data->_M_month09 = "September";
19.2327 -+ _M_data->_M_month10 = "October";
19.2328 -+ _M_data->_M_month11 = "November";
19.2329 -+ _M_data->_M_month12 = "December";
19.2330 -+
19.2331 -+ // Abbreviated month names, starting with "C"'s Jan.
19.2332 -+ _M_data->_M_amonth01 = "Jan";
19.2333 -+ _M_data->_M_amonth02 = "Feb";
19.2334 -+ _M_data->_M_amonth03 = "Mar";
19.2335 -+ _M_data->_M_amonth04 = "Apr";
19.2336 -+ _M_data->_M_amonth05 = "May";
19.2337 -+ _M_data->_M_amonth06 = "Jun";
19.2338 -+ _M_data->_M_amonth07 = "Jul";
19.2339 -+ _M_data->_M_amonth08 = "Aug";
19.2340 -+ _M_data->_M_amonth09 = "Sep";
19.2341 -+ _M_data->_M_amonth10 = "Oct";
19.2342 -+ _M_data->_M_amonth11 = "Nov";
19.2343 -+ _M_data->_M_amonth12 = "Dec";
19.2344 -+ }
19.2345 -+ else
19.2346 -+ {
19.2347 -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
19.2348 -+
19.2349 -+ _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc);
19.2350 -+ _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc);
19.2351 -+ _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc);
19.2352 -+ _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc);
19.2353 -+ _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc);
19.2354 -+ _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT,
19.2355 -+ __cloc);
19.2356 -+ _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc);
19.2357 -+ _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc);
19.2358 -+ _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc);
19.2359 -+
19.2360 -+ // Day names, starting with "C"'s Sunday.
19.2361 -+ _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc);
19.2362 -+ _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc);
19.2363 -+ _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc);
19.2364 -+ _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc);
19.2365 -+ _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc);
19.2366 -+ _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc);
19.2367 -+ _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc);
19.2368 -+
19.2369 -+ // Abbreviated day names, starting with "C"'s Sun.
19.2370 -+ _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc);
19.2371 -+ _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc);
19.2372 -+ _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc);
19.2373 -+ _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc);
19.2374 -+ _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc);
19.2375 -+ _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc);
19.2376 -+ _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc);
19.2377 -+
19.2378 -+ // Month names, starting with "C"'s January.
19.2379 -+ _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc);
19.2380 -+ _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc);
19.2381 -+ _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc);
19.2382 -+ _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc);
19.2383 -+ _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc);
19.2384 -+ _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc);
19.2385 -+ _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc);
19.2386 -+ _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc);
19.2387 -+ _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc);
19.2388 -+ _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc);
19.2389 -+ _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc);
19.2390 -+ _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc);
19.2391 -+
19.2392 -+ // Abbreviated month names, starting with "C"'s Jan.
19.2393 -+ _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc);
19.2394 -+ _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc);
19.2395 -+ _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc);
19.2396 -+ _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc);
19.2397 -+ _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc);
19.2398 -+ _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc);
19.2399 -+ _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc);
19.2400 -+ _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc);
19.2401 -+ _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc);
19.2402 -+ _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc);
19.2403 -+ _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc);
19.2404 -+ _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc);
19.2405 -+ }
19.2406 -+ }
19.2407 -+
19.2408 -+#ifdef _GLIBCXX_USE_WCHAR_T
19.2409 -+ template<>
19.2410 -+ void
19.2411 -+ __timepunct<wchar_t>::
19.2412 -+ _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format,
19.2413 -+ const tm* __tm) const
19.2414 -+ {
19.2415 -+#ifdef __UCLIBC_HAS_XLOCALE__
19.2416 -+ __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct);
19.2417 -+ const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm,
19.2418 -+ _M_c_locale_timepunct);
19.2419 -+#else
19.2420 -+ char* __old = strdup(setlocale(LC_ALL, NULL));
19.2421 -+ setlocale(LC_ALL, _M_name_timepunct);
19.2422 -+ const size_t __len = wcsftime(__s, __maxlen, __format, __tm);
19.2423 -+ setlocale(LC_ALL, __old);
19.2424 -+ free(__old);
19.2425 -+#endif
19.2426 -+ // Make sure __s is null terminated.
19.2427 -+ if (__len == 0)
19.2428 -+ __s[0] = L'\0';
19.2429 -+ }
19.2430 -+
19.2431 -+ template<>
19.2432 -+ void
19.2433 -+ __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc)
19.2434 -+ {
19.2435 -+ if (!_M_data)
19.2436 -+ _M_data = new __timepunct_cache<wchar_t>;
19.2437 -+
19.2438 -+#warning wide time stuff
19.2439 -+// if (!__cloc)
19.2440 -+ {
19.2441 -+ // "C" locale
19.2442 -+ _M_c_locale_timepunct = _S_get_c_locale();
19.2443 -+
19.2444 -+ _M_data->_M_date_format = L"%m/%d/%y";
19.2445 -+ _M_data->_M_date_era_format = L"%m/%d/%y";
19.2446 -+ _M_data->_M_time_format = L"%H:%M:%S";
19.2447 -+ _M_data->_M_time_era_format = L"%H:%M:%S";
19.2448 -+ _M_data->_M_date_time_format = L"";
19.2449 -+ _M_data->_M_date_time_era_format = L"";
19.2450 -+ _M_data->_M_am = L"AM";
19.2451 -+ _M_data->_M_pm = L"PM";
19.2452 -+ _M_data->_M_am_pm_format = L"";
19.2453 -+
19.2454 -+ // Day names, starting with "C"'s Sunday.
19.2455 -+ _M_data->_M_day1 = L"Sunday";
19.2456 -+ _M_data->_M_day2 = L"Monday";
19.2457 -+ _M_data->_M_day3 = L"Tuesday";
19.2458 -+ _M_data->_M_day4 = L"Wednesday";
19.2459 -+ _M_data->_M_day5 = L"Thursday";
19.2460 -+ _M_data->_M_day6 = L"Friday";
19.2461 -+ _M_data->_M_day7 = L"Saturday";
19.2462 -+
19.2463 -+ // Abbreviated day names, starting with "C"'s Sun.
19.2464 -+ _M_data->_M_aday1 = L"Sun";
19.2465 -+ _M_data->_M_aday2 = L"Mon";
19.2466 -+ _M_data->_M_aday3 = L"Tue";
19.2467 -+ _M_data->_M_aday4 = L"Wed";
19.2468 -+ _M_data->_M_aday5 = L"Thu";
19.2469 -+ _M_data->_M_aday6 = L"Fri";
19.2470 -+ _M_data->_M_aday7 = L"Sat";
19.2471 -+
19.2472 -+ // Month names, starting with "C"'s January.
19.2473 -+ _M_data->_M_month01 = L"January";
19.2474 -+ _M_data->_M_month02 = L"February";
19.2475 -+ _M_data->_M_month03 = L"March";
19.2476 -+ _M_data->_M_month04 = L"April";
19.2477 -+ _M_data->_M_month05 = L"May";
19.2478 -+ _M_data->_M_month06 = L"June";
19.2479 -+ _M_data->_M_month07 = L"July";
19.2480 -+ _M_data->_M_month08 = L"August";
19.2481 -+ _M_data->_M_month09 = L"September";
19.2482 -+ _M_data->_M_month10 = L"October";
19.2483 -+ _M_data->_M_month11 = L"November";
19.2484 -+ _M_data->_M_month12 = L"December";
19.2485 -+
19.2486 -+ // Abbreviated month names, starting with "C"'s Jan.
19.2487 -+ _M_data->_M_amonth01 = L"Jan";
19.2488 -+ _M_data->_M_amonth02 = L"Feb";
19.2489 -+ _M_data->_M_amonth03 = L"Mar";
19.2490 -+ _M_data->_M_amonth04 = L"Apr";
19.2491 -+ _M_data->_M_amonth05 = L"May";
19.2492 -+ _M_data->_M_amonth06 = L"Jun";
19.2493 -+ _M_data->_M_amonth07 = L"Jul";
19.2494 -+ _M_data->_M_amonth08 = L"Aug";
19.2495 -+ _M_data->_M_amonth09 = L"Sep";
19.2496 -+ _M_data->_M_amonth10 = L"Oct";
19.2497 -+ _M_data->_M_amonth11 = L"Nov";
19.2498 -+ _M_data->_M_amonth12 = L"Dec";
19.2499 -+ }
19.2500 -+#if 0
19.2501 -+ else
19.2502 -+ {
19.2503 -+ _M_c_locale_timepunct = _S_clone_c_locale(__cloc);
19.2504 -+
19.2505 -+ union { char *__s; wchar_t *__w; } __u;
19.2506 -+
19.2507 -+ __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc);
19.2508 -+ _M_data->_M_date_format = __u.__w;
19.2509 -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc);
19.2510 -+ _M_data->_M_date_era_format = __u.__w;
19.2511 -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc);
19.2512 -+ _M_data->_M_time_format = __u.__w;
19.2513 -+ __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc);
19.2514 -+ _M_data->_M_time_era_format = __u.__w;
19.2515 -+ __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc);
19.2516 -+ _M_data->_M_date_time_format = __u.__w;
19.2517 -+ __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc);
19.2518 -+ _M_data->_M_date_time_era_format = __u.__w;
19.2519 -+ __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc);
19.2520 -+ _M_data->_M_am = __u.__w;
19.2521 -+ __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc);
19.2522 -+ _M_data->_M_pm = __u.__w;
19.2523 -+ __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc);
19.2524 -+ _M_data->_M_am_pm_format = __u.__w;
19.2525 -+
19.2526 -+ // Day names, starting with "C"'s Sunday.
19.2527 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc);
19.2528 -+ _M_data->_M_day1 = __u.__w;
19.2529 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc);
19.2530 -+ _M_data->_M_day2 = __u.__w;
19.2531 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc);
19.2532 -+ _M_data->_M_day3 = __u.__w;
19.2533 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc);
19.2534 -+ _M_data->_M_day4 = __u.__w;
19.2535 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc);
19.2536 -+ _M_data->_M_day5 = __u.__w;
19.2537 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc);
19.2538 -+ _M_data->_M_day6 = __u.__w;
19.2539 -+ __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc);
19.2540 -+ _M_data->_M_day7 = __u.__w;
19.2541 -+
19.2542 -+ // Abbreviated day names, starting with "C"'s Sun.
19.2543 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc);
19.2544 -+ _M_data->_M_aday1 = __u.__w;
19.2545 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc);
19.2546 -+ _M_data->_M_aday2 = __u.__w;
19.2547 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc);
19.2548 -+ _M_data->_M_aday3 = __u.__w;
19.2549 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc);
19.2550 -+ _M_data->_M_aday4 = __u.__w;
19.2551 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc);
19.2552 -+ _M_data->_M_aday5 = __u.__w;
19.2553 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc);
19.2554 -+ _M_data->_M_aday6 = __u.__w;
19.2555 -+ __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc);
19.2556 -+ _M_data->_M_aday7 = __u.__w;
19.2557 -+
19.2558 -+ // Month names, starting with "C"'s January.
19.2559 -+ __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc);
19.2560 -+ _M_data->_M_month01 = __u.__w;
19.2561 -+ __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc);
19.2562 -+ _M_data->_M_month02 = __u.__w;
19.2563 -+ __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc);
19.2564 -+ _M_data->_M_month03 = __u.__w;
19.2565 -+ __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc);
19.2566 -+ _M_data->_M_month04 = __u.__w;
19.2567 -+ __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc);
19.2568 -+ _M_data->_M_month05 = __u.__w;
19.2569 -+ __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc);
19.2570 -+ _M_data->_M_month06 = __u.__w;
19.2571 -+ __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc);
19.2572 -+ _M_data->_M_month07 = __u.__w;
19.2573 -+ __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc);
19.2574 -+ _M_data->_M_month08 = __u.__w;
19.2575 -+ __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc);
19.2576 -+ _M_data->_M_month09 = __u.__w;
19.2577 -+ __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc);
19.2578 -+ _M_data->_M_month10 = __u.__w;
19.2579 -+ __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc);
19.2580 -+ _M_data->_M_month11 = __u.__w;
19.2581 -+ __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc);
19.2582 -+ _M_data->_M_month12 = __u.__w;
19.2583 -+
19.2584 -+ // Abbreviated month names, starting with "C"'s Jan.
19.2585 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc);
19.2586 -+ _M_data->_M_amonth01 = __u.__w;
19.2587 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc);
19.2588 -+ _M_data->_M_amonth02 = __u.__w;
19.2589 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc);
19.2590 -+ _M_data->_M_amonth03 = __u.__w;
19.2591 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc);
19.2592 -+ _M_data->_M_amonth04 = __u.__w;
19.2593 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc);
19.2594 -+ _M_data->_M_amonth05 = __u.__w;
19.2595 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc);
19.2596 -+ _M_data->_M_amonth06 = __u.__w;
19.2597 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc);
19.2598 -+ _M_data->_M_amonth07 = __u.__w;
19.2599 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc);
19.2600 -+ _M_data->_M_amonth08 = __u.__w;
19.2601 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc);
19.2602 -+ _M_data->_M_amonth09 = __u.__w;
19.2603 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc);
19.2604 -+ _M_data->_M_amonth10 = __u.__w;
19.2605 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc);
19.2606 -+ _M_data->_M_amonth11 = __u.__w;
19.2607 -+ __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc);
19.2608 -+ _M_data->_M_amonth12 = __u.__w;
19.2609 -+ }
19.2610 -+#endif // 0
19.2611 -+ }
19.2612 -+#endif
19.2613 -+}
19.2614 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
19.2615 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 1970-01-01 01:00:00.000000000 +0100
19.2616 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:39.000000000 +0200
19.2617 -@@ -0,0 +1,68 @@
19.2618 -+// std::time_get, std::time_put implementation, GNU version -*- C++ -*-
19.2619 -+
19.2620 -+// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
19.2621 -+//
19.2622 -+// This file is part of the GNU ISO C++ Library. This library is free
19.2623 -+// software; you can redistribute it and/or modify it under the
19.2624 -+// terms of the GNU General Public License as published by the
19.2625 -+// Free Software Foundation; either version 2, or (at your option)
19.2626 -+// any later version.
19.2627 -+
19.2628 -+// This library is distributed in the hope that it will be useful,
19.2629 -+// but WITHOUT ANY WARRANTY; without even the implied warranty of
19.2630 -+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19.2631 -+// GNU General Public License for more details.
19.2632 -+
19.2633 -+// You should have received a copy of the GNU General Public License along
19.2634 -+// with this library; see the file COPYING. If not, write to the Free
19.2635 -+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
19.2636 -+// USA.
19.2637 -+
19.2638 -+// As a special exception, you may use this file as part of a free software
19.2639 -+// library without restriction. Specifically, if other files instantiate
19.2640 -+// templates or use macros or inline functions from this file, or you compile
19.2641 -+// this file and link it with other files to produce an executable, this
19.2642 -+// file does not by itself cause the resulting executable to be covered by
19.2643 -+// the GNU General Public License. This exception does not however
19.2644 -+// invalidate any other reasons why the executable file might be covered by
19.2645 -+// the GNU General Public License.
19.2646 -+
19.2647 -+//
19.2648 -+// ISO C++ 14882: 22.2.5.1.2 - time_get functions
19.2649 -+// ISO C++ 14882: 22.2.5.3.2 - time_put functions
19.2650 -+//
19.2651 -+
19.2652 -+// Written by Benjamin Kosnik <bkoz@redhat.com>
19.2653 -+
19.2654 -+ template<typename _CharT>
19.2655 -+ __timepunct<_CharT>::__timepunct(size_t __refs)
19.2656 -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
19.2657 -+ _M_name_timepunct(_S_get_c_name())
19.2658 -+ { _M_initialize_timepunct(); }
19.2659 -+
19.2660 -+ template<typename _CharT>
19.2661 -+ __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
19.2662 -+ : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
19.2663 -+ _M_name_timepunct(_S_get_c_name())
19.2664 -+ { _M_initialize_timepunct(); }
19.2665 -+
19.2666 -+ template<typename _CharT>
19.2667 -+ __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
19.2668 -+ size_t __refs)
19.2669 -+ : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
19.2670 -+ _M_name_timepunct(__s)
19.2671 -+ {
19.2672 -+ char* __tmp = new char[std::strlen(__s) + 1];
19.2673 -+ std::strcpy(__tmp, __s);
19.2674 -+ _M_name_timepunct = __tmp;
19.2675 -+ _M_initialize_timepunct(__cloc);
19.2676 -+ }
19.2677 -+
19.2678 -+ template<typename _CharT>
19.2679 -+ __timepunct<_CharT>::~__timepunct()
19.2680 -+ {
19.2681 -+ if (_M_name_timepunct != _S_get_c_name())
19.2682 -+ delete [] _M_name_timepunct;
19.2683 -+ delete _M_data;
19.2684 -+ _S_destroy_c_locale(_M_c_locale_timepunct);
19.2685 -+ }
19.2686 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
19.2687 ---- gcc-4.3.1.orig/libstdc++-v3/configure 2008-04-25 18:52:57.000000000 +0200
19.2688 -+++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:39.000000000 +0200
19.2689 -@@ -14001,7 +14001,7 @@
19.2690 - enableval="$enable_clocale"
19.2691 -
19.2692 - case "$enableval" in
19.2693 -- generic|gnu|ieee_1003.1-2001|yes|no|auto) ;;
19.2694 -+ generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;;
19.2695 - *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5
19.2696 - echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;}
19.2697 - { (exit 1); exit 1; }; } ;;
19.2698 -@@ -14034,6 +14034,9 @@
19.2699 - # Default to "generic".
19.2700 - if test $enable_clocale_flag = auto; then
19.2701 - case ${target_os} in
19.2702 -+ linux-uclibc*)
19.2703 -+ enable_clocale_flag=uclibc
19.2704 -+ ;;
19.2705 - linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu)
19.2706 - enable_clocale_flag=gnu
19.2707 - ;;
19.2708 -@@ -14422,6 +14425,76 @@
19.2709 - CTIME_CC=config/locale/generic/time_members.cc
19.2710 - CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h
19.2711 - ;;
19.2712 -+ uclibc)
19.2713 -+ echo "$as_me:$LINENO: result: uclibc" >&5
19.2714 -+echo "${ECHO_T}uclibc" >&6
19.2715 -+
19.2716 -+ # Declare intention to use gettext, and add support for specific
19.2717 -+ # languages.
19.2718 -+ # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT
19.2719 -+ ALL_LINGUAS="de fr"
19.2720 -+
19.2721 -+ # Don't call AM-GNU-GETTEXT here. Instead, assume glibc.
19.2722 -+ # Extract the first word of "msgfmt", so it can be a program name with args.
19.2723 -+set dummy msgfmt; ac_word=$2
19.2724 -+echo "$as_me:$LINENO: checking for $ac_word" >&5
19.2725 -+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
19.2726 -+if test "${ac_cv_prog_check_msgfmt+set}" = set; then
19.2727 -+ echo $ECHO_N "(cached) $ECHO_C" >&6
19.2728 -+else
19.2729 -+ if test -n "$check_msgfmt"; then
19.2730 -+ ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test.
19.2731 -+else
19.2732 -+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
19.2733 -+for as_dir in $PATH
19.2734 -+do
19.2735 -+ IFS=$as_save_IFS
19.2736 -+ test -z "$as_dir" && as_dir=.
19.2737 -+ for ac_exec_ext in '' $ac_executable_extensions; do
19.2738 -+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
19.2739 -+ ac_cv_prog_check_msgfmt="yes"
19.2740 -+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
19.2741 -+ break 2
19.2742 -+ fi
19.2743 -+done
19.2744 -+done
19.2745 -+
19.2746 -+ test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no"
19.2747 -+fi
19.2748 -+fi
19.2749 -+check_msgfmt=$ac_cv_prog_check_msgfmt
19.2750 -+if test -n "$check_msgfmt"; then
19.2751 -+ echo "$as_me:$LINENO: result: $check_msgfmt" >&5
19.2752 -+echo "${ECHO_T}$check_msgfmt" >&6
19.2753 -+else
19.2754 -+ echo "$as_me:$LINENO: result: no" >&5
19.2755 -+echo "${ECHO_T}no" >&6
19.2756 -+fi
19.2757 -+
19.2758 -+ if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then
19.2759 -+ USE_NLS=yes
19.2760 -+ fi
19.2761 -+ # Export the build objects.
19.2762 -+ for ling in $ALL_LINGUAS; do \
19.2763 -+ glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \
19.2764 -+ glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \
19.2765 -+ done
19.2766 -+
19.2767 -+
19.2768 -+
19.2769 -+ CLOCALE_H=config/locale/uclibc/c_locale.h
19.2770 -+ CLOCALE_CC=config/locale/uclibc/c_locale.cc
19.2771 -+ CCODECVT_CC=config/locale/uclibc/codecvt_members.cc
19.2772 -+ CCOLLATE_CC=config/locale/uclibc/collate_members.cc
19.2773 -+ CCTYPE_CC=config/locale/uclibc/ctype_members.cc
19.2774 -+ CMESSAGES_H=config/locale/uclibc/messages_members.h
19.2775 -+ CMESSAGES_CC=config/locale/uclibc/messages_members.cc
19.2776 -+ CMONEY_CC=config/locale/uclibc/monetary_members.cc
19.2777 -+ CNUMERIC_CC=config/locale/uclibc/numeric_members.cc
19.2778 -+ CTIME_H=config/locale/uclibc/time_members.h
19.2779 -+ CTIME_CC=config/locale/uclibc/time_members.cc
19.2780 -+ CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h
19.2781 -+ ;;
19.2782 - esac
19.2783 -
19.2784 - # This is where the testsuite looks for locale catalogs, using the
19.2785 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h
19.2786 ---- gcc-4.3.1.orig/libstdc++-v3/include/c_compatibility/wchar.h 2007-03-04 23:59:49.000000000 +0100
19.2787 -+++ gcc-4.3.1/libstdc++-v3/include/c_compatibility/wchar.h 2008-06-10 14:58:39.000000000 +0200
19.2788 -@@ -106,7 +106,9 @@
19.2789 - using std::wmemcpy;
19.2790 - using std::wmemmove;
19.2791 - using std::wmemset;
19.2792 -+#if _GLIBCXX_HAVE_WCSFTIME
19.2793 - using std::wcsftime;
19.2794 -+#endif
19.2795 -
19.2796 - #if _GLIBCXX_USE_C99
19.2797 - using std::wcstold;
20.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
20.2 +++ b/patches/gcc/4.3.1/280-c99-complex-ugly-hack.patch Mon Aug 04 12:38:06 2008 +0000
20.3 @@ -0,0 +1,14 @@
20.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
20.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
20.6 +--- gcc-4.3.1.orig/libstdc++-v3/configure 2008-06-10 14:58:43.000000000 +0200
20.7 ++++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:58.000000000 +0200
20.8 +@@ -39006,6 +39006,9 @@
20.9 + cat >>conftest.$ac_ext <<_ACEOF
20.10 + /* end confdefs.h. */
20.11 + #include <complex.h>
20.12 ++#ifdef __UCLIBC__
20.13 ++#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
20.14 ++#endif
20.15 + int
20.16 + main ()
20.17 + {
21.1 --- a/patches/gcc/4.3.1/280-uclibc-locale-no__x.patch Mon Aug 04 12:09:54 2008 +0000
21.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
21.3 @@ -1,224 +0,0 @@
21.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_203-uclibc-locale-no__x.patch
21.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h
21.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
21.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2008-06-10 14:58:43.000000000 +0200
21.8 -@@ -60,4 +60,49 @@
21.9 - extern "C" __typeof(wctype_l) __wctype_l;
21.10 - #endif
21.11 -
21.12 -+# define __nl_langinfo_l nl_langinfo_l
21.13 -+# define __strcoll_l strcoll_l
21.14 -+# define __strftime_l strftime_l
21.15 -+# define __strtod_l strtod_l
21.16 -+# define __strtof_l strtof_l
21.17 -+# define __strtold_l strtold_l
21.18 -+# define __strxfrm_l strxfrm_l
21.19 -+# define __newlocale newlocale
21.20 -+# define __freelocale freelocale
21.21 -+# define __duplocale duplocale
21.22 -+# define __uselocale uselocale
21.23 -+
21.24 -+# ifdef _GLIBCXX_USE_WCHAR_T
21.25 -+# define __iswctype_l iswctype_l
21.26 -+# define __towlower_l towlower_l
21.27 -+# define __towupper_l towupper_l
21.28 -+# define __wcscoll_l wcscoll_l
21.29 -+# define __wcsftime_l wcsftime_l
21.30 -+# define __wcsxfrm_l wcsxfrm_l
21.31 -+# define __wctype_l wctype_l
21.32 -+# endif
21.33 -+
21.34 -+#else
21.35 -+# define __nl_langinfo_l(N, L) nl_langinfo((N))
21.36 -+# define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
21.37 -+# define __strtod_l(S, E, L) strtod((S), (E))
21.38 -+# define __strtof_l(S, E, L) strtof((S), (E))
21.39 -+# define __strtold_l(S, E, L) strtold((S), (E))
21.40 -+# define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
21.41 -+# warning should dummy __newlocale check for C|POSIX ?
21.42 -+# define __newlocale(a, b, c) NULL
21.43 -+# define __freelocale(a) ((void)0)
21.44 -+# define __duplocale(a) __c_locale()
21.45 -+//# define __uselocale ?
21.46 -+//
21.47 -+# ifdef _GLIBCXX_USE_WCHAR_T
21.48 -+# define __iswctype_l(C, M, L) iswctype((C), (M))
21.49 -+# define __towlower_l(C, L) towlower((C))
21.50 -+# define __towupper_l(C, L) towupper((C))
21.51 -+# define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
21.52 -+//# define __wcsftime_l(S, M, F, T, L) wcsftime((S), (M), (F), (T))
21.53 -+# define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
21.54 -+# define __wctype_l(S, L) wctype((S))
21.55 -+# endif
21.56 -+
21.57 - #endif // GLIBC 2.3 and later
21.58 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
21.59 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
21.60 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:43.000000000 +0200
21.61 -@@ -39,20 +39,6 @@
21.62 - #include <langinfo.h>
21.63 - #include <bits/c++locale_internal.h>
21.64 -
21.65 --#ifndef __UCLIBC_HAS_XLOCALE__
21.66 --#define __strtol_l(S, E, B, L) strtol((S), (E), (B))
21.67 --#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B))
21.68 --#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B))
21.69 --#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B))
21.70 --#define __strtof_l(S, E, L) strtof((S), (E))
21.71 --#define __strtod_l(S, E, L) strtod((S), (E))
21.72 --#define __strtold_l(S, E, L) strtold((S), (E))
21.73 --#warning should dummy __newlocale check for C|POSIX ?
21.74 --#define __newlocale(a, b, c) NULL
21.75 --#define __freelocale(a) ((void)0)
21.76 --#define __duplocale(a) __c_locale()
21.77 --#endif
21.78 --
21.79 - namespace std
21.80 - {
21.81 - template<>
21.82 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
21.83 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
21.84 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:43.000000000 +0200
21.85 -@@ -68,6 +68,7 @@
21.86 - {
21.87 - extern "C" __typeof(uselocale) __uselocale;
21.88 - }
21.89 -+#define __uselocale uselocale
21.90 - #endif
21.91 -
21.92 - namespace std
21.93 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc
21.94 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
21.95 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/collate_members.cc 2008-06-10 14:58:43.000000000 +0200
21.96 -@@ -36,13 +36,6 @@
21.97 - #include <locale>
21.98 - #include <bits/c++locale_internal.h>
21.99 -
21.100 --#ifndef __UCLIBC_HAS_XLOCALE__
21.101 --#define __strcoll_l(S1, S2, L) strcoll((S1), (S2))
21.102 --#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N))
21.103 --#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2))
21.104 --#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N))
21.105 --#endif
21.106 --
21.107 - namespace std
21.108 - {
21.109 - // These are basically extensions to char_traits, and perhaps should
21.110 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
21.111 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
21.112 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:43.000000000 +0200
21.113 -@@ -38,13 +38,6 @@
21.114 - #undef _LIBC
21.115 - #include <bits/c++locale_internal.h>
21.116 -
21.117 --#ifndef __UCLIBC_HAS_XLOCALE__
21.118 --#define __wctype_l(S, L) wctype((S))
21.119 --#define __towupper_l(C, L) towupper((C))
21.120 --#define __towlower_l(C, L) towlower((C))
21.121 --#define __iswctype_l(C, M, L) iswctype((C), (M))
21.122 --#endif
21.123 --
21.124 - namespace std
21.125 - {
21.126 - // NB: The other ctype<char> specializations are in src/locale.cc and
21.127 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc
21.128 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
21.129 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.cc 2008-06-10 14:58:43.000000000 +0200
21.130 -@@ -39,13 +39,10 @@
21.131 - #ifdef __UCLIBC_MJN3_ONLY__
21.132 - #warning fix gettext stuff
21.133 - #endif
21.134 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
21.135 --extern "C" char *__dcgettext(const char *domainname,
21.136 -- const char *msgid, int category);
21.137 - #undef gettext
21.138 --#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES)
21.139 -+#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
21.140 -+#define gettext(msgid) dcgettext(NULL, msgid, LC_MESSAGES)
21.141 - #else
21.142 --#undef gettext
21.143 - #define gettext(msgid) (msgid)
21.144 - #endif
21.145 -
21.146 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
21.147 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
21.148 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:43.000000000 +0200
21.149 -@@ -36,15 +36,11 @@
21.150 - #ifdef __UCLIBC_MJN3_ONLY__
21.151 - #warning fix prototypes for *textdomain funcs
21.152 - #endif
21.153 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
21.154 --extern "C" char *__textdomain(const char *domainname);
21.155 --extern "C" char *__bindtextdomain(const char *domainname,
21.156 -- const char *dirname);
21.157 --#else
21.158 --#undef __textdomain
21.159 --#undef __bindtextdomain
21.160 --#define __textdomain(D) ((void)0)
21.161 --#define __bindtextdomain(D,P) ((void)0)
21.162 -+#ifndef __UCLIBC_HAS_GETTEXT_AWARENESS__
21.163 -+#undef textdomain
21.164 -+#undef bindtextdomain
21.165 -+#define textdomain(D) ((void)0)
21.166 -+#define bindtextdomain(D,P) ((void)0)
21.167 - #endif
21.168 -
21.169 - // Non-virtual member functions.
21.170 -@@ -70,7 +66,7 @@
21.171 - messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc,
21.172 - const char* __dir) const
21.173 - {
21.174 -- __bindtextdomain(__s.c_str(), __dir);
21.175 -+ bindtextdomain(__s.c_str(), __dir);
21.176 - return this->do_open(__s, __loc);
21.177 - }
21.178 -
21.179 -@@ -90,7 +86,7 @@
21.180 - {
21.181 - // No error checking is done, assume the catalog exists and can
21.182 - // be used.
21.183 -- __textdomain(__s.c_str());
21.184 -+ textdomain(__s.c_str());
21.185 - return 0;
21.186 - }
21.187 -
21.188 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
21.189 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
21.190 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:43.000000000 +0200
21.191 -@@ -43,10 +43,6 @@
21.192 - #warning tailor for stub locale support
21.193 - #endif
21.194 -
21.195 --#ifndef __UCLIBC_HAS_XLOCALE__
21.196 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
21.197 --#endif
21.198 --
21.199 - namespace std
21.200 - {
21.201 - // Construct and return valid pattern consisting of some combination of:
21.202 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
21.203 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
21.204 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:43.000000000 +0200
21.205 -@@ -41,9 +41,6 @@
21.206 - #ifdef __UCLIBC_MJN3_ONLY__
21.207 - #warning tailor for stub locale support
21.208 - #endif
21.209 --#ifndef __UCLIBC_HAS_XLOCALE__
21.210 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
21.211 --#endif
21.212 -
21.213 - namespace std
21.214 - {
21.215 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc
21.216 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
21.217 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.cc 2008-06-10 14:58:43.000000000 +0200
21.218 -@@ -40,9 +40,6 @@
21.219 - #ifdef __UCLIBC_MJN3_ONLY__
21.220 - #warning tailor for stub locale support
21.221 - #endif
21.222 --#ifndef __UCLIBC_HAS_XLOCALE__
21.223 --#define __nl_langinfo_l(N, L) nl_langinfo((N))
21.224 --#endif
21.225 -
21.226 - namespace std
21.227 - {
22.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
22.2 +++ b/patches/gcc/4.3.1/290-index_macro.patch Mon Aug 04 12:38:06 2008 +0000
22.3 @@ -0,0 +1,27 @@
22.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
22.5 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
22.6 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
22.7 ++++ gcc-4.3.1/libstdc++-v3/include/ext/rope 2008-06-10 14:59:02.000000000 +0200
22.8 +@@ -59,6 +59,9 @@
22.9 + #include <bits/gthr.h>
22.10 + #include <tr1/functional>
22.11 +
22.12 ++/* cope w/ index defined as macro, SuSv3 proposal */
22.13 ++#undef index
22.14 ++
22.15 + # ifdef __GC
22.16 + # define __GC_CONST const
22.17 + # else
22.18 +diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
22.19 +--- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
22.20 ++++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:59:02.000000000 +0200
22.21 +@@ -54,6 +54,9 @@
22.22 + #include <ext/memory> // For uninitialized_copy_n
22.23 + #include <ext/numeric> // For power
22.24 +
22.25 ++/* cope w/ index defined as macro, SuSv3 proposal */
22.26 ++#undef index
22.27 ++
22.28 + _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
22.29 +
22.30 + using std::size_t;
23.1 --- a/patches/gcc/4.3.1/290-uclibc-locale-wchar_fix.patch Mon Aug 04 12:09:54 2008 +0000
23.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
23.3 @@ -1,51 +0,0 @@
23.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_204-uclibc-locale-wchar_fix.patch
23.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
23.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200
23.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:47.000000000 +0200
23.8 -@@ -401,7 +401,7 @@
23.9 - # ifdef __UCLIBC_HAS_XLOCALE__
23.10 - _M_data->_M_decimal_point = __cloc->decimal_point_wc;
23.11 - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
23.12 --# else
23.13 -+# elif defined __UCLIBC_HAS_LOCALE__
23.14 - _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23.15 - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
23.16 - # endif
23.17 -@@ -556,7 +556,7 @@
23.18 - # ifdef __UCLIBC_HAS_XLOCALE__
23.19 - _M_data->_M_decimal_point = __cloc->decimal_point_wc;
23.20 - _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
23.21 --# else
23.22 -+# elif defined __UCLIBC_HAS_LOCALE__
23.23 - _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23.24 - _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
23.25 - # endif
23.26 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
23.27 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200
23.28 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:47.000000000 +0200
23.29 -@@ -127,12 +127,25 @@
23.30 - {
23.31 - // Named locale.
23.32 - // NB: In the GNU model wchar_t is always 32 bit wide.
23.33 -+#ifdef __UCLIBC_MJN3_ONLY__
23.34 -+#warning fix this... should be numeric
23.35 -+#endif
23.36 -+#ifdef __UCLIBC__
23.37 -+# ifdef __UCLIBC_HAS_XLOCALE__
23.38 -+ _M_data->_M_decimal_point = __cloc->decimal_point_wc;
23.39 -+ _M_data->_M_thousands_sep = __cloc->thousands_sep_wc;
23.40 -+# elif defined __UCLIBC_HAS_LOCALE__
23.41 -+ _M_data->_M_decimal_point = __global_locale->decimal_point_wc;
23.42 -+ _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc;
23.43 -+# endif
23.44 -+#else
23.45 - union { char *__s; wchar_t __w; } __u;
23.46 - __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc);
23.47 - _M_data->_M_decimal_point = __u.__w;
23.48 -
23.49 - __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc);
23.50 - _M_data->_M_thousands_sep = __u.__w;
23.51 -+#endif
23.52 -
23.53 - if (_M_data->_M_thousands_sep == L'\0')
23.54 - _M_data->_M_grouping = "";
24.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
24.2 +++ b/patches/gcc/4.3.1/300-libmudflap-susv3-legacy.patch Mon Aug 04 12:38:06 2008 +0000
24.3 @@ -0,0 +1,49 @@
24.4 +Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
24.5 +diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
24.6 +--- gcc-4.3.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
24.7 ++++ gcc-4.3.1/libmudflap/mf-hooks2.c 2008-06-10 14:59:05.000000000 +0200
24.8 +@@ -427,7 +427,7 @@
24.9 + {
24.10 + TRACE ("%s\n", __PRETTY_FUNCTION__);
24.11 + MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
24.12 +- bzero (s, n);
24.13 ++ memset (s, 0, n);
24.14 + }
24.15 +
24.16 +
24.17 +@@ -437,7 +437,7 @@
24.18 + TRACE ("%s\n", __PRETTY_FUNCTION__);
24.19 + MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
24.20 + MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
24.21 +- bcopy (src, dest, n);
24.22 ++ memmove (dest, src, n);
24.23 + }
24.24 +
24.25 +
24.26 +@@ -447,7 +447,7 @@
24.27 + TRACE ("%s\n", __PRETTY_FUNCTION__);
24.28 + MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
24.29 + MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
24.30 +- return bcmp (s1, s2, n);
24.31 ++ return memcmp (s1, s2, n);
24.32 + }
24.33 +
24.34 +
24.35 +@@ -456,7 +456,7 @@
24.36 + size_t n = strlen (s);
24.37 + TRACE ("%s\n", __PRETTY_FUNCTION__);
24.38 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
24.39 +- return index (s, c);
24.40 ++ return strchr (s, c);
24.41 + }
24.42 +
24.43 +
24.44 +@@ -465,7 +465,7 @@
24.45 + size_t n = strlen (s);
24.46 + TRACE ("%s\n", __PRETTY_FUNCTION__);
24.47 + MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
24.48 +- return rindex (s, c);
24.49 ++ return strrchr (s, c);
24.50 + }
24.51 +
24.52 + /* XXX: stpcpy, memccpy */
25.1 --- a/patches/gcc/4.3.1/300-uclibc-locale-update.patch Mon Aug 04 12:09:54 2008 +0000
25.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
25.3 @@ -1,355 +0,0 @@
25.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_205-uclibc-locale-update.patch
25.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc
25.6 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:47.000000000 +0200
25.7 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.cc 2008-06-10 14:58:51.000000000 +0200
25.8 -@@ -46,16 +46,13 @@
25.9 - __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
25.10 - const __c_locale& __cloc)
25.11 - {
25.12 -- if (!(__err & ios_base::failbit))
25.13 -- {
25.14 -- char* __sanity;
25.15 -- errno = 0;
25.16 -- float __f = __strtof_l(__s, &__sanity, __cloc);
25.17 -- if (__sanity != __s && errno != ERANGE)
25.18 -- __v = __f;
25.19 -- else
25.20 -- __err |= ios_base::failbit;
25.21 -- }
25.22 -+ char* __sanity;
25.23 -+ errno = 0;
25.24 -+ float __f = __strtof_l(__s, &__sanity, __cloc);
25.25 -+ if (__sanity != __s && errno != ERANGE)
25.26 -+ __v = __f;
25.27 -+ else
25.28 -+ __err |= ios_base::failbit;
25.29 - }
25.30 -
25.31 - template<>
25.32 -@@ -63,16 +60,13 @@
25.33 - __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
25.34 - const __c_locale& __cloc)
25.35 - {
25.36 -- if (!(__err & ios_base::failbit))
25.37 -- {
25.38 -- char* __sanity;
25.39 -- errno = 0;
25.40 -- double __d = __strtod_l(__s, &__sanity, __cloc);
25.41 -- if (__sanity != __s && errno != ERANGE)
25.42 -- __v = __d;
25.43 -- else
25.44 -- __err |= ios_base::failbit;
25.45 -- }
25.46 -+ char* __sanity;
25.47 -+ errno = 0;
25.48 -+ double __d = __strtod_l(__s, &__sanity, __cloc);
25.49 -+ if (__sanity != __s && errno != ERANGE)
25.50 -+ __v = __d;
25.51 -+ else
25.52 -+ __err |= ios_base::failbit;
25.53 - }
25.54 -
25.55 - template<>
25.56 -@@ -80,16 +74,13 @@
25.57 - __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
25.58 - const __c_locale& __cloc)
25.59 - {
25.60 -- if (!(__err & ios_base::failbit))
25.61 -- {
25.62 -- char* __sanity;
25.63 -- errno = 0;
25.64 -- long double __ld = __strtold_l(__s, &__sanity, __cloc);
25.65 -- if (__sanity != __s && errno != ERANGE)
25.66 -- __v = __ld;
25.67 -- else
25.68 -- __err |= ios_base::failbit;
25.69 -- }
25.70 -+ char* __sanity;
25.71 -+ errno = 0;
25.72 -+ long double __ld = __strtold_l(__s, &__sanity, __cloc);
25.73 -+ if (__sanity != __s && errno != ERANGE)
25.74 -+ __v = __ld;
25.75 -+ else
25.76 -+ __err |= ios_base::failbit;
25.77 - }
25.78 -
25.79 - void
25.80 -@@ -110,7 +101,7 @@
25.81 - void
25.82 - locale::facet::_S_destroy_c_locale(__c_locale& __cloc)
25.83 - {
25.84 -- if (_S_get_c_locale() != __cloc)
25.85 -+ if (__cloc && _S_get_c_locale() != __cloc)
25.86 - __freelocale(__cloc);
25.87 - }
25.88 -
25.89 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h
25.90 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:47.000000000 +0200
25.91 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/c_locale.h 2008-06-10 14:58:51.000000000 +0200
25.92 -@@ -39,21 +39,23 @@
25.93 - #pragma GCC system_header
25.94 -
25.95 - #include <cstring> // get std::strlen
25.96 --#include <cstdio> // get std::snprintf or std::sprintf
25.97 -+#include <cstdio> // get std::vsnprintf or std::vsprintf
25.98 - #include <clocale>
25.99 - #include <langinfo.h> // For codecvt
25.100 - #ifdef __UCLIBC_MJN3_ONLY__
25.101 - #warning fix this
25.102 - #endif
25.103 --#ifdef __UCLIBC_HAS_LOCALE__
25.104 -+#ifdef _GLIBCXX_USE_ICONV
25.105 - #include <iconv.h> // For codecvt using iconv, iconv_t
25.106 - #endif
25.107 --#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__
25.108 --#include <libintl.h> // For messages
25.109 -+#ifdef HAVE_LIBINTL_H
25.110 -+#include <libintl.h> // For messages
25.111 - #endif
25.112 -+#include <cstdarg>
25.113 -
25.114 - #ifdef __UCLIBC_MJN3_ONLY__
25.115 - #warning what is _GLIBCXX_C_LOCALE_GNU for
25.116 -+// psm: used in os/gnu-linux/ctype_noninline.h
25.117 - #endif
25.118 - #define _GLIBCXX_C_LOCALE_GNU 1
25.119 -
25.120 -@@ -62,7 +64,7 @@
25.121 - #endif
25.122 - // #define _GLIBCXX_NUM_CATEGORIES 6
25.123 - #define _GLIBCXX_NUM_CATEGORIES 0
25.124 --
25.125 -+
25.126 - #ifdef __UCLIBC_HAS_XLOCALE__
25.127 - namespace __gnu_cxx
25.128 - {
25.129 -@@ -79,22 +81,24 @@
25.130 - typedef int* __c_locale;
25.131 - #endif
25.132 -
25.133 -- // Convert numeric value of type _Tv to string and return length of
25.134 -- // string. If snprintf is available use it, otherwise fall back to
25.135 -- // the unsafe sprintf which, in general, can be dangerous and should
25.136 -+ // Convert numeric value of type double to string and return length of
25.137 -+ // string. If vsnprintf is available use it, otherwise fall back to
25.138 -+ // the unsafe vsprintf which, in general, can be dangerous and should
25.139 - // be avoided.
25.140 -- template<typename _Tv>
25.141 -- int
25.142 -- __convert_from_v(char* __out,
25.143 -- const int __size __attribute__ ((__unused__)),
25.144 -- const char* __fmt,
25.145 --#ifdef __UCLIBC_HAS_XCLOCALE__
25.146 -- _Tv __v, const __c_locale& __cloc, int __prec)
25.147 -+ inline int
25.148 -+ __convert_from_v(const __c_locale&
25.149 -+#ifndef __UCLIBC_HAS_XCLOCALE__
25.150 -+ __cloc __attribute__ ((__unused__))
25.151 -+#endif
25.152 -+ ,
25.153 -+ char* __out,
25.154 -+ const int __size,
25.155 -+ const char* __fmt, ...)
25.156 - {
25.157 -+ va_list __args;
25.158 -+#ifdef __UCLIBC_HAS_XCLOCALE__
25.159 - __c_locale __old = __gnu_cxx::__uselocale(__cloc);
25.160 - #else
25.161 -- _Tv __v, const __c_locale&, int __prec)
25.162 -- {
25.163 - # ifdef __UCLIBC_HAS_LOCALE__
25.164 - char* __old = std::setlocale(LC_ALL, NULL);
25.165 - char* __sav = new char[std::strlen(__old) + 1];
25.166 -@@ -103,7 +107,9 @@
25.167 - # endif
25.168 - #endif
25.169 -
25.170 -- const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v);
25.171 -+ va_start(__args, __fmt);
25.172 -+ const int __ret = std::vsnprintf(__out, __size, __fmt, __args);
25.173 -+ va_end(__args);
25.174 -
25.175 - #ifdef __UCLIBC_HAS_XCLOCALE__
25.176 - __gnu_cxx::__uselocale(__old);
25.177 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc
25.178 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:47.000000000 +0200
25.179 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2008-06-10 14:58:51.000000000 +0200
25.180 -@@ -33,9 +33,14 @@
25.181 -
25.182 - // Written by Benjamin Kosnik <bkoz@redhat.com>
25.183 -
25.184 -+#include <features.h>
25.185 -+#ifdef __UCLIBC_HAS_LOCALE__
25.186 - #define _LIBC
25.187 - #include <locale>
25.188 - #undef _LIBC
25.189 -+#else
25.190 -+#include <locale>
25.191 -+#endif
25.192 - #include <bits/c++locale_internal.h>
25.193 -
25.194 - namespace std
25.195 -@@ -138,20 +143,34 @@
25.196 - ctype<wchar_t>::
25.197 - do_is(mask __m, wchar_t __c) const
25.198 - {
25.199 -- // Highest bitmask in ctype_base == 10, but extra in "C"
25.200 -- // library for blank.
25.201 -+ // The case of __m == ctype_base::space is particularly important,
25.202 -+ // due to its use in many istream functions. Therefore we deal with
25.203 -+ // it first, exploiting the knowledge that on GNU systems _M_bit[5]
25.204 -+ // is the mask corresponding to ctype_base::space. NB: an encoding
25.205 -+ // change would not affect correctness!
25.206 - bool __ret = false;
25.207 -- const size_t __bitmasksize = 11;
25.208 -- for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
25.209 -- if (__m & _M_bit[__bitcur]
25.210 -- && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
25.211 -- {
25.212 -- __ret = true;
25.213 -- break;
25.214 -- }
25.215 -+ if (__m == _M_bit[5])
25.216 -+ __ret = __iswctype_l(__c, _M_wmask[5], _M_c_locale_ctype);
25.217 -+ else
25.218 -+ {
25.219 -+ // Highest bitmask in ctype_base == 10, but extra in "C"
25.220 -+ // library for blank.
25.221 -+ const size_t __bitmasksize = 11;
25.222 -+ for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
25.223 -+ if (__m & _M_bit[__bitcur])
25.224 -+ {
25.225 -+ if (__iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
25.226 -+ {
25.227 -+ __ret = true;
25.228 -+ break;
25.229 -+ }
25.230 -+ else if (__m == _M_bit[__bitcur])
25.231 -+ break;
25.232 -+ }
25.233 -+ }
25.234 - return __ret;
25.235 - }
25.236 --
25.237 -+
25.238 - const wchar_t*
25.239 - ctype<wchar_t>::
25.240 - do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
25.241 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
25.242 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:47.000000000 +0200
25.243 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:51.000000000 +0200
25.244 -@@ -47,18 +47,21 @@
25.245 - template<typename _CharT>
25.246 - messages<_CharT>::messages(size_t __refs)
25.247 - : facet(__refs), _M_c_locale_messages(_S_get_c_locale()),
25.248 -- _M_name_messages(_S_get_c_name())
25.249 -+ _M_name_messages(_S_get_c_name())
25.250 - { }
25.251 -
25.252 - template<typename _CharT>
25.253 - messages<_CharT>::messages(__c_locale __cloc, const char* __s,
25.254 - size_t __refs)
25.255 -- : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)),
25.256 -- _M_name_messages(__s)
25.257 -+ : facet(__refs), _M_c_locale_messages(NULL), _M_name_messages(NULL)
25.258 - {
25.259 -- char* __tmp = new char[std::strlen(__s) + 1];
25.260 -- std::strcpy(__tmp, __s);
25.261 -+ const size_t __len = std::strlen(__s) + 1;
25.262 -+ char* __tmp = new char[__len];
25.263 -+ std::memcpy(__tmp, __s, __len);
25.264 - _M_name_messages = __tmp;
25.265 -+
25.266 -+ // Last to avoid leaking memory if new throws.
25.267 -+ _M_c_locale_messages = _S_clone_c_locale(__cloc);
25.268 - }
25.269 -
25.270 - template<typename _CharT>
25.271 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc
25.272 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200
25.273 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2008-06-10 14:58:51.000000000 +0200
25.274 -@@ -33,9 +33,14 @@
25.275 -
25.276 - // Written by Benjamin Kosnik <bkoz@redhat.com>
25.277 -
25.278 -+#include <features.h>
25.279 -+#ifdef __UCLIBC_HAS_LOCALE__
25.280 - #define _LIBC
25.281 - #include <locale>
25.282 - #undef _LIBC
25.283 -+#else
25.284 -+#include <locale>
25.285 -+#endif
25.286 - #include <bits/c++locale_internal.h>
25.287 -
25.288 - #ifdef __UCLIBC_MJN3_ONLY__
25.289 -@@ -206,7 +211,7 @@
25.290 - }
25.291 - break;
25.292 - default:
25.293 -- ;
25.294 -+ __ret = pattern();
25.295 - }
25.296 - return __ret;
25.297 - }
25.298 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc
25.299 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200
25.300 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2008-06-10 14:58:51.000000000 +0200
25.301 -@@ -33,9 +33,14 @@
25.302 -
25.303 - // Written by Benjamin Kosnik <bkoz@redhat.com>
25.304 -
25.305 -+#include <features.h>
25.306 -+#ifdef __UCLIBC_HAS_LOCALE__
25.307 - #define _LIBC
25.308 - #include <locale>
25.309 - #undef _LIBC
25.310 -+#else
25.311 -+#include <locale>
25.312 -+#endif
25.313 - #include <bits/c++locale_internal.h>
25.314 -
25.315 - #ifdef __UCLIBC_MJN3_ONLY__
25.316 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
25.317 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:43.000000000 +0200
25.318 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:51.000000000 +0200
25.319 -@@ -37,25 +37,33 @@
25.320 - template<typename _CharT>
25.321 - __timepunct<_CharT>::__timepunct(size_t __refs)
25.322 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
25.323 -- _M_name_timepunct(_S_get_c_name())
25.324 -+ _M_name_timepunct(_S_get_c_name())
25.325 - { _M_initialize_timepunct(); }
25.326 -
25.327 - template<typename _CharT>
25.328 - __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs)
25.329 - : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL),
25.330 -- _M_name_timepunct(_S_get_c_name())
25.331 -+ _M_name_timepunct(_S_get_c_name())
25.332 - { _M_initialize_timepunct(); }
25.333 -
25.334 - template<typename _CharT>
25.335 - __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s,
25.336 - size_t __refs)
25.337 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
25.338 -- _M_name_timepunct(__s)
25.339 -+ _M_name_timepunct(NULL)
25.340 - {
25.341 -- char* __tmp = new char[std::strlen(__s) + 1];
25.342 -- std::strcpy(__tmp, __s);
25.343 -+ const size_t __len = std::strlen(__s) + 1;
25.344 -+ char* __tmp = new char[__len];
25.345 -+ std::memcpy(__tmp, __s, __len);
25.346 - _M_name_timepunct = __tmp;
25.347 -- _M_initialize_timepunct(__cloc);
25.348 -+
25.349 -+ try
25.350 -+ { _M_initialize_timepunct(__cloc); }
25.351 -+ catch(...)
25.352 -+ {
25.353 -+ delete [] _M_name_timepunct;
25.354 -+ __throw_exception_again;
25.355 -+ }
25.356 - }
25.357 -
25.358 - template<typename _CharT>
26.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
26.2 +++ b/patches/gcc/4.3.1/310-arm-softfloat.patch Mon Aug 04 12:38:06 2008 +0000
26.3 @@ -0,0 +1,29 @@
26.4 +diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
26.5 +--- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
26.6 ++++ gcc-4.3.1/gcc/config/arm/linux-elf.h 2008-07-23 15:30:57.000000000 +0200
26.7 +@@ -60,7 +60,7 @@
26.8 + %{shared:-lc} \
26.9 + %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
26.10 +
26.11 +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
26.12 ++#define LIBGCC_SPEC "-lgcc"
26.13 +
26.14 + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
26.15 +
26.16 +diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
26.17 +--- gcc-4.3.1.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
26.18 ++++ gcc-4.3.1/gcc/config/arm/t-linux 2008-07-23 19:15:25.000000000 +0200
26.19 +@@ -3,7 +3,12 @@
26.20 + TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
26.21 +
26.22 + LIB1ASMSRC = arm/lib1funcs.asm
26.23 +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
26.24 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
26.25 ++ _call_via_rX _interwork_call_via_rX \
26.26 ++ _lshrdi3 _ashrdi3 _ashldi3 \
26.27 ++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
26.28 ++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
26.29 ++ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
26.30 +
26.31 + # MULTILIB_OPTIONS = mhard-float/msoft-float
26.32 + # MULTILIB_DIRNAMES = hard-float soft-float
27.1 --- a/patches/gcc/4.3.1/310-missing-execinfo_h.patch Mon Aug 04 12:09:54 2008 +0000
27.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
27.3 @@ -1,13 +0,0 @@
27.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_301-missing-execinfo_h.patch
27.5 -diff -durN gcc-4.3.1.orig/boehm-gc/include/gc.h gcc-4.3.1/boehm-gc/include/gc.h
27.6 ---- gcc-4.3.1.orig/boehm-gc/include/gc.h 2007-04-23 23:10:09.000000000 +0200
27.7 -+++ gcc-4.3.1/boehm-gc/include/gc.h 2008-06-10 14:58:54.000000000 +0200
27.8 -@@ -503,7 +503,7 @@
27.9 - #if defined(__linux__) || defined(__GLIBC__)
27.10 - # include <features.h>
27.11 - # if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1 || __GLIBC__ > 2) \
27.12 -- && !defined(__ia64__)
27.13 -+ && !defined(__ia64__) && !defined(__UCLIBC__)
27.14 - # ifndef GC_HAVE_BUILTIN_BACKTRACE
27.15 - # define GC_HAVE_BUILTIN_BACKTRACE
27.16 - # endif
28.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
28.2 +++ b/patches/gcc/4.3.1/320-alpha-signal_h.patch Mon Aug 04 12:38:06 2008 +0000
28.3 @@ -0,0 +1,17 @@
28.4 +--- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500
28.5 ++++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500
28.6 +@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */
28.7 + /* Do code reading to identify a signal frame, and set the frame
28.8 + state data appropriately. See unwind-dw2.c for the structs. */
28.9 +
28.10 ++/* Don't use this if inhibit_libc is set
28.11 ++ The build for this target will fail trying to include missing headers */
28.12 ++#ifndef inhibit_libc
28.13 + #include <signal.h>
28.14 + #include <sys/ucontext.h>
28.15 +
28.16 +@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
28.17 + fs->retaddr_column = 64;
28.18 + return _URC_NO_REASON;
28.19 + }
28.20 ++#endif /* inhibit_libc */
29.1 --- a/patches/gcc/4.3.1/320-c99-complex-ugly-hack.patch Mon Aug 04 12:09:54 2008 +0000
29.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
29.3 @@ -1,14 +0,0 @@
29.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_303-c99-complex-ugly-hack.patch
29.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/configure gcc-4.3.1/libstdc++-v3/configure
29.6 ---- gcc-4.3.1.orig/libstdc++-v3/configure 2008-06-10 14:58:43.000000000 +0200
29.7 -+++ gcc-4.3.1/libstdc++-v3/configure 2008-06-10 14:58:58.000000000 +0200
29.8 -@@ -39006,6 +39006,9 @@
29.9 - cat >>conftest.$ac_ext <<_ACEOF
29.10 - /* end confdefs.h. */
29.11 - #include <complex.h>
29.12 -+#ifdef __UCLIBC__
29.13 -+#error ugly hack to make sure configure test fails here for cross until uClibc supports the complex funcs
29.14 -+#endif
29.15 - int
29.16 - main ()
29.17 - {
30.1 --- a/patches/gcc/4.3.1/330-index_macro.patch Mon Aug 04 12:09:54 2008 +0000
30.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
30.3 @@ -1,27 +0,0 @@
30.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_304-index_macro.patch
30.5 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/rope gcc-4.3.1/libstdc++-v3/include/ext/rope
30.6 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/rope 2008-01-31 19:44:55.000000000 +0100
30.7 -+++ gcc-4.3.1/libstdc++-v3/include/ext/rope 2008-06-10 14:59:02.000000000 +0200
30.8 -@@ -59,6 +59,9 @@
30.9 - #include <bits/gthr.h>
30.10 - #include <tr1/functional>
30.11 -
30.12 -+/* cope w/ index defined as macro, SuSv3 proposal */
30.13 -+#undef index
30.14 -+
30.15 - # ifdef __GC
30.16 - # define __GC_CONST const
30.17 - # else
30.18 -diff -durN gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h
30.19 ---- gcc-4.3.1.orig/libstdc++-v3/include/ext/ropeimpl.h 2007-05-04 17:06:46.000000000 +0200
30.20 -+++ gcc-4.3.1/libstdc++-v3/include/ext/ropeimpl.h 2008-06-10 14:59:02.000000000 +0200
30.21 -@@ -54,6 +54,9 @@
30.22 - #include <ext/memory> // For uninitialized_copy_n
30.23 - #include <ext/numeric> // For power
30.24 -
30.25 -+/* cope w/ index defined as macro, SuSv3 proposal */
30.26 -+#undef index
30.27 -+
30.28 - _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
30.29 -
30.30 - using std::size_t;
31.1 --- a/patches/gcc/4.3.1/340-libmudflap-susv3-legacy.patch Mon Aug 04 12:09:54 2008 +0000
31.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
31.3 @@ -1,49 +0,0 @@
31.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_305-libmudflap-susv3-legacy.patch
31.5 -diff -durN gcc-4.3.1.orig/libmudflap/mf-hooks2.c gcc-4.3.1/libmudflap/mf-hooks2.c
31.6 ---- gcc-4.3.1.orig/libmudflap/mf-hooks2.c 2005-09-23 23:58:39.000000000 +0200
31.7 -+++ gcc-4.3.1/libmudflap/mf-hooks2.c 2008-06-10 14:59:05.000000000 +0200
31.8 -@@ -427,7 +427,7 @@
31.9 - {
31.10 - TRACE ("%s\n", __PRETTY_FUNCTION__);
31.11 - MF_VALIDATE_EXTENT(s, n, __MF_CHECK_WRITE, "bzero region");
31.12 -- bzero (s, n);
31.13 -+ memset (s, 0, n);
31.14 - }
31.15 -
31.16 -
31.17 -@@ -437,7 +437,7 @@
31.18 - TRACE ("%s\n", __PRETTY_FUNCTION__);
31.19 - MF_VALIDATE_EXTENT(src, n, __MF_CHECK_READ, "bcopy src");
31.20 - MF_VALIDATE_EXTENT(dest, n, __MF_CHECK_WRITE, "bcopy dest");
31.21 -- bcopy (src, dest, n);
31.22 -+ memmove (dest, src, n);
31.23 - }
31.24 -
31.25 -
31.26 -@@ -447,7 +447,7 @@
31.27 - TRACE ("%s\n", __PRETTY_FUNCTION__);
31.28 - MF_VALIDATE_EXTENT(s1, n, __MF_CHECK_READ, "bcmp 1st arg");
31.29 - MF_VALIDATE_EXTENT(s2, n, __MF_CHECK_READ, "bcmp 2nd arg");
31.30 -- return bcmp (s1, s2, n);
31.31 -+ return memcmp (s1, s2, n);
31.32 - }
31.33 -
31.34 -
31.35 -@@ -456,7 +456,7 @@
31.36 - size_t n = strlen (s);
31.37 - TRACE ("%s\n", __PRETTY_FUNCTION__);
31.38 - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "index region");
31.39 -- return index (s, c);
31.40 -+ return strchr (s, c);
31.41 - }
31.42 -
31.43 -
31.44 -@@ -465,7 +465,7 @@
31.45 - size_t n = strlen (s);
31.46 - TRACE ("%s\n", __PRETTY_FUNCTION__);
31.47 - MF_VALIDATE_EXTENT(s, CLAMPADD(n, 1), __MF_CHECK_READ, "rindex region");
31.48 -- return rindex (s, c);
31.49 -+ return strrchr (s, c);
31.50 - }
31.51 -
31.52 - /* XXX: stpcpy, memccpy */
32.1 --- a/patches/gcc/4.3.1/350-libstdc++-namespace.patch Mon Aug 04 12:09:54 2008 +0000
32.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
32.3 @@ -1,38 +0,0 @@
32.4 -Original patch from gentoo: gentoo/src/patchsets/gcc/4.3.1/uclibc/90_all_306-libstdc++-namespace.patch
32.5 -diff -rup gcc-4.2.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.2/libstdc++-v3/config/locale/uclibc/messages_members.h
32.6 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h
32.7 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:58:54.000000000 +0200
32.8 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/messages_members.h 2008-06-10 14:59:09.000000000 +0200
32.9 -@@ -32,7 +32,8 @@
32.10 - //
32.11 -
32.12 - // Written by Benjamin Kosnik <bkoz@redhat.com>
32.13 --
32.14 -+namespace std
32.15 -+{
32.16 - #ifdef __UCLIBC_MJN3_ONLY__
32.17 - #warning fix prototypes for *textdomain funcs
32.18 - #endif
32.19 -@@ -115,3 +116,4 @@
32.20 - this->_S_create_c_locale(this->_M_c_locale_messages, __s);
32.21 - }
32.22 - }
32.23 -+}
32.24 -diff -durN gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h
32.25 ---- gcc-4.3.1.orig/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:58:54.000000000 +0200
32.26 -+++ gcc-4.3.1/libstdc++-v3/config/locale/uclibc/time_members.h 2008-06-10 14:59:09.000000000 +0200
32.27 -@@ -33,7 +33,8 @@
32.28 - //
32.29 -
32.30 - // Written by Benjamin Kosnik <bkoz@redhat.com>
32.31 --
32.32 -+namespace std
32.33 -+{
32.34 - template<typename _CharT>
32.35 - __timepunct<_CharT>::__timepunct(size_t __refs)
32.36 - : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL),
32.37 -@@ -74,3 +75,4 @@
32.38 - delete _M_data;
32.39 - _S_destroy_c_locale(_M_c_locale_timepunct);
32.40 - }
32.41 -+}
33.1 --- a/patches/gcc/4.3.1/360-arm-softfloat.patch Mon Aug 04 12:09:54 2008 +0000
33.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
33.3 @@ -1,29 +0,0 @@
33.4 -diff -durN gcc-4.3.1.orig/gcc/config/arm/linux-elf.h gcc-4.3.1/gcc/config/arm/linux-elf.h
33.5 ---- gcc-4.3.1.orig/gcc/config/arm/linux-elf.h 2007-11-08 14:44:09.000000000 +0100
33.6 -+++ gcc-4.3.1/gcc/config/arm/linux-elf.h 2008-07-23 15:30:57.000000000 +0200
33.7 -@@ -60,7 +60,7 @@
33.8 - %{shared:-lc} \
33.9 - %{!shared:%{profile:-lc_p}%{!profile:-lc}}"
33.10 -
33.11 --#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
33.12 -+#define LIBGCC_SPEC "-lgcc"
33.13 -
33.14 - #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
33.15 -
33.16 -diff -durN gcc-4.3.1.orig/gcc/config/arm/t-linux gcc-4.3.1/gcc/config/arm/t-linux
33.17 ---- gcc-4.3.1.orig/gcc/config/arm/t-linux 2006-11-09 23:14:27.000000000 +0100
33.18 -+++ gcc-4.3.1/gcc/config/arm/t-linux 2008-07-23 19:15:25.000000000 +0200
33.19 -@@ -3,7 +3,12 @@
33.20 - TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC
33.21 -
33.22 - LIB1ASMSRC = arm/lib1funcs.asm
33.23 --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx
33.24 -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_tls _bb_init_func \
33.25 -+ _call_via_rX _interwork_call_via_rX \
33.26 -+ _lshrdi3 _ashrdi3 _ashldi3 \
33.27 -+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \
33.28 -+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \
33.29 -+ _fixsfsi _fixunssfsi _floatdidf _floatdisf _floatundidf _floatundisf
33.30 -
33.31 - # MULTILIB_OPTIONS = mhard-float/msoft-float
33.32 - # MULTILIB_DIRNAMES = hard-float soft-float
34.1 --- a/patches/gcc/4.3.1/370-alpha-signal_h.patch Mon Aug 04 12:09:54 2008 +0000
34.2 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000
34.3 @@ -1,17 +0,0 @@
34.4 ---- gcc-4.2.1-stock/gcc/config/alpha/linux-unwind.h 2005-06-24 20:22:41.000000000 -0500
34.5 -+++ gcc-4.2.1/gcc/config/alpha/linux-unwind.h 2007-09-01 20:21:34.000000000 -0500
34.6 -@@ -29,6 +29,9 @@ Boston, MA 02110-1301, USA. */
34.7 - /* Do code reading to identify a signal frame, and set the frame
34.8 - state data appropriately. See unwind-dw2.c for the structs. */
34.9 -
34.10 -+/* Don't use this if inhibit_libc is set
34.11 -+ The build for this target will fail trying to include missing headers */
34.12 -+#ifndef inhibit_libc
34.13 - #include <signal.h>
34.14 - #include <sys/ucontext.h>
34.15 -
34.16 -@@ -80,3 +83,4 @@ alpha_fallback_frame_state (struct _Unwi
34.17 - fs->retaddr_column = 64;
34.18 - return _URC_NO_REASON;
34.19 - }
34.20 -+#endif /* inhibit_libc */
35.1 --- a/scripts/build/cc_gcc.sh Mon Aug 04 12:09:54 2008 +0000
35.2 +++ b/scripts/build/cc_gcc.sh Mon Aug 04 12:38:06 2008 +0000
35.3 @@ -90,16 +90,67 @@
35.4 --enable-target-optspace \
35.5 ${CT_CC_CORE_EXTRA_CONFIG}
35.6
35.7 + # HACK: we need to override SHLIB_LC from gcc/config/t-slibgcc-elf-ver or
35.8 + # gcc/config/t-libunwind so -lc is removed from the link for
35.9 + # libgcc_s.so, as we do not have a target -lc yet.
35.10 + # This is not as ugly as it appears to be ;-) All symbols get resolved
35.11 + # during the glibc build, and we provide a proper libgcc_s.so for the
35.12 + # cross toolchain during the final gcc build.
35.13 + #
35.14 + # As we cannot modify the source tree, nor override SHLIB_LC itself
35.15 + # during configure or make, we have to edit the resultant
35.16 + # gcc/libgcc.mk itself to remove -lc from the link.
35.17 + # This causes us to have to jump through some hoops...
35.18 + #
35.19 + # To produce libgcc.mk to edit we firstly require libiberty.a,
35.20 + # so we configure then build it.
35.21 + # Next we have to configure gcc, create libgcc.mk then edit it...
35.22 + # So much easier if we just edit the source tree, but hey...
35.23 + if [ ! -f "${CT_SRC_DIR}/${CT_CC_FILE}/gcc/BASE-VER" ]; then
35.24 + CT_DoExecLog ALL make configure-libiberty
35.25 + CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libiberty libiberty.a
35.26 + CT_DoExecLog ALL make configure-gcc configure-libcpp
35.27 + CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp
35.28 + else
35.29 + CT_DoExecLog ALL make configure-gcc configure-libcpp configure-build-libiberty
35.30 + CT_DoExecLog ALL make ${PARALLELMFLAGS} all-libcpp all-build-libiberty
35.31 + fi
35.32 + # HACK: gcc-4.2 uses libdecnumber to build libgcc.mk, so build it here.
35.33 + if [ -d "${CT_SRC_DIR}/${CT_CC_FILE}/libdecnumber" ]; then
35.34 + CT_DoExecLog ALL make configure-libdecnumber
35.35 + CT_DoExecLog ALL make ${PARALLELMFLAGS} -C libdecnumber libdecnumber.a
35.36 + fi
35.37 +
35.38 + # Starting with GCC 4.3, libgcc.mk is no longer built,
35.39 + # and libgcc.mvars is used instead.
35.40 +
35.41 + gcc_version_major=$(echo ${CT_CC_VERSION} |sed -r -e 's/^([^\.]+)\..*/\1/')
35.42 + gcc_version_minor=$(echo ${CT_CC_VERSION} |sed -r -e 's/^[^\.]+\.([^.]+).*/\1/')
35.43 +
35.44 + if [ ${gcc_version_major} -eq 4 -a ${gcc_version_minor} -ge 3 \
35.45 + -o ${gcc_version_major} -gt 4 ]; then
35.46 + libgcc_rule="libgcc.mvars"
35.47 + build_rules="all-gcc all-target-libgcc"
35.48 + install_rules="install-gcc install-target-libgcc"
35.49 + else
35.50 + libgcc_rule="libgcc.mk"
35.51 + build_rules="all-gcc"
35.52 + install_rules="install-gcc"
35.53 + fi
35.54 +
35.55 + CT_DoExecLog ALL make ${PARALLELMFLAGS} -C gcc ${libgcc_rule}
35.56 + sed -r -i -e 's@-lc@@g' gcc/${libgcc_rule}
35.57 +
35.58 if [ "${CT_CANADIAN}" = "y" ]; then
35.59 CT_DoLog EXTRA "Building libiberty"
35.60 CT_DoExecLog ALL make ${PARALLELMFLAGS} all-build-libiberty
35.61 fi
35.62
35.63 CT_DoLog EXTRA "Building static core C compiler"
35.64 - CT_DoExecLog ALL make ${PARALLELMFLAGS} all-gcc
35.65 + CT_DoExecLog ALL make ${PARALLELMFLAGS} ${build_rules}
35.66
35.67 CT_DoLog EXTRA "Installing static core C compiler"
35.68 - CT_DoExecLog ALL make install-gcc
35.69 + CT_DoExecLog ALL make ${install_rules}
35.70
35.71 CT_EndStep
35.72 }