diff options
Diffstat (limited to 'openembedded/packages/gcc/gcc-4.0.2/200-uclibc-locale.patch')
| -rw-r--r-- | openembedded/packages/gcc/gcc-4.0.2/200-uclibc-locale.patch | 3240 |
1 files changed, 3240 insertions, 0 deletions
diff --git a/openembedded/packages/gcc/gcc-4.0.2/200-uclibc-locale.patch b/openembedded/packages/gcc/gcc-4.0.2/200-uclibc-locale.patch new file mode 100644 index 0000000000..8be03a5446 --- /dev/null +++ b/openembedded/packages/gcc/gcc-4.0.2/200-uclibc-locale.patch | |||
| @@ -0,0 +1,3240 @@ | |||
| 1 | From: | ||
| 2 | http://buildroot.uclibc.org/cgi-bin/viewcvs.cgi/*checkout*/trunk/buildroot/toolchain/gcc/4.0.2/200-uclibc-locale.patch?rev=11715 | ||
| 3 | |||
| 4 | diff -urN gcc-4.0.0-100/libstdc++-v3/acinclude.m4 gcc-4.0.0/libstdc++-v3/acinclude.m4 | ||
| 5 | --- gcc-4.0.0-100/libstdc++-v3/acinclude.m4 2005-04-30 13:06:53.000000000 -0500 | ||
| 6 | +++ gcc-4.0.0/libstdc++-v3/acinclude.m4 2005-04-28 20:19:01.000000000 -0500 | ||
| 7 | @@ -1104,7 +1104,7 @@ | ||
| 8 | AC_MSG_CHECKING([for C locale to use]) | ||
| 9 | GLIBCXX_ENABLE(clocale,auto,[@<:@=MODEL@:>@], | ||
| 10 | [use MODEL for target locale package], | ||
| 11 | - [permit generic|gnu|ieee_1003.1-2001|yes|no|auto]) | ||
| 12 | + [permit generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto]) | ||
| 13 | |||
| 14 | # If they didn't use this option switch, or if they specified --enable | ||
| 15 | # with no specific model, we'll have to look for one. If they | ||
| 16 | @@ -1120,6 +1120,9 @@ | ||
| 17 | # Default to "generic". | ||
| 18 | if test $enable_clocale_flag = auto; then | ||
| 19 | case ${target_os} in | ||
| 20 | + *-uclibc*) | ||
| 21 | + enable_clocale_flag=uclibc | ||
| 22 | + ;; | ||
| 23 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
| 24 | AC_EGREP_CPP([_GLIBCXX_ok], [ | ||
| 25 | #include <features.h> | ||
| 26 | @@ -1263,6 +1266,40 @@ | ||
| 27 | CTIME_CC=config/locale/generic/time_members.cc | ||
| 28 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
| 29 | ;; | ||
| 30 | + uclibc) | ||
| 31 | + AC_MSG_RESULT(uclibc) | ||
| 32 | + | ||
| 33 | + # Declare intention to use gettext, and add support for specific | ||
| 34 | + # languages. | ||
| 35 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
| 36 | + ALL_LINGUAS="de fr" | ||
| 37 | + | ||
| 38 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
| 39 | + AC_CHECK_PROG(check_msgfmt, msgfmt, yes, no) | ||
| 40 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
| 41 | + USE_NLS=yes | ||
| 42 | + fi | ||
| 43 | + # Export the build objects. | ||
| 44 | + for ling in $ALL_LINGUAS; do \ | ||
| 45 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
| 46 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
| 47 | + done | ||
| 48 | + AC_SUBST(glibcxx_MOFILES) | ||
| 49 | + AC_SUBST(glibcxx_POFILES) | ||
| 50 | + | ||
| 51 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
| 52 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
| 53 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
| 54 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
| 55 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
| 56 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
| 57 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
| 58 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
| 59 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
| 60 | + CTIME_H=config/locale/uclibc/time_members.h | ||
| 61 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
| 62 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
| 63 | + ;; | ||
| 64 | esac | ||
| 65 | |||
| 66 | # This is where the testsuite looks for locale catalogs, using the | ||
| 67 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h | ||
| 68 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 69 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c++locale_internal.h 2005-04-28 01:13:15.000000000 -0500 | ||
| 70 | @@ -0,0 +1,59 @@ | ||
| 71 | +// Prototypes for GLIBC thread locale __-prefixed functions -*- C++ -*- | ||
| 72 | + | ||
| 73 | +// Copyright (C) 2002, 2004 Free Software Foundation, Inc. | ||
| 74 | +// | ||
| 75 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 76 | +// software; you can redistribute it and/or modify it under the | ||
| 77 | +// terms of the GNU General Public License as published by the | ||
| 78 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 79 | +// any later version. | ||
| 80 | + | ||
| 81 | +// This library is distributed in the hope that it will be useful, | ||
| 82 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 83 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 84 | +// GNU General Public License for more details. | ||
| 85 | + | ||
| 86 | +// You should have received a copy of the GNU General Public License along | ||
| 87 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 88 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 89 | +// USA. | ||
| 90 | + | ||
| 91 | +// As a special exception, you may use this file as part of a free software | ||
| 92 | +// library without restriction. Specifically, if other files instantiate | ||
| 93 | +// templates or use macros or inline functions from this file, or you compile | ||
| 94 | +// this file and link it with other files to produce an executable, this | ||
| 95 | +// file does not by itself cause the resulting executable to be covered by | ||
| 96 | +// the GNU General Public License. This exception does not however | ||
| 97 | +// invalidate any other reasons why the executable file might be covered by | ||
| 98 | +// the GNU General Public License. | ||
| 99 | + | ||
| 100 | +// Written by Jakub Jelinek <jakub@redhat.com> | ||
| 101 | + | ||
| 102 | +#include <clocale> | ||
| 103 | + | ||
| 104 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 105 | +#warning clean this up | ||
| 106 | +#endif | ||
| 107 | + | ||
| 108 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 109 | + | ||
| 110 | +extern "C" __typeof(iswctype_l) __iswctype_l; | ||
| 111 | +extern "C" __typeof(nl_langinfo_l) __nl_langinfo_l; | ||
| 112 | +extern "C" __typeof(strcoll_l) __strcoll_l; | ||
| 113 | +extern "C" __typeof(strftime_l) __strftime_l; | ||
| 114 | +extern "C" __typeof(strtod_l) __strtod_l; | ||
| 115 | +extern "C" __typeof(strtof_l) __strtof_l; | ||
| 116 | +extern "C" __typeof(strtold_l) __strtold_l; | ||
| 117 | +extern "C" __typeof(strxfrm_l) __strxfrm_l; | ||
| 118 | +extern "C" __typeof(towlower_l) __towlower_l; | ||
| 119 | +extern "C" __typeof(towupper_l) __towupper_l; | ||
| 120 | +extern "C" __typeof(wcscoll_l) __wcscoll_l; | ||
| 121 | +extern "C" __typeof(wcsftime_l) __wcsftime_l; | ||
| 122 | +extern "C" __typeof(wcsxfrm_l) __wcsxfrm_l; | ||
| 123 | +extern "C" __typeof(wctype_l) __wctype_l; | ||
| 124 | +extern "C" __typeof(newlocale) __newlocale; | ||
| 125 | +extern "C" __typeof(freelocale) __freelocale; | ||
| 126 | +extern "C" __typeof(duplocale) __duplocale; | ||
| 127 | +extern "C" __typeof(uselocale) __uselocale; | ||
| 128 | + | ||
| 129 | +#endif // GLIBC 2.3 and later | ||
| 130 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc | ||
| 131 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 132 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 133 | @@ -0,0 +1,160 @@ | ||
| 134 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
| 135 | + | ||
| 136 | +// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. | ||
| 137 | +// | ||
| 138 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 139 | +// software; you can redistribute it and/or modify it under the | ||
| 140 | +// terms of the GNU General Public License as published by the | ||
| 141 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 142 | +// any later version. | ||
| 143 | + | ||
| 144 | +// This library is distributed in the hope that it will be useful, | ||
| 145 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 146 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 147 | +// GNU General Public License for more details. | ||
| 148 | + | ||
| 149 | +// You should have received a copy of the GNU General Public License along | ||
| 150 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 151 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 152 | +// USA. | ||
| 153 | + | ||
| 154 | +// As a special exception, you may use this file as part of a free software | ||
| 155 | +// library without restriction. Specifically, if other files instantiate | ||
| 156 | +// templates or use macros or inline functions from this file, or you compile | ||
| 157 | +// this file and link it with other files to produce an executable, this | ||
| 158 | +// file does not by itself cause the resulting executable to be covered by | ||
| 159 | +// the GNU General Public License. This exception does not however | ||
| 160 | +// invalidate any other reasons why the executable file might be covered by | ||
| 161 | +// the GNU General Public License. | ||
| 162 | + | ||
| 163 | +// | ||
| 164 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
| 165 | +// | ||
| 166 | + | ||
| 167 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 168 | + | ||
| 169 | +#include <cerrno> // For errno | ||
| 170 | +#include <locale> | ||
| 171 | +#include <stdexcept> | ||
| 172 | +#include <langinfo.h> | ||
| 173 | +#include <bits/c++locale_internal.h> | ||
| 174 | + | ||
| 175 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 176 | +#define __strtol_l(S, E, B, L) strtol((S), (E), (B)) | ||
| 177 | +#define __strtoul_l(S, E, B, L) strtoul((S), (E), (B)) | ||
| 178 | +#define __strtoll_l(S, E, B, L) strtoll((S), (E), (B)) | ||
| 179 | +#define __strtoull_l(S, E, B, L) strtoull((S), (E), (B)) | ||
| 180 | +#define __strtof_l(S, E, L) strtof((S), (E)) | ||
| 181 | +#define __strtod_l(S, E, L) strtod((S), (E)) | ||
| 182 | +#define __strtold_l(S, E, L) strtold((S), (E)) | ||
| 183 | +#warning should dummy __newlocale check for C|POSIX ? | ||
| 184 | +#define __newlocale(a, b, c) NULL | ||
| 185 | +#define __freelocale(a) ((void)0) | ||
| 186 | +#define __duplocale(a) __c_locale() | ||
| 187 | +#endif | ||
| 188 | + | ||
| 189 | +namespace std | ||
| 190 | +{ | ||
| 191 | + template<> | ||
| 192 | + void | ||
| 193 | + __convert_to_v(const char* __s, float& __v, ios_base::iostate& __err, | ||
| 194 | + const __c_locale& __cloc) | ||
| 195 | + { | ||
| 196 | + if (!(__err & ios_base::failbit)) | ||
| 197 | + { | ||
| 198 | + char* __sanity; | ||
| 199 | + errno = 0; | ||
| 200 | + float __f = __strtof_l(__s, &__sanity, __cloc); | ||
| 201 | + if (__sanity != __s && errno != ERANGE) | ||
| 202 | + __v = __f; | ||
| 203 | + else | ||
| 204 | + __err |= ios_base::failbit; | ||
| 205 | + } | ||
| 206 | + } | ||
| 207 | + | ||
| 208 | + template<> | ||
| 209 | + void | ||
| 210 | + __convert_to_v(const char* __s, double& __v, ios_base::iostate& __err, | ||
| 211 | + const __c_locale& __cloc) | ||
| 212 | + { | ||
| 213 | + if (!(__err & ios_base::failbit)) | ||
| 214 | + { | ||
| 215 | + char* __sanity; | ||
| 216 | + errno = 0; | ||
| 217 | + double __d = __strtod_l(__s, &__sanity, __cloc); | ||
| 218 | + if (__sanity != __s && errno != ERANGE) | ||
| 219 | + __v = __d; | ||
| 220 | + else | ||
| 221 | + __err |= ios_base::failbit; | ||
| 222 | + } | ||
| 223 | + } | ||
| 224 | + | ||
| 225 | + template<> | ||
| 226 | + void | ||
| 227 | + __convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err, | ||
| 228 | + const __c_locale& __cloc) | ||
| 229 | + { | ||
| 230 | + if (!(__err & ios_base::failbit)) | ||
| 231 | + { | ||
| 232 | + char* __sanity; | ||
| 233 | + errno = 0; | ||
| 234 | + long double __ld = __strtold_l(__s, &__sanity, __cloc); | ||
| 235 | + if (__sanity != __s && errno != ERANGE) | ||
| 236 | + __v = __ld; | ||
| 237 | + else | ||
| 238 | + __err |= ios_base::failbit; | ||
| 239 | + } | ||
| 240 | + } | ||
| 241 | + | ||
| 242 | + void | ||
| 243 | + locale::facet::_S_create_c_locale(__c_locale& __cloc, const char* __s, | ||
| 244 | + __c_locale __old) | ||
| 245 | + { | ||
| 246 | + __cloc = __newlocale(1 << LC_ALL, __s, __old); | ||
| 247 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 248 | + if (!__cloc) | ||
| 249 | + { | ||
| 250 | + // This named locale is not supported by the underlying OS. | ||
| 251 | + __throw_runtime_error(__N("locale::facet::_S_create_c_locale " | ||
| 252 | + "name not valid")); | ||
| 253 | + } | ||
| 254 | +#endif | ||
| 255 | + } | ||
| 256 | + | ||
| 257 | + void | ||
| 258 | + locale::facet::_S_destroy_c_locale(__c_locale& __cloc) | ||
| 259 | + { | ||
| 260 | + if (_S_get_c_locale() != __cloc) | ||
| 261 | + __freelocale(__cloc); | ||
| 262 | + } | ||
| 263 | + | ||
| 264 | + __c_locale | ||
| 265 | + locale::facet::_S_clone_c_locale(__c_locale& __cloc) | ||
| 266 | + { return __duplocale(__cloc); } | ||
| 267 | +} // namespace std | ||
| 268 | + | ||
| 269 | +namespace __gnu_cxx | ||
| 270 | +{ | ||
| 271 | + const char* const category_names[6 + _GLIBCXX_NUM_CATEGORIES] = | ||
| 272 | + { | ||
| 273 | + "LC_CTYPE", | ||
| 274 | + "LC_NUMERIC", | ||
| 275 | + "LC_TIME", | ||
| 276 | + "LC_COLLATE", | ||
| 277 | + "LC_MONETARY", | ||
| 278 | + "LC_MESSAGES", | ||
| 279 | +#if _GLIBCXX_NUM_CATEGORIES != 0 | ||
| 280 | + "LC_PAPER", | ||
| 281 | + "LC_NAME", | ||
| 282 | + "LC_ADDRESS", | ||
| 283 | + "LC_TELEPHONE", | ||
| 284 | + "LC_MEASUREMENT", | ||
| 285 | + "LC_IDENTIFICATION" | ||
| 286 | +#endif | ||
| 287 | + }; | ||
| 288 | +} | ||
| 289 | + | ||
| 290 | +namespace std | ||
| 291 | +{ | ||
| 292 | + const char* const* const locale::_S_categories = __gnu_cxx::category_names; | ||
| 293 | +} // namespace std | ||
| 294 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h | ||
| 295 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/c_locale.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 296 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/c_locale.h 2005-04-28 01:13:15.000000000 -0500 | ||
| 297 | @@ -0,0 +1,115 @@ | ||
| 298 | +// Wrapper for underlying C-language localization -*- C++ -*- | ||
| 299 | + | ||
| 300 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 301 | +// | ||
| 302 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 303 | +// software; you can redistribute it and/or modify it under the | ||
| 304 | +// terms of the GNU General Public License as published by the | ||
| 305 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 306 | +// any later version. | ||
| 307 | + | ||
| 308 | +// This library is distributed in the hope that it will be useful, | ||
| 309 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 310 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 311 | +// GNU General Public License for more details. | ||
| 312 | + | ||
| 313 | +// You should have received a copy of the GNU General Public License along | ||
| 314 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 315 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 316 | +// USA. | ||
| 317 | + | ||
| 318 | +// As a special exception, you may use this file as part of a free software | ||
| 319 | +// library without restriction. Specifically, if other files instantiate | ||
| 320 | +// templates or use macros or inline functions from this file, or you compile | ||
| 321 | +// this file and link it with other files to produce an executable, this | ||
| 322 | +// file does not by itself cause the resulting executable to be covered by | ||
| 323 | +// the GNU General Public License. This exception does not however | ||
| 324 | +// invalidate any other reasons why the executable file might be covered by | ||
| 325 | +// the GNU General Public License. | ||
| 326 | + | ||
| 327 | +// | ||
| 328 | +// ISO C++ 14882: 22.8 Standard locale categories. | ||
| 329 | +// | ||
| 330 | + | ||
| 331 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 332 | + | ||
| 333 | +#ifndef _C_LOCALE_H | ||
| 334 | +#define _C_LOCALE_H 1 | ||
| 335 | + | ||
| 336 | +#pragma GCC system_header | ||
| 337 | + | ||
| 338 | +#include <cstring> // get std::strlen | ||
| 339 | +#include <cstdio> // get std::snprintf or std::sprintf | ||
| 340 | +#include <clocale> | ||
| 341 | +#include <langinfo.h> // For codecvt | ||
| 342 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 343 | +#warning fix this | ||
| 344 | +#endif | ||
| 345 | +#ifdef __UCLIBC_HAS_LOCALE__ | ||
| 346 | +#include <iconv.h> // For codecvt using iconv, iconv_t | ||
| 347 | +#endif | ||
| 348 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
| 349 | +#include <libintl.h> // For messages | ||
| 350 | +#endif | ||
| 351 | + | ||
| 352 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 353 | +#warning what is _GLIBCXX_C_LOCALE_GNU for | ||
| 354 | +#endif | ||
| 355 | +#define _GLIBCXX_C_LOCALE_GNU 1 | ||
| 356 | + | ||
| 357 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 358 | +#warning fix categories | ||
| 359 | +#endif | ||
| 360 | +// #define _GLIBCXX_NUM_CATEGORIES 6 | ||
| 361 | +#define _GLIBCXX_NUM_CATEGORIES 0 | ||
| 362 | + | ||
| 363 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 364 | +namespace __gnu_cxx | ||
| 365 | +{ | ||
| 366 | + extern "C" __typeof(uselocale) __uselocale; | ||
| 367 | +} | ||
| 368 | +#endif | ||
| 369 | + | ||
| 370 | +namespace std | ||
| 371 | +{ | ||
| 372 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 373 | + typedef __locale_t __c_locale; | ||
| 374 | +#else | ||
| 375 | + typedef int* __c_locale; | ||
| 376 | +#endif | ||
| 377 | + | ||
| 378 | + // Convert numeric value of type _Tv to string and return length of | ||
| 379 | + // string. If snprintf is available use it, otherwise fall back to | ||
| 380 | + // the unsafe sprintf which, in general, can be dangerous and should | ||
| 381 | + // be avoided. | ||
| 382 | + template<typename _Tv> | ||
| 383 | + int | ||
| 384 | + __convert_from_v(char* __out, const int __size, const char* __fmt, | ||
| 385 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 386 | + _Tv __v, const __c_locale& __cloc, int __prec) | ||
| 387 | + { | ||
| 388 | + __c_locale __old = __gnu_cxx::__uselocale(__cloc); | ||
| 389 | +#else | ||
| 390 | + _Tv __v, const __c_locale&, int __prec) | ||
| 391 | + { | ||
| 392 | +# ifdef __UCLIBC_HAS_LOCALE__ | ||
| 393 | + char* __old = std::setlocale(LC_ALL, NULL); | ||
| 394 | + char* __sav = new char[std::strlen(__old) + 1]; | ||
| 395 | + std::strcpy(__sav, __old); | ||
| 396 | + std::setlocale(LC_ALL, "C"); | ||
| 397 | +# endif | ||
| 398 | +#endif | ||
| 399 | + | ||
| 400 | + const int __ret = std::snprintf(__out, __size, __fmt, __prec, __v); | ||
| 401 | + | ||
| 402 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 403 | + __gnu_cxx::__uselocale(__old); | ||
| 404 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
| 405 | + std::setlocale(LC_ALL, __sav); | ||
| 406 | + delete [] __sav; | ||
| 407 | +#endif | ||
| 408 | + return __ret; | ||
| 409 | + } | ||
| 410 | +} | ||
| 411 | + | ||
| 412 | +#endif | ||
| 413 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc | ||
| 414 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 415 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/codecvt_members.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 416 | @@ -0,0 +1,306 @@ | ||
| 417 | +// std::codecvt implementation details, GNU version -*- C++ -*- | ||
| 418 | + | ||
| 419 | +// Copyright (C) 2002, 2003 Free Software Foundation, Inc. | ||
| 420 | +// | ||
| 421 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 422 | +// software; you can redistribute it and/or modify it under the | ||
| 423 | +// terms of the GNU General Public License as published by the | ||
| 424 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 425 | +// any later version. | ||
| 426 | + | ||
| 427 | +// This library is distributed in the hope that it will be useful, | ||
| 428 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 429 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 430 | +// GNU General Public License for more details. | ||
| 431 | + | ||
| 432 | +// You should have received a copy of the GNU General Public License along | ||
| 433 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 434 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 435 | +// USA. | ||
| 436 | + | ||
| 437 | +// As a special exception, you may use this file as part of a free software | ||
| 438 | +// library without restriction. Specifically, if other files instantiate | ||
| 439 | +// templates or use macros or inline functions from this file, or you compile | ||
| 440 | +// this file and link it with other files to produce an executable, this | ||
| 441 | +// file does not by itself cause the resulting executable to be covered by | ||
| 442 | +// the GNU General Public License. This exception does not however | ||
| 443 | +// invalidate any other reasons why the executable file might be covered by | ||
| 444 | +// the GNU General Public License. | ||
| 445 | + | ||
| 446 | +// | ||
| 447 | +// ISO C++ 14882: 22.2.1.5 - Template class codecvt | ||
| 448 | +// | ||
| 449 | + | ||
| 450 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 451 | + | ||
| 452 | +#include <locale> | ||
| 453 | +#include <bits/c++locale_internal.h> | ||
| 454 | + | ||
| 455 | +namespace std | ||
| 456 | +{ | ||
| 457 | + // Specializations. | ||
| 458 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 459 | + codecvt_base::result | ||
| 460 | + codecvt<wchar_t, char, mbstate_t>:: | ||
| 461 | + do_out(state_type& __state, const intern_type* __from, | ||
| 462 | + const intern_type* __from_end, const intern_type*& __from_next, | ||
| 463 | + extern_type* __to, extern_type* __to_end, | ||
| 464 | + extern_type*& __to_next) const | ||
| 465 | + { | ||
| 466 | + result __ret = ok; | ||
| 467 | + state_type __tmp_state(__state); | ||
| 468 | + | ||
| 469 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 470 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
| 471 | +#endif | ||
| 472 | + | ||
| 473 | + // wcsnrtombs is *very* fast but stops if encounters NUL characters: | ||
| 474 | + // in case we fall back to wcrtomb and then continue, in a loop. | ||
| 475 | + // NB: wcsnrtombs is a GNU extension | ||
| 476 | + for (__from_next = __from, __to_next = __to; | ||
| 477 | + __from_next < __from_end && __to_next < __to_end | ||
| 478 | + && __ret == ok;) | ||
| 479 | + { | ||
| 480 | + const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0', | ||
| 481 | + __from_end - __from_next); | ||
| 482 | + if (!__from_chunk_end) | ||
| 483 | + __from_chunk_end = __from_end; | ||
| 484 | + | ||
| 485 | + __from = __from_next; | ||
| 486 | + const size_t __conv = wcsnrtombs(__to_next, &__from_next, | ||
| 487 | + __from_chunk_end - __from_next, | ||
| 488 | + __to_end - __to_next, &__state); | ||
| 489 | + if (__conv == static_cast<size_t>(-1)) | ||
| 490 | + { | ||
| 491 | + // In case of error, in order to stop at the exact place we | ||
| 492 | + // have to start again from the beginning with a series of | ||
| 493 | + // wcrtomb. | ||
| 494 | + for (; __from < __from_next; ++__from) | ||
| 495 | + __to_next += wcrtomb(__to_next, *__from, &__tmp_state); | ||
| 496 | + __state = __tmp_state; | ||
| 497 | + __ret = error; | ||
| 498 | + } | ||
| 499 | + else if (__from_next && __from_next < __from_chunk_end) | ||
| 500 | + { | ||
| 501 | + __to_next += __conv; | ||
| 502 | + __ret = partial; | ||
| 503 | + } | ||
| 504 | + else | ||
| 505 | + { | ||
| 506 | + __from_next = __from_chunk_end; | ||
| 507 | + __to_next += __conv; | ||
| 508 | + } | ||
| 509 | + | ||
| 510 | + if (__from_next < __from_end && __ret == ok) | ||
| 511 | + { | ||
| 512 | + extern_type __buf[MB_LEN_MAX]; | ||
| 513 | + __tmp_state = __state; | ||
| 514 | + const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state); | ||
| 515 | + if (__conv > static_cast<size_t>(__to_end - __to_next)) | ||
| 516 | + __ret = partial; | ||
| 517 | + else | ||
| 518 | + { | ||
| 519 | + memcpy(__to_next, __buf, __conv); | ||
| 520 | + __state = __tmp_state; | ||
| 521 | + __to_next += __conv; | ||
| 522 | + ++__from_next; | ||
| 523 | + } | ||
| 524 | + } | ||
| 525 | + } | ||
| 526 | + | ||
| 527 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 528 | + __uselocale(__old); | ||
| 529 | +#endif | ||
| 530 | + | ||
| 531 | + return __ret; | ||
| 532 | + } | ||
| 533 | + | ||
| 534 | + codecvt_base::result | ||
| 535 | + codecvt<wchar_t, char, mbstate_t>:: | ||
| 536 | + do_in(state_type& __state, const extern_type* __from, | ||
| 537 | + const extern_type* __from_end, const extern_type*& __from_next, | ||
| 538 | + intern_type* __to, intern_type* __to_end, | ||
| 539 | + intern_type*& __to_next) const | ||
| 540 | + { | ||
| 541 | + result __ret = ok; | ||
| 542 | + state_type __tmp_state(__state); | ||
| 543 | + | ||
| 544 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 545 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
| 546 | +#endif | ||
| 547 | + | ||
| 548 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
| 549 | + // in case we store a L'\0' and then continue, in a loop. | ||
| 550 | + // NB: mbsnrtowcs is a GNU extension | ||
| 551 | + for (__from_next = __from, __to_next = __to; | ||
| 552 | + __from_next < __from_end && __to_next < __to_end | ||
| 553 | + && __ret == ok;) | ||
| 554 | + { | ||
| 555 | + const extern_type* __from_chunk_end; | ||
| 556 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0', | ||
| 557 | + __from_end | ||
| 558 | + - __from_next)); | ||
| 559 | + if (!__from_chunk_end) | ||
| 560 | + __from_chunk_end = __from_end; | ||
| 561 | + | ||
| 562 | + __from = __from_next; | ||
| 563 | + size_t __conv = mbsnrtowcs(__to_next, &__from_next, | ||
| 564 | + __from_chunk_end - __from_next, | ||
| 565 | + __to_end - __to_next, &__state); | ||
| 566 | + if (__conv == static_cast<size_t>(-1)) | ||
| 567 | + { | ||
| 568 | + // In case of error, in order to stop at the exact place we | ||
| 569 | + // have to start again from the beginning with a series of | ||
| 570 | + // mbrtowc. | ||
| 571 | + for (;; ++__to_next, __from += __conv) | ||
| 572 | + { | ||
| 573 | + __conv = mbrtowc(__to_next, __from, __from_end - __from, | ||
| 574 | + &__tmp_state); | ||
| 575 | + if (__conv == static_cast<size_t>(-1) | ||
| 576 | + || __conv == static_cast<size_t>(-2)) | ||
| 577 | + break; | ||
| 578 | + } | ||
| 579 | + __from_next = __from; | ||
| 580 | + __state = __tmp_state; | ||
| 581 | + __ret = error; | ||
| 582 | + } | ||
| 583 | + else if (__from_next && __from_next < __from_chunk_end) | ||
| 584 | + { | ||
| 585 | + // It is unclear what to return in this case (see DR 382). | ||
| 586 | + __to_next += __conv; | ||
| 587 | + __ret = partial; | ||
| 588 | + } | ||
| 589 | + else | ||
| 590 | + { | ||
| 591 | + __from_next = __from_chunk_end; | ||
| 592 | + __to_next += __conv; | ||
| 593 | + } | ||
| 594 | + | ||
| 595 | + if (__from_next < __from_end && __ret == ok) | ||
| 596 | + { | ||
| 597 | + if (__to_next < __to_end) | ||
| 598 | + { | ||
| 599 | + // XXX Probably wrong for stateful encodings | ||
| 600 | + __tmp_state = __state; | ||
| 601 | + ++__from_next; | ||
| 602 | + *__to_next++ = L'\0'; | ||
| 603 | + } | ||
| 604 | + else | ||
| 605 | + __ret = partial; | ||
| 606 | + } | ||
| 607 | + } | ||
| 608 | + | ||
| 609 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 610 | + __uselocale(__old); | ||
| 611 | +#endif | ||
| 612 | + | ||
| 613 | + return __ret; | ||
| 614 | + } | ||
| 615 | + | ||
| 616 | + int | ||
| 617 | + codecvt<wchar_t, char, mbstate_t>:: | ||
| 618 | + do_encoding() const throw() | ||
| 619 | + { | ||
| 620 | + // XXX This implementation assumes that the encoding is | ||
| 621 | + // stateless and is either single-byte or variable-width. | ||
| 622 | + int __ret = 0; | ||
| 623 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 624 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
| 625 | +#endif | ||
| 626 | + if (MB_CUR_MAX == 1) | ||
| 627 | + __ret = 1; | ||
| 628 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 629 | + __uselocale(__old); | ||
| 630 | +#endif | ||
| 631 | + return __ret; | ||
| 632 | + } | ||
| 633 | + | ||
| 634 | + int | ||
| 635 | + codecvt<wchar_t, char, mbstate_t>:: | ||
| 636 | + do_max_length() const throw() | ||
| 637 | + { | ||
| 638 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 639 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
| 640 | +#endif | ||
| 641 | + // XXX Probably wrong for stateful encodings. | ||
| 642 | + int __ret = MB_CUR_MAX; | ||
| 643 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 644 | + __uselocale(__old); | ||
| 645 | +#endif | ||
| 646 | + return __ret; | ||
| 647 | + } | ||
| 648 | + | ||
| 649 | + int | ||
| 650 | + codecvt<wchar_t, char, mbstate_t>:: | ||
| 651 | + do_length(state_type& __state, const extern_type* __from, | ||
| 652 | + const extern_type* __end, size_t __max) const | ||
| 653 | + { | ||
| 654 | + int __ret = 0; | ||
| 655 | + state_type __tmp_state(__state); | ||
| 656 | + | ||
| 657 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 658 | + __c_locale __old = __uselocale(_M_c_locale_codecvt); | ||
| 659 | +#endif | ||
| 660 | + | ||
| 661 | + // mbsnrtowcs is *very* fast but stops if encounters NUL characters: | ||
| 662 | + // in case we advance past it and then continue, in a loop. | ||
| 663 | + // NB: mbsnrtowcs is a GNU extension | ||
| 664 | + | ||
| 665 | + // A dummy internal buffer is needed in order for mbsnrtocws to consider | ||
| 666 | + // its fourth parameter (it wouldn't with NULL as first parameter). | ||
| 667 | + wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t) | ||
| 668 | + * __max)); | ||
| 669 | + while (__from < __end && __max) | ||
| 670 | + { | ||
| 671 | + const extern_type* __from_chunk_end; | ||
| 672 | + __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0', | ||
| 673 | + __end | ||
| 674 | + - __from)); | ||
| 675 | + if (!__from_chunk_end) | ||
| 676 | + __from_chunk_end = __end; | ||
| 677 | + | ||
| 678 | + const extern_type* __tmp_from = __from; | ||
| 679 | + size_t __conv = mbsnrtowcs(__to, &__from, | ||
| 680 | + __from_chunk_end - __from, | ||
| 681 | + __max, &__state); | ||
| 682 | + if (__conv == static_cast<size_t>(-1)) | ||
| 683 | + { | ||
| 684 | + // In case of error, in order to stop at the exact place we | ||
| 685 | + // have to start again from the beginning with a series of | ||
| 686 | + // mbrtowc. | ||
| 687 | + for (__from = __tmp_from;; __from += __conv) | ||
| 688 | + { | ||
| 689 | + __conv = mbrtowc(NULL, __from, __end - __from, | ||
| 690 | + &__tmp_state); | ||
| 691 | + if (__conv == static_cast<size_t>(-1) | ||
| 692 | + || __conv == static_cast<size_t>(-2)) | ||
| 693 | + break; | ||
| 694 | + } | ||
| 695 | + __state = __tmp_state; | ||
| 696 | + __ret += __from - __tmp_from; | ||
| 697 | + break; | ||
| 698 | + } | ||
| 699 | + if (!__from) | ||
| 700 | + __from = __from_chunk_end; | ||
| 701 | + | ||
| 702 | + __ret += __from - __tmp_from; | ||
| 703 | + __max -= __conv; | ||
| 704 | + | ||
| 705 | + if (__from < __end && __max) | ||
| 706 | + { | ||
| 707 | + // XXX Probably wrong for stateful encodings | ||
| 708 | + __tmp_state = __state; | ||
| 709 | + ++__from; | ||
| 710 | + ++__ret; | ||
| 711 | + --__max; | ||
| 712 | + } | ||
| 713 | + } | ||
| 714 | + | ||
| 715 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 716 | + __uselocale(__old); | ||
| 717 | +#endif | ||
| 718 | + | ||
| 719 | + return __ret; | ||
| 720 | + } | ||
| 721 | +#endif | ||
| 722 | +} | ||
| 723 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc | ||
| 724 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/collate_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 725 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/collate_members.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 726 | @@ -0,0 +1,80 @@ | ||
| 727 | +// std::collate implementation details, GNU version -*- C++ -*- | ||
| 728 | + | ||
| 729 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
| 730 | +// | ||
| 731 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 732 | +// software; you can redistribute it and/or modify it under the | ||
| 733 | +// terms of the GNU General Public License as published by the | ||
| 734 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 735 | +// any later version. | ||
| 736 | + | ||
| 737 | +// This library is distributed in the hope that it will be useful, | ||
| 738 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 739 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 740 | +// GNU General Public License for more details. | ||
| 741 | + | ||
| 742 | +// You should have received a copy of the GNU General Public License along | ||
| 743 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 744 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 745 | +// USA. | ||
| 746 | + | ||
| 747 | +// As a special exception, you may use this file as part of a free software | ||
| 748 | +// library without restriction. Specifically, if other files instantiate | ||
| 749 | +// templates or use macros or inline functions from this file, or you compile | ||
| 750 | +// this file and link it with other files to produce an executable, this | ||
| 751 | +// file does not by itself cause the resulting executable to be covered by | ||
| 752 | +// the GNU General Public License. This exception does not however | ||
| 753 | +// invalidate any other reasons why the executable file might be covered by | ||
| 754 | +// the GNU General Public License. | ||
| 755 | + | ||
| 756 | +// | ||
| 757 | +// ISO C++ 14882: 22.2.4.1.2 collate virtual functions | ||
| 758 | +// | ||
| 759 | + | ||
| 760 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 761 | + | ||
| 762 | +#include <locale> | ||
| 763 | +#include <bits/c++locale_internal.h> | ||
| 764 | + | ||
| 765 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 766 | +#define __strcoll_l(S1, S2, L) strcoll((S1), (S2)) | ||
| 767 | +#define __strxfrm_l(S1, S2, N, L) strxfrm((S1), (S2), (N)) | ||
| 768 | +#define __wcscoll_l(S1, S2, L) wcscoll((S1), (S2)) | ||
| 769 | +#define __wcsxfrm_l(S1, S2, N, L) wcsxfrm((S1), (S2), (N)) | ||
| 770 | +#endif | ||
| 771 | + | ||
| 772 | +namespace std | ||
| 773 | +{ | ||
| 774 | + // These are basically extensions to char_traits, and perhaps should | ||
| 775 | + // be put there instead of here. | ||
| 776 | + template<> | ||
| 777 | + int | ||
| 778 | + collate<char>::_M_compare(const char* __one, const char* __two) const | ||
| 779 | + { | ||
| 780 | + int __cmp = __strcoll_l(__one, __two, _M_c_locale_collate); | ||
| 781 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
| 782 | + } | ||
| 783 | + | ||
| 784 | + template<> | ||
| 785 | + size_t | ||
| 786 | + collate<char>::_M_transform(char* __to, const char* __from, | ||
| 787 | + size_t __n) const | ||
| 788 | + { return __strxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
| 789 | + | ||
| 790 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 791 | + template<> | ||
| 792 | + int | ||
| 793 | + collate<wchar_t>::_M_compare(const wchar_t* __one, | ||
| 794 | + const wchar_t* __two) const | ||
| 795 | + { | ||
| 796 | + int __cmp = __wcscoll_l(__one, __two, _M_c_locale_collate); | ||
| 797 | + return (__cmp >> (8 * sizeof (int) - 2)) | (__cmp != 0); | ||
| 798 | + } | ||
| 799 | + | ||
| 800 | + template<> | ||
| 801 | + size_t | ||
| 802 | + collate<wchar_t>::_M_transform(wchar_t* __to, const wchar_t* __from, | ||
| 803 | + size_t __n) const | ||
| 804 | + { return __wcsxfrm_l(__to, __from, __n, _M_c_locale_collate); } | ||
| 805 | +#endif | ||
| 806 | +} | ||
| 807 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc | ||
| 808 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/ctype_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 809 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/ctype_members.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 810 | @@ -0,0 +1,300 @@ | ||
| 811 | +// std::ctype implementation details, GNU version -*- C++ -*- | ||
| 812 | + | ||
| 813 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 814 | +// | ||
| 815 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 816 | +// software; you can redistribute it and/or modify it under the | ||
| 817 | +// terms of the GNU General Public License as published by the | ||
| 818 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 819 | +// any later version. | ||
| 820 | + | ||
| 821 | +// This library is distributed in the hope that it will be useful, | ||
| 822 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 823 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 824 | +// GNU General Public License for more details. | ||
| 825 | + | ||
| 826 | +// You should have received a copy of the GNU General Public License along | ||
| 827 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 828 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 829 | +// USA. | ||
| 830 | + | ||
| 831 | +// As a special exception, you may use this file as part of a free software | ||
| 832 | +// library without restriction. Specifically, if other files instantiate | ||
| 833 | +// templates or use macros or inline functions from this file, or you compile | ||
| 834 | +// this file and link it with other files to produce an executable, this | ||
| 835 | +// file does not by itself cause the resulting executable to be covered by | ||
| 836 | +// the GNU General Public License. This exception does not however | ||
| 837 | +// invalidate any other reasons why the executable file might be covered by | ||
| 838 | +// the GNU General Public License. | ||
| 839 | + | ||
| 840 | +// | ||
| 841 | +// ISO C++ 14882: 22.2.1.1.2 ctype virtual functions. | ||
| 842 | +// | ||
| 843 | + | ||
| 844 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 845 | + | ||
| 846 | +#define _LIBC | ||
| 847 | +#include <locale> | ||
| 848 | +#undef _LIBC | ||
| 849 | +#include <bits/c++locale_internal.h> | ||
| 850 | + | ||
| 851 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 852 | +#define __wctype_l(S, L) wctype((S)) | ||
| 853 | +#define __towupper_l(C, L) towupper((C)) | ||
| 854 | +#define __towlower_l(C, L) towlower((C)) | ||
| 855 | +#define __iswctype_l(C, M, L) iswctype((C), (M)) | ||
| 856 | +#endif | ||
| 857 | + | ||
| 858 | +namespace std | ||
| 859 | +{ | ||
| 860 | + // NB: The other ctype<char> specializations are in src/locale.cc and | ||
| 861 | + // various /config/os/* files. | ||
| 862 | + template<> | ||
| 863 | + ctype_byname<char>::ctype_byname(const char* __s, size_t __refs) | ||
| 864 | + : ctype<char>(0, false, __refs) | ||
| 865 | + { | ||
| 866 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
| 867 | + { | ||
| 868 | + this->_S_destroy_c_locale(this->_M_c_locale_ctype); | ||
| 869 | + this->_S_create_c_locale(this->_M_c_locale_ctype, __s); | ||
| 870 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 871 | + this->_M_toupper = this->_M_c_locale_ctype->__ctype_toupper; | ||
| 872 | + this->_M_tolower = this->_M_c_locale_ctype->__ctype_tolower; | ||
| 873 | + this->_M_table = this->_M_c_locale_ctype->__ctype_b; | ||
| 874 | +#endif | ||
| 875 | + } | ||
| 876 | + } | ||
| 877 | + | ||
| 878 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 879 | + ctype<wchar_t>::__wmask_type | ||
| 880 | + ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const | ||
| 881 | + { | ||
| 882 | + __wmask_type __ret; | ||
| 883 | + switch (__m) | ||
| 884 | + { | ||
| 885 | + case space: | ||
| 886 | + __ret = __wctype_l("space", _M_c_locale_ctype); | ||
| 887 | + break; | ||
| 888 | + case print: | ||
| 889 | + __ret = __wctype_l("print", _M_c_locale_ctype); | ||
| 890 | + break; | ||
| 891 | + case cntrl: | ||
| 892 | + __ret = __wctype_l("cntrl", _M_c_locale_ctype); | ||
| 893 | + break; | ||
| 894 | + case upper: | ||
| 895 | + __ret = __wctype_l("upper", _M_c_locale_ctype); | ||
| 896 | + break; | ||
| 897 | + case lower: | ||
| 898 | + __ret = __wctype_l("lower", _M_c_locale_ctype); | ||
| 899 | + break; | ||
| 900 | + case alpha: | ||
| 901 | + __ret = __wctype_l("alpha", _M_c_locale_ctype); | ||
| 902 | + break; | ||
| 903 | + case digit: | ||
| 904 | + __ret = __wctype_l("digit", _M_c_locale_ctype); | ||
| 905 | + break; | ||
| 906 | + case punct: | ||
| 907 | + __ret = __wctype_l("punct", _M_c_locale_ctype); | ||
| 908 | + break; | ||
| 909 | + case xdigit: | ||
| 910 | + __ret = __wctype_l("xdigit", _M_c_locale_ctype); | ||
| 911 | + break; | ||
| 912 | + case alnum: | ||
| 913 | + __ret = __wctype_l("alnum", _M_c_locale_ctype); | ||
| 914 | + break; | ||
| 915 | + case graph: | ||
| 916 | + __ret = __wctype_l("graph", _M_c_locale_ctype); | ||
| 917 | + break; | ||
| 918 | + default: | ||
| 919 | + __ret = __wmask_type(); | ||
| 920 | + } | ||
| 921 | + return __ret; | ||
| 922 | + } | ||
| 923 | + | ||
| 924 | + wchar_t | ||
| 925 | + ctype<wchar_t>::do_toupper(wchar_t __c) const | ||
| 926 | + { return __towupper_l(__c, _M_c_locale_ctype); } | ||
| 927 | + | ||
| 928 | + const wchar_t* | ||
| 929 | + ctype<wchar_t>::do_toupper(wchar_t* __lo, const wchar_t* __hi) const | ||
| 930 | + { | ||
| 931 | + while (__lo < __hi) | ||
| 932 | + { | ||
| 933 | + *__lo = __towupper_l(*__lo, _M_c_locale_ctype); | ||
| 934 | + ++__lo; | ||
| 935 | + } | ||
| 936 | + return __hi; | ||
| 937 | + } | ||
| 938 | + | ||
| 939 | + wchar_t | ||
| 940 | + ctype<wchar_t>::do_tolower(wchar_t __c) const | ||
| 941 | + { return __towlower_l(__c, _M_c_locale_ctype); } | ||
| 942 | + | ||
| 943 | + const wchar_t* | ||
| 944 | + ctype<wchar_t>::do_tolower(wchar_t* __lo, const wchar_t* __hi) const | ||
| 945 | + { | ||
| 946 | + while (__lo < __hi) | ||
| 947 | + { | ||
| 948 | + *__lo = __towlower_l(*__lo, _M_c_locale_ctype); | ||
| 949 | + ++__lo; | ||
| 950 | + } | ||
| 951 | + return __hi; | ||
| 952 | + } | ||
| 953 | + | ||
| 954 | + bool | ||
| 955 | + ctype<wchar_t>:: | ||
| 956 | + do_is(mask __m, wchar_t __c) const | ||
| 957 | + { | ||
| 958 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
| 959 | + // library for blank. | ||
| 960 | + bool __ret = false; | ||
| 961 | + const size_t __bitmasksize = 11; | ||
| 962 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
| 963 | + if (__m & _M_bit[__bitcur] | ||
| 964 | + && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
| 965 | + { | ||
| 966 | + __ret = true; | ||
| 967 | + break; | ||
| 968 | + } | ||
| 969 | + return __ret; | ||
| 970 | + } | ||
| 971 | + | ||
| 972 | + const wchar_t* | ||
| 973 | + ctype<wchar_t>:: | ||
| 974 | + do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const | ||
| 975 | + { | ||
| 976 | + for (; __lo < __hi; ++__vec, ++__lo) | ||
| 977 | + { | ||
| 978 | + // Highest bitmask in ctype_base == 10, but extra in "C" | ||
| 979 | + // library for blank. | ||
| 980 | + const size_t __bitmasksize = 11; | ||
| 981 | + mask __m = 0; | ||
| 982 | + for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur) | ||
| 983 | + if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype)) | ||
| 984 | + __m |= _M_bit[__bitcur]; | ||
| 985 | + *__vec = __m; | ||
| 986 | + } | ||
| 987 | + return __hi; | ||
| 988 | + } | ||
| 989 | + | ||
| 990 | + const wchar_t* | ||
| 991 | + ctype<wchar_t>:: | ||
| 992 | + do_scan_is(mask __m, const wchar_t* __lo, const wchar_t* __hi) const | ||
| 993 | + { | ||
| 994 | + while (__lo < __hi && !this->do_is(__m, *__lo)) | ||
| 995 | + ++__lo; | ||
| 996 | + return __lo; | ||
| 997 | + } | ||
| 998 | + | ||
| 999 | + const wchar_t* | ||
| 1000 | + ctype<wchar_t>:: | ||
| 1001 | + do_scan_not(mask __m, const char_type* __lo, const char_type* __hi) const | ||
| 1002 | + { | ||
| 1003 | + while (__lo < __hi && this->do_is(__m, *__lo) != 0) | ||
| 1004 | + ++__lo; | ||
| 1005 | + return __lo; | ||
| 1006 | + } | ||
| 1007 | + | ||
| 1008 | + wchar_t | ||
| 1009 | + ctype<wchar_t>:: | ||
| 1010 | + do_widen(char __c) const | ||
| 1011 | + { return _M_widen[static_cast<unsigned char>(__c)]; } | ||
| 1012 | + | ||
| 1013 | + const char* | ||
| 1014 | + ctype<wchar_t>:: | ||
| 1015 | + do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const | ||
| 1016 | + { | ||
| 1017 | + while (__lo < __hi) | ||
| 1018 | + { | ||
| 1019 | + *__dest = _M_widen[static_cast<unsigned char>(*__lo)]; | ||
| 1020 | + ++__lo; | ||
| 1021 | + ++__dest; | ||
| 1022 | + } | ||
| 1023 | + return __hi; | ||
| 1024 | + } | ||
| 1025 | + | ||
| 1026 | + char | ||
| 1027 | + ctype<wchar_t>:: | ||
| 1028 | + do_narrow(wchar_t __wc, char __dfault) const | ||
| 1029 | + { | ||
| 1030 | + if (__wc >= 0 && __wc < 128 && _M_narrow_ok) | ||
| 1031 | + return _M_narrow[__wc]; | ||
| 1032 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1033 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
| 1034 | +#endif | ||
| 1035 | + const int __c = wctob(__wc); | ||
| 1036 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1037 | + __uselocale(__old); | ||
| 1038 | +#endif | ||
| 1039 | + return (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
| 1040 | + } | ||
| 1041 | + | ||
| 1042 | + const wchar_t* | ||
| 1043 | + ctype<wchar_t>:: | ||
| 1044 | + do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault, | ||
| 1045 | + char* __dest) const | ||
| 1046 | + { | ||
| 1047 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1048 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
| 1049 | +#endif | ||
| 1050 | + if (_M_narrow_ok) | ||
| 1051 | + while (__lo < __hi) | ||
| 1052 | + { | ||
| 1053 | + if (*__lo >= 0 && *__lo < 128) | ||
| 1054 | + *__dest = _M_narrow[*__lo]; | ||
| 1055 | + else | ||
| 1056 | + { | ||
| 1057 | + const int __c = wctob(*__lo); | ||
| 1058 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
| 1059 | + } | ||
| 1060 | + ++__lo; | ||
| 1061 | + ++__dest; | ||
| 1062 | + } | ||
| 1063 | + else | ||
| 1064 | + while (__lo < __hi) | ||
| 1065 | + { | ||
| 1066 | + const int __c = wctob(*__lo); | ||
| 1067 | + *__dest = (__c == EOF ? __dfault : static_cast<char>(__c)); | ||
| 1068 | + ++__lo; | ||
| 1069 | + ++__dest; | ||
| 1070 | + } | ||
| 1071 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1072 | + __uselocale(__old); | ||
| 1073 | +#endif | ||
| 1074 | + return __hi; | ||
| 1075 | + } | ||
| 1076 | + | ||
| 1077 | + void | ||
| 1078 | + ctype<wchar_t>::_M_initialize_ctype() | ||
| 1079 | + { | ||
| 1080 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1081 | + __c_locale __old = __uselocale(_M_c_locale_ctype); | ||
| 1082 | +#endif | ||
| 1083 | + wint_t __i; | ||
| 1084 | + for (__i = 0; __i < 128; ++__i) | ||
| 1085 | + { | ||
| 1086 | + const int __c = wctob(__i); | ||
| 1087 | + if (__c == EOF) | ||
| 1088 | + break; | ||
| 1089 | + else | ||
| 1090 | + _M_narrow[__i] = static_cast<char>(__c); | ||
| 1091 | + } | ||
| 1092 | + if (__i == 128) | ||
| 1093 | + _M_narrow_ok = true; | ||
| 1094 | + else | ||
| 1095 | + _M_narrow_ok = false; | ||
| 1096 | + for (size_t __j = 0; | ||
| 1097 | + __j < sizeof(_M_widen) / sizeof(wint_t); ++__j) | ||
| 1098 | + _M_widen[__j] = btowc(__j); | ||
| 1099 | + | ||
| 1100 | + for (size_t __k = 0; __k <= 11; ++__k) | ||
| 1101 | + { | ||
| 1102 | + _M_bit[__k] = static_cast<mask>(_ISbit(__k)); | ||
| 1103 | + _M_wmask[__k] = _M_convert_to_wmask(_M_bit[__k]); | ||
| 1104 | + } | ||
| 1105 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1106 | + __uselocale(__old); | ||
| 1107 | +#endif | ||
| 1108 | + } | ||
| 1109 | +#endif // _GLIBCXX_USE_WCHAR_T | ||
| 1110 | +} | ||
| 1111 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc | ||
| 1112 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 1113 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 1114 | @@ -0,0 +1,100 @@ | ||
| 1115 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
| 1116 | + | ||
| 1117 | +// Copyright (C) 2001, 2002 Free Software Foundation, Inc. | ||
| 1118 | +// | ||
| 1119 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 1120 | +// software; you can redistribute it and/or modify it under the | ||
| 1121 | +// terms of the GNU General Public License as published by the | ||
| 1122 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 1123 | +// any later version. | ||
| 1124 | + | ||
| 1125 | +// This library is distributed in the hope that it will be useful, | ||
| 1126 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1127 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 1128 | +// GNU General Public License for more details. | ||
| 1129 | + | ||
| 1130 | +// You should have received a copy of the GNU General Public License along | ||
| 1131 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 1132 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 1133 | +// USA. | ||
| 1134 | + | ||
| 1135 | +// As a special exception, you may use this file as part of a free software | ||
| 1136 | +// library without restriction. Specifically, if other files instantiate | ||
| 1137 | +// templates or use macros or inline functions from this file, or you compile | ||
| 1138 | +// this file and link it with other files to produce an executable, this | ||
| 1139 | +// file does not by itself cause the resulting executable to be covered by | ||
| 1140 | +// the GNU General Public License. This exception does not however | ||
| 1141 | +// invalidate any other reasons why the executable file might be covered by | ||
| 1142 | +// the GNU General Public License. | ||
| 1143 | + | ||
| 1144 | +// | ||
| 1145 | +// ISO C++ 14882: 22.2.7.1.2 messages virtual functions | ||
| 1146 | +// | ||
| 1147 | + | ||
| 1148 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 1149 | + | ||
| 1150 | +#include <locale> | ||
| 1151 | +#include <bits/c++locale_internal.h> | ||
| 1152 | + | ||
| 1153 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 1154 | +#warning fix gettext stuff | ||
| 1155 | +#endif | ||
| 1156 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
| 1157 | +extern "C" char *__dcgettext(const char *domainname, | ||
| 1158 | + const char *msgid, int category); | ||
| 1159 | +#undef gettext | ||
| 1160 | +#define gettext(msgid) __dcgettext(NULL, msgid, LC_MESSAGES) | ||
| 1161 | +#else | ||
| 1162 | +#undef gettext | ||
| 1163 | +#define gettext(msgid) (msgid) | ||
| 1164 | +#endif | ||
| 1165 | + | ||
| 1166 | +namespace std | ||
| 1167 | +{ | ||
| 1168 | + // Specializations. | ||
| 1169 | + template<> | ||
| 1170 | + string | ||
| 1171 | + messages<char>::do_get(catalog, int, int, const string& __dfault) const | ||
| 1172 | + { | ||
| 1173 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1174 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
| 1175 | + const char* __msg = const_cast<const char*>(gettext(__dfault.c_str())); | ||
| 1176 | + __uselocale(__old); | ||
| 1177 | + return string(__msg); | ||
| 1178 | +#elif defined __UCLIBC_HAS_LOCALE__ | ||
| 1179 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 1180 | + setlocale(LC_ALL, _M_name_messages); | ||
| 1181 | + const char* __msg = gettext(__dfault.c_str()); | ||
| 1182 | + setlocale(LC_ALL, __old); | ||
| 1183 | + free(__old); | ||
| 1184 | + return string(__msg); | ||
| 1185 | +#else | ||
| 1186 | + const char* __msg = gettext(__dfault.c_str()); | ||
| 1187 | + return string(__msg); | ||
| 1188 | +#endif | ||
| 1189 | + } | ||
| 1190 | + | ||
| 1191 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 1192 | + template<> | ||
| 1193 | + wstring | ||
| 1194 | + messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const | ||
| 1195 | + { | ||
| 1196 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1197 | + __c_locale __old = __uselocale(_M_c_locale_messages); | ||
| 1198 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
| 1199 | + __uselocale(__old); | ||
| 1200 | + return _M_convert_from_char(__msg); | ||
| 1201 | +# elif defined __UCLIBC_HAS_LOCALE__ | ||
| 1202 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 1203 | + setlocale(LC_ALL, _M_name_messages); | ||
| 1204 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
| 1205 | + setlocale(LC_ALL, __old); | ||
| 1206 | + free(__old); | ||
| 1207 | + return _M_convert_from_char(__msg); | ||
| 1208 | +# else | ||
| 1209 | + char* __msg = gettext(_M_convert_to_char(__dfault)); | ||
| 1210 | + return _M_convert_from_char(__msg); | ||
| 1211 | +# endif | ||
| 1212 | + } | ||
| 1213 | +#endif | ||
| 1214 | +} | ||
| 1215 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h | ||
| 1216 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/messages_members.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 1217 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/messages_members.h 2005-04-28 01:13:15.000000000 -0500 | ||
| 1218 | @@ -0,0 +1,118 @@ | ||
| 1219 | +// std::messages implementation details, GNU version -*- C++ -*- | ||
| 1220 | + | ||
| 1221 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 1222 | +// | ||
| 1223 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 1224 | +// software; you can redistribute it and/or modify it under the | ||
| 1225 | +// terms of the GNU General Public License as published by the | ||
| 1226 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 1227 | +// any later version. | ||
| 1228 | + | ||
| 1229 | +// This library is distributed in the hope that it will be useful, | ||
| 1230 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1231 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 1232 | +// GNU General Public License for more details. | ||
| 1233 | + | ||
| 1234 | +// You should have received a copy of the GNU General Public License along | ||
| 1235 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 1236 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 1237 | +// USA. | ||
| 1238 | + | ||
| 1239 | +// As a special exception, you may use this file as part of a free software | ||
| 1240 | +// library without restriction. Specifically, if other files instantiate | ||
| 1241 | +// templates or use macros or inline functions from this file, or you compile | ||
| 1242 | +// this file and link it with other files to produce an executable, this | ||
| 1243 | +// file does not by itself cause the resulting executable to be covered by | ||
| 1244 | +// the GNU General Public License. This exception does not however | ||
| 1245 | +// invalidate any other reasons why the executable file might be covered by | ||
| 1246 | +// the GNU General Public License. | ||
| 1247 | + | ||
| 1248 | +// | ||
| 1249 | +// ISO C++ 14882: 22.2.7.1.2 messages functions | ||
| 1250 | +// | ||
| 1251 | + | ||
| 1252 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 1253 | + | ||
| 1254 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 1255 | +#warning fix prototypes for *textdomain funcs | ||
| 1256 | +#endif | ||
| 1257 | +#ifdef __UCLIBC_HAS_GETTEXT_AWARENESS__ | ||
| 1258 | +extern "C" char *__textdomain(const char *domainname); | ||
| 1259 | +extern "C" char *__bindtextdomain(const char *domainname, | ||
| 1260 | + const char *dirname); | ||
| 1261 | +#else | ||
| 1262 | +#undef __textdomain | ||
| 1263 | +#undef __bindtextdomain | ||
| 1264 | +#define __textdomain(D) ((void)0) | ||
| 1265 | +#define __bindtextdomain(D,P) ((void)0) | ||
| 1266 | +#endif | ||
| 1267 | + | ||
| 1268 | + // Non-virtual member functions. | ||
| 1269 | + template<typename _CharT> | ||
| 1270 | + messages<_CharT>::messages(size_t __refs) | ||
| 1271 | + : facet(__refs), _M_c_locale_messages(_S_get_c_locale()), | ||
| 1272 | + _M_name_messages(_S_get_c_name()) | ||
| 1273 | + { } | ||
| 1274 | + | ||
| 1275 | + template<typename _CharT> | ||
| 1276 | + messages<_CharT>::messages(__c_locale __cloc, const char* __s, | ||
| 1277 | + size_t __refs) | ||
| 1278 | + : facet(__refs), _M_c_locale_messages(_S_clone_c_locale(__cloc)), | ||
| 1279 | + _M_name_messages(__s) | ||
| 1280 | + { | ||
| 1281 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
| 1282 | + std::strcpy(__tmp, __s); | ||
| 1283 | + _M_name_messages = __tmp; | ||
| 1284 | + } | ||
| 1285 | + | ||
| 1286 | + template<typename _CharT> | ||
| 1287 | + typename messages<_CharT>::catalog | ||
| 1288 | + messages<_CharT>::open(const basic_string<char>& __s, const locale& __loc, | ||
| 1289 | + const char* __dir) const | ||
| 1290 | + { | ||
| 1291 | + __bindtextdomain(__s.c_str(), __dir); | ||
| 1292 | + return this->do_open(__s, __loc); | ||
| 1293 | + } | ||
| 1294 | + | ||
| 1295 | + // Virtual member functions. | ||
| 1296 | + template<typename _CharT> | ||
| 1297 | + messages<_CharT>::~messages() | ||
| 1298 | + { | ||
| 1299 | + if (_M_name_messages != _S_get_c_name()) | ||
| 1300 | + delete [] _M_name_messages; | ||
| 1301 | + _S_destroy_c_locale(_M_c_locale_messages); | ||
| 1302 | + } | ||
| 1303 | + | ||
| 1304 | + template<typename _CharT> | ||
| 1305 | + typename messages<_CharT>::catalog | ||
| 1306 | + messages<_CharT>::do_open(const basic_string<char>& __s, | ||
| 1307 | + const locale&) const | ||
| 1308 | + { | ||
| 1309 | + // No error checking is done, assume the catalog exists and can | ||
| 1310 | + // be used. | ||
| 1311 | + __textdomain(__s.c_str()); | ||
| 1312 | + return 0; | ||
| 1313 | + } | ||
| 1314 | + | ||
| 1315 | + template<typename _CharT> | ||
| 1316 | + void | ||
| 1317 | + messages<_CharT>::do_close(catalog) const | ||
| 1318 | + { } | ||
| 1319 | + | ||
| 1320 | + // messages_byname | ||
| 1321 | + template<typename _CharT> | ||
| 1322 | + messages_byname<_CharT>::messages_byname(const char* __s, size_t __refs) | ||
| 1323 | + : messages<_CharT>(__refs) | ||
| 1324 | + { | ||
| 1325 | + if (this->_M_name_messages != locale::facet::_S_get_c_name()) | ||
| 1326 | + delete [] this->_M_name_messages; | ||
| 1327 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
| 1328 | + std::strcpy(__tmp, __s); | ||
| 1329 | + this->_M_name_messages = __tmp; | ||
| 1330 | + | ||
| 1331 | + if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0) | ||
| 1332 | + { | ||
| 1333 | + this->_S_destroy_c_locale(this->_M_c_locale_messages); | ||
| 1334 | + this->_S_create_c_locale(this->_M_c_locale_messages, __s); | ||
| 1335 | + } | ||
| 1336 | + } | ||
| 1337 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc | ||
| 1338 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/monetary_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 1339 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/monetary_members.cc 2005-04-28 01:23:02.000000000 -0500 | ||
| 1340 | @@ -0,0 +1,692 @@ | ||
| 1341 | +// std::moneypunct implementation details, GNU version -*- C++ -*- | ||
| 1342 | + | ||
| 1343 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 1344 | +// | ||
| 1345 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 1346 | +// software; you can redistribute it and/or modify it under the | ||
| 1347 | +// terms of the GNU General Public License as published by the | ||
| 1348 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 1349 | +// any later version. | ||
| 1350 | + | ||
| 1351 | +// This library is distributed in the hope that it will be useful, | ||
| 1352 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 1353 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 1354 | +// GNU General Public License for more details. | ||
| 1355 | + | ||
| 1356 | +// You should have received a copy of the GNU General Public License along | ||
| 1357 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 1358 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 1359 | +// USA. | ||
| 1360 | + | ||
| 1361 | +// As a special exception, you may use this file as part of a free software | ||
| 1362 | +// library without restriction. Specifically, if other files instantiate | ||
| 1363 | +// templates or use macros or inline functions from this file, or you compile | ||
| 1364 | +// this file and link it with other files to produce an executable, this | ||
| 1365 | +// file does not by itself cause the resulting executable to be covered by | ||
| 1366 | +// the GNU General Public License. This exception does not however | ||
| 1367 | +// invalidate any other reasons why the executable file might be covered by | ||
| 1368 | +// the GNU General Public License. | ||
| 1369 | + | ||
| 1370 | +// | ||
| 1371 | +// ISO C++ 14882: 22.2.6.3.2 moneypunct virtual functions | ||
| 1372 | +// | ||
| 1373 | + | ||
| 1374 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 1375 | + | ||
| 1376 | +#define _LIBC | ||
| 1377 | +#include <locale> | ||
| 1378 | +#undef _LIBC | ||
| 1379 | +#include <bits/c++locale_internal.h> | ||
| 1380 | + | ||
| 1381 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 1382 | +#warning optimize this for uclibc | ||
| 1383 | +#warning tailor for stub locale support | ||
| 1384 | +#endif | ||
| 1385 | + | ||
| 1386 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 1387 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
| 1388 | +#endif | ||
| 1389 | + | ||
| 1390 | +namespace std | ||
| 1391 | +{ | ||
| 1392 | + // Construct and return valid pattern consisting of some combination of: | ||
| 1393 | + // space none symbol sign value | ||
| 1394 | + money_base::pattern | ||
| 1395 | + money_base::_S_construct_pattern(char __precedes, char __space, char __posn) | ||
| 1396 | + { | ||
| 1397 | + pattern __ret; | ||
| 1398 | + | ||
| 1399 | + // This insanely complicated routine attempts to construct a valid | ||
| 1400 | + // pattern for use with monyepunct. A couple of invariants: | ||
| 1401 | + | ||
| 1402 | + // if (__precedes) symbol -> value | ||
| 1403 | + // else value -> symbol | ||
| 1404 | + | ||
| 1405 | + // if (__space) space | ||
| 1406 | + // else none | ||
| 1407 | + | ||
| 1408 | + // none == never first | ||
| 1409 | + // space never first or last | ||
| 1410 | + | ||
| 1411 | + // Any elegant implementations of this are welcome. | ||
| 1412 | + switch (__posn) | ||
| 1413 | + { | ||
| 1414 | + case 0: | ||
| 1415 | + case 1: | ||
| 1416 | + // 1 The sign precedes the value and symbol. | ||
| 1417 | + __ret.field[0] = sign; | ||
| 1418 | + if (__space) | ||
| 1419 | + { | ||
| 1420 | + // Pattern starts with sign. | ||
| 1421 | + if (__precedes) | ||
| 1422 | + { | ||
| 1423 | + __ret.field[1] = symbol; | ||
| 1424 | + __ret.field[3] = value; | ||
| 1425 | + } | ||
| 1426 | + else | ||
| 1427 | + { | ||
| 1428 | + __ret.field[1] = value; | ||
| 1429 | + __ret.field[3] = symbol; | ||
| 1430 | + } | ||
| 1431 | + __ret.field[2] = space; | ||
| 1432 | + } | ||
| 1433 | + else | ||
| 1434 | + { | ||
| 1435 | + // Pattern starts with sign and ends with none. | ||
| 1436 | + if (__precedes) | ||
| 1437 | + { | ||
| 1438 | + __ret.field[1] = symbol; | ||
| 1439 | + __ret.field[2] = value; | ||
| 1440 | + } | ||
| 1441 | + else | ||
| 1442 | + { | ||
| 1443 | + __ret.field[1] = value; | ||
| 1444 | + __ret.field[2] = symbol; | ||
| 1445 | + } | ||
| 1446 | + __ret.field[3] = none; | ||
| 1447 | + } | ||
| 1448 | + break; | ||
| 1449 | + case 2: | ||
| 1450 | + // 2 The sign follows the value and symbol. | ||
| 1451 | + if (__space) | ||
| 1452 | + { | ||
| 1453 | + // Pattern either ends with sign. | ||
| 1454 | + if (__precedes) | ||
| 1455 | + { | ||
| 1456 | + __ret.field[0] = symbol; | ||
| 1457 | + __ret.field[2] = value; | ||
| 1458 | + } | ||
| 1459 | + else | ||
| 1460 | + { | ||
| 1461 | + __ret.field[0] = value; | ||
| 1462 | + __ret.field[2] = symbol; | ||
| 1463 | + } | ||
| 1464 | + __ret.field[1] = space; | ||
| 1465 | + __ret.field[3] = sign; | ||
| 1466 | + } | ||
| 1467 | + else | ||
| 1468 | + { | ||
| 1469 | + // Pattern ends with sign then none. | ||
| 1470 | + if (__precedes) | ||
| 1471 | + { | ||
| 1472 | + __ret.field[0] = symbol; | ||
| 1473 | + __ret.field[1] = value; | ||
| 1474 | + } | ||
| 1475 | + else | ||
| 1476 | + { | ||
| 1477 | + __ret.field[0] = value; | ||
| 1478 | + __ret.field[1] = symbol; | ||
| 1479 | + } | ||
| 1480 | + __ret.field[2] = sign; | ||
| 1481 | + __ret.field[3] = none; | ||
| 1482 | + } | ||
| 1483 | + break; | ||
| 1484 | + case 3: | ||
| 1485 | + // 3 The sign immediately precedes the symbol. | ||
| 1486 | + if (__precedes) | ||
| 1487 | + { | ||
| 1488 | + __ret.field[0] = sign; | ||
| 1489 | + __ret.field[1] = symbol; | ||
| 1490 | + if (__space) | ||
| 1491 | + { | ||
| 1492 | + __ret.field[2] = space; | ||
| 1493 | + __ret.field[3] = value; | ||
| 1494 | + } | ||
| 1495 | + else | ||
| 1496 | + { | ||
| 1497 | + __ret.field[2] = value; | ||
| 1498 | + __ret.field[3] = none; | ||
| 1499 | + } | ||
| 1500 | + } | ||
| 1501 | + else | ||
| 1502 | + { | ||
| 1503 | + __ret.field[0] = value; | ||
| 1504 | + if (__space) | ||
| 1505 | + { | ||
| 1506 | + __ret.field[1] = space; | ||
| 1507 | + __ret.field[2] = sign; | ||
| 1508 | + __ret.field[3] = symbol; | ||
| 1509 | + } | ||
| 1510 | + else | ||
| 1511 | + { | ||
| 1512 | + __ret.field[1] = sign; | ||
| 1513 | + __ret.field[2] = symbol; | ||
| 1514 | + __ret.field[3] = none; | ||
| 1515 | + } | ||
| 1516 | + } | ||
| 1517 | + break; | ||
| 1518 | + case 4: | ||
| 1519 | + // 4 The sign immediately follows the symbol. | ||
| 1520 | + if (__precedes) | ||
| 1521 | + { | ||
| 1522 | + __ret.field[0] = symbol; | ||
| 1523 | + __ret.field[1] = sign; | ||
| 1524 | + if (__space) | ||
| 1525 | + { | ||
| 1526 | + __ret.field[2] = space; | ||
| 1527 | + __ret.field[3] = value; | ||
| 1528 | + } | ||
| 1529 | + else | ||
| 1530 | + { | ||
| 1531 | + __ret.field[2] = value; | ||
| 1532 | + __ret.field[3] = none; | ||
| 1533 | + } | ||
| 1534 | + } | ||
| 1535 | + else | ||
| 1536 | + { | ||
| 1537 | + __ret.field[0] = value; | ||
| 1538 | + if (__space) | ||
| 1539 | + { | ||
| 1540 | + __ret.field[1] = space; | ||
| 1541 | + __ret.field[2] = symbol; | ||
| 1542 | + __ret.field[3] = sign; | ||
| 1543 | + } | ||
| 1544 | + else | ||
| 1545 | + { | ||
| 1546 | + __ret.field[1] = symbol; | ||
| 1547 | + __ret.field[2] = sign; | ||
| 1548 | + __ret.field[3] = none; | ||
| 1549 | + } | ||
| 1550 | + } | ||
| 1551 | + break; | ||
| 1552 | + default: | ||
| 1553 | + __ret = pattern(); | ||
| 1554 | + } | ||
| 1555 | + return __ret; | ||
| 1556 | + } | ||
| 1557 | + | ||
| 1558 | + template<> | ||
| 1559 | + void | ||
| 1560 | + moneypunct<char, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
| 1561 | + const char*) | ||
| 1562 | + { | ||
| 1563 | + if (!_M_data) | ||
| 1564 | + _M_data = new __moneypunct_cache<char, true>; | ||
| 1565 | + | ||
| 1566 | + if (!__cloc) | ||
| 1567 | + { | ||
| 1568 | + // "C" locale | ||
| 1569 | + _M_data->_M_decimal_point = '.'; | ||
| 1570 | + _M_data->_M_thousands_sep = ','; | ||
| 1571 | + _M_data->_M_grouping = ""; | ||
| 1572 | + _M_data->_M_grouping_size = 0; | ||
| 1573 | + _M_data->_M_curr_symbol = ""; | ||
| 1574 | + _M_data->_M_curr_symbol_size = 0; | ||
| 1575 | + _M_data->_M_positive_sign = ""; | ||
| 1576 | + _M_data->_M_positive_sign_size = 0; | ||
| 1577 | + _M_data->_M_negative_sign = ""; | ||
| 1578 | + _M_data->_M_negative_sign_size = 0; | ||
| 1579 | + _M_data->_M_frac_digits = 0; | ||
| 1580 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
| 1581 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
| 1582 | + | ||
| 1583 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
| 1584 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
| 1585 | + } | ||
| 1586 | + else | ||
| 1587 | + { | ||
| 1588 | + // Named locale. | ||
| 1589 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
| 1590 | + __cloc)); | ||
| 1591 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
| 1592 | + __cloc)); | ||
| 1593 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
| 1594 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 1595 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
| 1596 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
| 1597 | + | ||
| 1598 | + char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
| 1599 | + if (!__nposn) | ||
| 1600 | + _M_data->_M_negative_sign = "()"; | ||
| 1601 | + else | ||
| 1602 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
| 1603 | + __cloc); | ||
| 1604 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
| 1605 | + | ||
| 1606 | + // _Intl == true | ||
| 1607 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
| 1608 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
| 1609 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
| 1610 | + __cloc)); | ||
| 1611 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
| 1612 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
| 1613 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
| 1614 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
| 1615 | + __pposn); | ||
| 1616 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
| 1617 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
| 1618 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
| 1619 | + __nposn); | ||
| 1620 | + } | ||
| 1621 | + } | ||
| 1622 | + | ||
| 1623 | + template<> | ||
| 1624 | + void | ||
| 1625 | + moneypunct<char, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
| 1626 | + const char*) | ||
| 1627 | + { | ||
| 1628 | + if (!_M_data) | ||
| 1629 | + _M_data = new __moneypunct_cache<char, false>; | ||
| 1630 | + | ||
| 1631 | + if (!__cloc) | ||
| 1632 | + { | ||
| 1633 | + // "C" locale | ||
| 1634 | + _M_data->_M_decimal_point = '.'; | ||
| 1635 | + _M_data->_M_thousands_sep = ','; | ||
| 1636 | + _M_data->_M_grouping = ""; | ||
| 1637 | + _M_data->_M_grouping_size = 0; | ||
| 1638 | + _M_data->_M_curr_symbol = ""; | ||
| 1639 | + _M_data->_M_curr_symbol_size = 0; | ||
| 1640 | + _M_data->_M_positive_sign = ""; | ||
| 1641 | + _M_data->_M_positive_sign_size = 0; | ||
| 1642 | + _M_data->_M_negative_sign = ""; | ||
| 1643 | + _M_data->_M_negative_sign_size = 0; | ||
| 1644 | + _M_data->_M_frac_digits = 0; | ||
| 1645 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
| 1646 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
| 1647 | + | ||
| 1648 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
| 1649 | + _M_data->_M_atoms[__i] = money_base::_S_atoms[__i]; | ||
| 1650 | + } | ||
| 1651 | + else | ||
| 1652 | + { | ||
| 1653 | + // Named locale. | ||
| 1654 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(__MON_DECIMAL_POINT, | ||
| 1655 | + __cloc)); | ||
| 1656 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(__MON_THOUSANDS_SEP, | ||
| 1657 | + __cloc)); | ||
| 1658 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
| 1659 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 1660 | + _M_data->_M_positive_sign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
| 1661 | + _M_data->_M_positive_sign_size = strlen(_M_data->_M_positive_sign); | ||
| 1662 | + | ||
| 1663 | + char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
| 1664 | + if (!__nposn) | ||
| 1665 | + _M_data->_M_negative_sign = "()"; | ||
| 1666 | + else | ||
| 1667 | + _M_data->_M_negative_sign = __nl_langinfo_l(__NEGATIVE_SIGN, | ||
| 1668 | + __cloc); | ||
| 1669 | + _M_data->_M_negative_sign_size = strlen(_M_data->_M_negative_sign); | ||
| 1670 | + | ||
| 1671 | + // _Intl == false | ||
| 1672 | + _M_data->_M_curr_symbol = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
| 1673 | + _M_data->_M_curr_symbol_size = strlen(_M_data->_M_curr_symbol); | ||
| 1674 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
| 1675 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
| 1676 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
| 1677 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
| 1678 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
| 1679 | + __pposn); | ||
| 1680 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
| 1681 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
| 1682 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
| 1683 | + __nposn); | ||
| 1684 | + } | ||
| 1685 | + } | ||
| 1686 | + | ||
| 1687 | + template<> | ||
| 1688 | + moneypunct<char, true>::~moneypunct() | ||
| 1689 | + { delete _M_data; } | ||
| 1690 | + | ||
| 1691 | + template<> | ||
| 1692 | + moneypunct<char, false>::~moneypunct() | ||
| 1693 | + { delete _M_data; } | ||
| 1694 | + | ||
| 1695 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 1696 | + template<> | ||
| 1697 | + void | ||
| 1698 | + moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale __cloc, | ||
| 1699 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1700 | + const char*) | ||
| 1701 | +#else | ||
| 1702 | + const char* __name) | ||
| 1703 | +#endif | ||
| 1704 | + { | ||
| 1705 | + if (!_M_data) | ||
| 1706 | + _M_data = new __moneypunct_cache<wchar_t, true>; | ||
| 1707 | + | ||
| 1708 | + if (!__cloc) | ||
| 1709 | + { | ||
| 1710 | + // "C" locale | ||
| 1711 | + _M_data->_M_decimal_point = L'.'; | ||
| 1712 | + _M_data->_M_thousands_sep = L','; | ||
| 1713 | + _M_data->_M_grouping = ""; | ||
| 1714 | + _M_data->_M_grouping_size = 0; | ||
| 1715 | + _M_data->_M_curr_symbol = L""; | ||
| 1716 | + _M_data->_M_curr_symbol_size = 0; | ||
| 1717 | + _M_data->_M_positive_sign = L""; | ||
| 1718 | + _M_data->_M_positive_sign_size = 0; | ||
| 1719 | + _M_data->_M_negative_sign = L""; | ||
| 1720 | + _M_data->_M_negative_sign_size = 0; | ||
| 1721 | + _M_data->_M_frac_digits = 0; | ||
| 1722 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
| 1723 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
| 1724 | + | ||
| 1725 | + // Use ctype::widen code without the facet... | ||
| 1726 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
| 1727 | + _M_data->_M_atoms[__i] = | ||
| 1728 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
| 1729 | + } | ||
| 1730 | + else | ||
| 1731 | + { | ||
| 1732 | + // Named locale. | ||
| 1733 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1734 | + __c_locale __old = __uselocale(__cloc); | ||
| 1735 | +#else | ||
| 1736 | + // Switch to named locale so that mbsrtowcs will work. | ||
| 1737 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 1738 | + setlocale(LC_ALL, __name); | ||
| 1739 | +#endif | ||
| 1740 | + | ||
| 1741 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 1742 | +#warning fix this... should be monetary | ||
| 1743 | +#endif | ||
| 1744 | +#ifdef __UCLIBC__ | ||
| 1745 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1746 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
| 1747 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
| 1748 | +# else | ||
| 1749 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
| 1750 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
| 1751 | +# endif | ||
| 1752 | +#else | ||
| 1753 | + union { char *__s; wchar_t __w; } __u; | ||
| 1754 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
| 1755 | + _M_data->_M_decimal_point = __u.__w; | ||
| 1756 | + | ||
| 1757 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
| 1758 | + _M_data->_M_thousands_sep = __u.__w; | ||
| 1759 | +#endif | ||
| 1760 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
| 1761 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 1762 | + | ||
| 1763 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
| 1764 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
| 1765 | + const char* __ccurr = __nl_langinfo_l(__INT_CURR_SYMBOL, __cloc); | ||
| 1766 | + | ||
| 1767 | + wchar_t* __wcs_ps = 0; | ||
| 1768 | + wchar_t* __wcs_ns = 0; | ||
| 1769 | + const char __nposn = *(__nl_langinfo_l(__INT_N_SIGN_POSN, __cloc)); | ||
| 1770 | + try | ||
| 1771 | + { | ||
| 1772 | + mbstate_t __state; | ||
| 1773 | + size_t __len = strlen(__cpossign); | ||
| 1774 | + if (__len) | ||
| 1775 | + { | ||
| 1776 | + ++__len; | ||
| 1777 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1778 | + __wcs_ps = new wchar_t[__len]; | ||
| 1779 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
| 1780 | + _M_data->_M_positive_sign = __wcs_ps; | ||
| 1781 | + } | ||
| 1782 | + else | ||
| 1783 | + _M_data->_M_positive_sign = L""; | ||
| 1784 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
| 1785 | + | ||
| 1786 | + __len = strlen(__cnegsign); | ||
| 1787 | + if (!__nposn) | ||
| 1788 | + _M_data->_M_negative_sign = L"()"; | ||
| 1789 | + else if (__len) | ||
| 1790 | + { | ||
| 1791 | + ++__len; | ||
| 1792 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1793 | + __wcs_ns = new wchar_t[__len]; | ||
| 1794 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
| 1795 | + _M_data->_M_negative_sign = __wcs_ns; | ||
| 1796 | + } | ||
| 1797 | + else | ||
| 1798 | + _M_data->_M_negative_sign = L""; | ||
| 1799 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
| 1800 | + | ||
| 1801 | + // _Intl == true. | ||
| 1802 | + __len = strlen(__ccurr); | ||
| 1803 | + if (__len) | ||
| 1804 | + { | ||
| 1805 | + ++__len; | ||
| 1806 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1807 | + wchar_t* __wcs = new wchar_t[__len]; | ||
| 1808 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
| 1809 | + _M_data->_M_curr_symbol = __wcs; | ||
| 1810 | + } | ||
| 1811 | + else | ||
| 1812 | + _M_data->_M_curr_symbol = L""; | ||
| 1813 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
| 1814 | + } | ||
| 1815 | + catch (...) | ||
| 1816 | + { | ||
| 1817 | + delete _M_data; | ||
| 1818 | + _M_data = 0; | ||
| 1819 | + delete __wcs_ps; | ||
| 1820 | + delete __wcs_ns; | ||
| 1821 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1822 | + __uselocale(__old); | ||
| 1823 | +#else | ||
| 1824 | + setlocale(LC_ALL, __old); | ||
| 1825 | + free(__old); | ||
| 1826 | +#endif | ||
| 1827 | + __throw_exception_again; | ||
| 1828 | + } | ||
| 1829 | + | ||
| 1830 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__INT_FRAC_DIGITS, | ||
| 1831 | + __cloc)); | ||
| 1832 | + char __pprecedes = *(__nl_langinfo_l(__INT_P_CS_PRECEDES, __cloc)); | ||
| 1833 | + char __pspace = *(__nl_langinfo_l(__INT_P_SEP_BY_SPACE, __cloc)); | ||
| 1834 | + char __pposn = *(__nl_langinfo_l(__INT_P_SIGN_POSN, __cloc)); | ||
| 1835 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
| 1836 | + __pposn); | ||
| 1837 | + char __nprecedes = *(__nl_langinfo_l(__INT_N_CS_PRECEDES, __cloc)); | ||
| 1838 | + char __nspace = *(__nl_langinfo_l(__INT_N_SEP_BY_SPACE, __cloc)); | ||
| 1839 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
| 1840 | + __nposn); | ||
| 1841 | + | ||
| 1842 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1843 | + __uselocale(__old); | ||
| 1844 | +#else | ||
| 1845 | + setlocale(LC_ALL, __old); | ||
| 1846 | + free(__old); | ||
| 1847 | +#endif | ||
| 1848 | + } | ||
| 1849 | + } | ||
| 1850 | + | ||
| 1851 | + template<> | ||
| 1852 | + void | ||
| 1853 | + moneypunct<wchar_t, false>::_M_initialize_moneypunct(__c_locale __cloc, | ||
| 1854 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1855 | + const char*) | ||
| 1856 | +#else | ||
| 1857 | + const char* __name) | ||
| 1858 | +#endif | ||
| 1859 | + { | ||
| 1860 | + if (!_M_data) | ||
| 1861 | + _M_data = new __moneypunct_cache<wchar_t, false>; | ||
| 1862 | + | ||
| 1863 | + if (!__cloc) | ||
| 1864 | + { | ||
| 1865 | + // "C" locale | ||
| 1866 | + _M_data->_M_decimal_point = L'.'; | ||
| 1867 | + _M_data->_M_thousands_sep = L','; | ||
| 1868 | + _M_data->_M_grouping = ""; | ||
| 1869 | + _M_data->_M_grouping_size = 0; | ||
| 1870 | + _M_data->_M_curr_symbol = L""; | ||
| 1871 | + _M_data->_M_curr_symbol_size = 0; | ||
| 1872 | + _M_data->_M_positive_sign = L""; | ||
| 1873 | + _M_data->_M_positive_sign_size = 0; | ||
| 1874 | + _M_data->_M_negative_sign = L""; | ||
| 1875 | + _M_data->_M_negative_sign_size = 0; | ||
| 1876 | + _M_data->_M_frac_digits = 0; | ||
| 1877 | + _M_data->_M_pos_format = money_base::_S_default_pattern; | ||
| 1878 | + _M_data->_M_neg_format = money_base::_S_default_pattern; | ||
| 1879 | + | ||
| 1880 | + // Use ctype::widen code without the facet... | ||
| 1881 | + for (size_t __i = 0; __i < money_base::_S_end; ++__i) | ||
| 1882 | + _M_data->_M_atoms[__i] = | ||
| 1883 | + static_cast<wchar_t>(money_base::_S_atoms[__i]); | ||
| 1884 | + } | ||
| 1885 | + else | ||
| 1886 | + { | ||
| 1887 | + // Named locale. | ||
| 1888 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1889 | + __c_locale __old = __uselocale(__cloc); | ||
| 1890 | +#else | ||
| 1891 | + // Switch to named locale so that mbsrtowcs will work. | ||
| 1892 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 1893 | + setlocale(LC_ALL, __name); | ||
| 1894 | +#endif | ||
| 1895 | + | ||
| 1896 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 1897 | +#warning fix this... should be monetary | ||
| 1898 | +#endif | ||
| 1899 | +#ifdef __UCLIBC__ | ||
| 1900 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1901 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
| 1902 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
| 1903 | +# else | ||
| 1904 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
| 1905 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
| 1906 | +# endif | ||
| 1907 | +#else | ||
| 1908 | + union { char *__s; wchar_t __w; } __u; | ||
| 1909 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_DECIMAL_POINT_WC, __cloc); | ||
| 1910 | + _M_data->_M_decimal_point = __u.__w; | ||
| 1911 | + | ||
| 1912 | + __u.__s = __nl_langinfo_l(_NL_MONETARY_THOUSANDS_SEP_WC, __cloc); | ||
| 1913 | + _M_data->_M_thousands_sep = __u.__w; | ||
| 1914 | +#endif | ||
| 1915 | + _M_data->_M_grouping = __nl_langinfo_l(__MON_GROUPING, __cloc); | ||
| 1916 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 1917 | + | ||
| 1918 | + const char* __cpossign = __nl_langinfo_l(__POSITIVE_SIGN, __cloc); | ||
| 1919 | + const char* __cnegsign = __nl_langinfo_l(__NEGATIVE_SIGN, __cloc); | ||
| 1920 | + const char* __ccurr = __nl_langinfo_l(__CURRENCY_SYMBOL, __cloc); | ||
| 1921 | + | ||
| 1922 | + wchar_t* __wcs_ps = 0; | ||
| 1923 | + wchar_t* __wcs_ns = 0; | ||
| 1924 | + const char __nposn = *(__nl_langinfo_l(__N_SIGN_POSN, __cloc)); | ||
| 1925 | + try | ||
| 1926 | + { | ||
| 1927 | + mbstate_t __state; | ||
| 1928 | + size_t __len; | ||
| 1929 | + __len = strlen(__cpossign); | ||
| 1930 | + if (__len) | ||
| 1931 | + { | ||
| 1932 | + ++__len; | ||
| 1933 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1934 | + __wcs_ps = new wchar_t[__len]; | ||
| 1935 | + mbsrtowcs(__wcs_ps, &__cpossign, __len, &__state); | ||
| 1936 | + _M_data->_M_positive_sign = __wcs_ps; | ||
| 1937 | + } | ||
| 1938 | + else | ||
| 1939 | + _M_data->_M_positive_sign = L""; | ||
| 1940 | + _M_data->_M_positive_sign_size = wcslen(_M_data->_M_positive_sign); | ||
| 1941 | + | ||
| 1942 | + __len = strlen(__cnegsign); | ||
| 1943 | + if (!__nposn) | ||
| 1944 | + _M_data->_M_negative_sign = L"()"; | ||
| 1945 | + else if (__len) | ||
| 1946 | + { | ||
| 1947 | + ++__len; | ||
| 1948 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1949 | + __wcs_ns = new wchar_t[__len]; | ||
| 1950 | + mbsrtowcs(__wcs_ns, &__cnegsign, __len, &__state); | ||
| 1951 | + _M_data->_M_negative_sign = __wcs_ns; | ||
| 1952 | + } | ||
| 1953 | + else | ||
| 1954 | + _M_data->_M_negative_sign = L""; | ||
| 1955 | + _M_data->_M_negative_sign_size = wcslen(_M_data->_M_negative_sign); | ||
| 1956 | + | ||
| 1957 | + // _Intl == true. | ||
| 1958 | + __len = strlen(__ccurr); | ||
| 1959 | + if (__len) | ||
| 1960 | + { | ||
| 1961 | + ++__len; | ||
| 1962 | + memset(&__state, 0, sizeof(mbstate_t)); | ||
| 1963 | + wchar_t* __wcs = new wchar_t[__len]; | ||
| 1964 | + mbsrtowcs(__wcs, &__ccurr, __len, &__state); | ||
| 1965 | + _M_data->_M_curr_symbol = __wcs; | ||
| 1966 | + } | ||
| 1967 | + else | ||
| 1968 | + _M_data->_M_curr_symbol = L""; | ||
| 1969 | + _M_data->_M_curr_symbol_size = wcslen(_M_data->_M_curr_symbol); | ||
| 1970 | + } | ||
| 1971 | + catch (...) | ||
| 1972 | + { | ||
| 1973 | + delete _M_data; | ||
| 1974 | + _M_data = 0; | ||
| 1975 | + delete __wcs_ps; | ||
| 1976 | + delete __wcs_ns; | ||
| 1977 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1978 | + __uselocale(__old); | ||
| 1979 | +#else | ||
| 1980 | + setlocale(LC_ALL, __old); | ||
| 1981 | + free(__old); | ||
| 1982 | +#endif | ||
| 1983 | + __throw_exception_again; | ||
| 1984 | + } | ||
| 1985 | + | ||
| 1986 | + _M_data->_M_frac_digits = *(__nl_langinfo_l(__FRAC_DIGITS, __cloc)); | ||
| 1987 | + char __pprecedes = *(__nl_langinfo_l(__P_CS_PRECEDES, __cloc)); | ||
| 1988 | + char __pspace = *(__nl_langinfo_l(__P_SEP_BY_SPACE, __cloc)); | ||
| 1989 | + char __pposn = *(__nl_langinfo_l(__P_SIGN_POSN, __cloc)); | ||
| 1990 | + _M_data->_M_pos_format = _S_construct_pattern(__pprecedes, __pspace, | ||
| 1991 | + __pposn); | ||
| 1992 | + char __nprecedes = *(__nl_langinfo_l(__N_CS_PRECEDES, __cloc)); | ||
| 1993 | + char __nspace = *(__nl_langinfo_l(__N_SEP_BY_SPACE, __cloc)); | ||
| 1994 | + _M_data->_M_neg_format = _S_construct_pattern(__nprecedes, __nspace, | ||
| 1995 | + __nposn); | ||
| 1996 | + | ||
| 1997 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 1998 | + __uselocale(__old); | ||
| 1999 | +#else | ||
| 2000 | + setlocale(LC_ALL, __old); | ||
| 2001 | + free(__old); | ||
| 2002 | +#endif | ||
| 2003 | + } | ||
| 2004 | + } | ||
| 2005 | + | ||
| 2006 | + template<> | ||
| 2007 | + moneypunct<wchar_t, true>::~moneypunct() | ||
| 2008 | + { | ||
| 2009 | + if (_M_data->_M_positive_sign_size) | ||
| 2010 | + delete [] _M_data->_M_positive_sign; | ||
| 2011 | + if (_M_data->_M_negative_sign_size | ||
| 2012 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
| 2013 | + delete [] _M_data->_M_negative_sign; | ||
| 2014 | + if (_M_data->_M_curr_symbol_size) | ||
| 2015 | + delete [] _M_data->_M_curr_symbol; | ||
| 2016 | + delete _M_data; | ||
| 2017 | + } | ||
| 2018 | + | ||
| 2019 | + template<> | ||
| 2020 | + moneypunct<wchar_t, false>::~moneypunct() | ||
| 2021 | + { | ||
| 2022 | + if (_M_data->_M_positive_sign_size) | ||
| 2023 | + delete [] _M_data->_M_positive_sign; | ||
| 2024 | + if (_M_data->_M_negative_sign_size | ||
| 2025 | + && wcscmp(_M_data->_M_negative_sign, L"()") != 0) | ||
| 2026 | + delete [] _M_data->_M_negative_sign; | ||
| 2027 | + if (_M_data->_M_curr_symbol_size) | ||
| 2028 | + delete [] _M_data->_M_curr_symbol; | ||
| 2029 | + delete _M_data; | ||
| 2030 | + } | ||
| 2031 | +#endif | ||
| 2032 | +} | ||
| 2033 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc | ||
| 2034 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/numeric_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 2035 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/numeric_members.cc 2005-04-28 01:20:20.000000000 -0500 | ||
| 2036 | @@ -0,0 +1,173 @@ | ||
| 2037 | +// std::numpunct implementation details, GNU version -*- C++ -*- | ||
| 2038 | + | ||
| 2039 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 2040 | +// | ||
| 2041 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2042 | +// software; you can redistribute it and/or modify it under the | ||
| 2043 | +// terms of the GNU General Public License as published by the | ||
| 2044 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2045 | +// any later version. | ||
| 2046 | + | ||
| 2047 | +// This library is distributed in the hope that it will be useful, | ||
| 2048 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2049 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2050 | +// GNU General Public License for more details. | ||
| 2051 | + | ||
| 2052 | +// You should have received a copy of the GNU General Public License along | ||
| 2053 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2054 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2055 | +// USA. | ||
| 2056 | + | ||
| 2057 | +// As a special exception, you may use this file as part of a free software | ||
| 2058 | +// library without restriction. Specifically, if other files instantiate | ||
| 2059 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2060 | +// this file and link it with other files to produce an executable, this | ||
| 2061 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2062 | +// the GNU General Public License. This exception does not however | ||
| 2063 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2064 | +// the GNU General Public License. | ||
| 2065 | + | ||
| 2066 | +// | ||
| 2067 | +// ISO C++ 14882: 22.2.3.1.2 numpunct virtual functions | ||
| 2068 | +// | ||
| 2069 | + | ||
| 2070 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 2071 | + | ||
| 2072 | +#define _LIBC | ||
| 2073 | +#include <locale> | ||
| 2074 | +#undef _LIBC | ||
| 2075 | +#include <bits/c++locale_internal.h> | ||
| 2076 | + | ||
| 2077 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 2078 | +#warning tailor for stub locale support | ||
| 2079 | +#endif | ||
| 2080 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 2081 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
| 2082 | +#endif | ||
| 2083 | + | ||
| 2084 | +namespace std | ||
| 2085 | +{ | ||
| 2086 | + template<> | ||
| 2087 | + void | ||
| 2088 | + numpunct<char>::_M_initialize_numpunct(__c_locale __cloc) | ||
| 2089 | + { | ||
| 2090 | + if (!_M_data) | ||
| 2091 | + _M_data = new __numpunct_cache<char>; | ||
| 2092 | + | ||
| 2093 | + if (!__cloc) | ||
| 2094 | + { | ||
| 2095 | + // "C" locale | ||
| 2096 | + _M_data->_M_grouping = ""; | ||
| 2097 | + _M_data->_M_grouping_size = 0; | ||
| 2098 | + _M_data->_M_use_grouping = false; | ||
| 2099 | + | ||
| 2100 | + _M_data->_M_decimal_point = '.'; | ||
| 2101 | + _M_data->_M_thousands_sep = ','; | ||
| 2102 | + | ||
| 2103 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
| 2104 | + _M_data->_M_atoms_out[__i] = __num_base::_S_atoms_out[__i]; | ||
| 2105 | + | ||
| 2106 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
| 2107 | + _M_data->_M_atoms_in[__j] = __num_base::_S_atoms_in[__j]; | ||
| 2108 | + } | ||
| 2109 | + else | ||
| 2110 | + { | ||
| 2111 | + // Named locale. | ||
| 2112 | + _M_data->_M_decimal_point = *(__nl_langinfo_l(DECIMAL_POINT, | ||
| 2113 | + __cloc)); | ||
| 2114 | + _M_data->_M_thousands_sep = *(__nl_langinfo_l(THOUSANDS_SEP, | ||
| 2115 | + __cloc)); | ||
| 2116 | + | ||
| 2117 | + // Check for NULL, which implies no grouping. | ||
| 2118 | + if (_M_data->_M_thousands_sep == '\0') | ||
| 2119 | + _M_data->_M_grouping = ""; | ||
| 2120 | + else | ||
| 2121 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
| 2122 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 2123 | + } | ||
| 2124 | + | ||
| 2125 | + // NB: There is no way to extact this info from posix locales. | ||
| 2126 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
| 2127 | + _M_data->_M_truename = "true"; | ||
| 2128 | + _M_data->_M_truename_size = 4; | ||
| 2129 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
| 2130 | + _M_data->_M_falsename = "false"; | ||
| 2131 | + _M_data->_M_falsename_size = 5; | ||
| 2132 | + } | ||
| 2133 | + | ||
| 2134 | + template<> | ||
| 2135 | + numpunct<char>::~numpunct() | ||
| 2136 | + { delete _M_data; } | ||
| 2137 | + | ||
| 2138 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 2139 | + template<> | ||
| 2140 | + void | ||
| 2141 | + numpunct<wchar_t>::_M_initialize_numpunct(__c_locale __cloc) | ||
| 2142 | + { | ||
| 2143 | + if (!_M_data) | ||
| 2144 | + _M_data = new __numpunct_cache<wchar_t>; | ||
| 2145 | + | ||
| 2146 | + if (!__cloc) | ||
| 2147 | + { | ||
| 2148 | + // "C" locale | ||
| 2149 | + _M_data->_M_grouping = ""; | ||
| 2150 | + _M_data->_M_grouping_size = 0; | ||
| 2151 | + _M_data->_M_use_grouping = false; | ||
| 2152 | + | ||
| 2153 | + _M_data->_M_decimal_point = L'.'; | ||
| 2154 | + _M_data->_M_thousands_sep = L','; | ||
| 2155 | + | ||
| 2156 | + // Use ctype::widen code without the facet... | ||
| 2157 | + for (size_t __i = 0; __i < __num_base::_S_oend; ++__i) | ||
| 2158 | + _M_data->_M_atoms_out[__i] = | ||
| 2159 | + static_cast<wchar_t>(__num_base::_S_atoms_out[__i]); | ||
| 2160 | + | ||
| 2161 | + for (size_t __j = 0; __j < __num_base::_S_iend; ++__j) | ||
| 2162 | + _M_data->_M_atoms_in[__j] = | ||
| 2163 | + static_cast<wchar_t>(__num_base::_S_atoms_in[__j]); | ||
| 2164 | + } | ||
| 2165 | + else | ||
| 2166 | + { | ||
| 2167 | + // Named locale. | ||
| 2168 | + // NB: In the GNU model wchar_t is always 32 bit wide. | ||
| 2169 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 2170 | +#warning fix this | ||
| 2171 | +#endif | ||
| 2172 | +#ifdef __UCLIBC__ | ||
| 2173 | +# ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 2174 | + _M_data->_M_decimal_point = __cloc->decimal_point_wc; | ||
| 2175 | + _M_data->_M_thousands_sep = __cloc->thousands_sep_wc; | ||
| 2176 | +# else | ||
| 2177 | + _M_data->_M_decimal_point = __global_locale->decimal_point_wc; | ||
| 2178 | + _M_data->_M_thousands_sep = __global_locale->thousands_sep_wc; | ||
| 2179 | +# endif | ||
| 2180 | +#else | ||
| 2181 | + union { char *__s; wchar_t __w; } __u; | ||
| 2182 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_DECIMAL_POINT_WC, __cloc); | ||
| 2183 | + _M_data->_M_decimal_point = __u.__w; | ||
| 2184 | + | ||
| 2185 | + __u.__s = __nl_langinfo_l(_NL_NUMERIC_THOUSANDS_SEP_WC, __cloc); | ||
| 2186 | + _M_data->_M_thousands_sep = __u.__w; | ||
| 2187 | +#endif | ||
| 2188 | + | ||
| 2189 | + if (_M_data->_M_thousands_sep == L'\0') | ||
| 2190 | + _M_data->_M_grouping = ""; | ||
| 2191 | + else | ||
| 2192 | + _M_data->_M_grouping = __nl_langinfo_l(GROUPING, __cloc); | ||
| 2193 | + _M_data->_M_grouping_size = strlen(_M_data->_M_grouping); | ||
| 2194 | + } | ||
| 2195 | + | ||
| 2196 | + // NB: There is no way to extact this info from posix locales. | ||
| 2197 | + // _M_truename = __nl_langinfo_l(YESSTR, __cloc); | ||
| 2198 | + _M_data->_M_truename = L"true"; | ||
| 2199 | + _M_data->_M_truename_size = 4; | ||
| 2200 | + // _M_falsename = __nl_langinfo_l(NOSTR, __cloc); | ||
| 2201 | + _M_data->_M_falsename = L"false"; | ||
| 2202 | + _M_data->_M_falsename_size = 5; | ||
| 2203 | + } | ||
| 2204 | + | ||
| 2205 | + template<> | ||
| 2206 | + numpunct<wchar_t>::~numpunct() | ||
| 2207 | + { delete _M_data; } | ||
| 2208 | + #endif | ||
| 2209 | +} | ||
| 2210 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc | ||
| 2211 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.cc 1969-12-31 18:00:00.000000000 -0600 | ||
| 2212 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.cc 2005-04-28 01:13:15.000000000 -0500 | ||
| 2213 | @@ -0,0 +1,406 @@ | ||
| 2214 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
| 2215 | + | ||
| 2216 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 2217 | +// | ||
| 2218 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2219 | +// software; you can redistribute it and/or modify it under the | ||
| 2220 | +// terms of the GNU General Public License as published by the | ||
| 2221 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2222 | +// any later version. | ||
| 2223 | + | ||
| 2224 | +// This library is distributed in the hope that it will be useful, | ||
| 2225 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2226 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2227 | +// GNU General Public License for more details. | ||
| 2228 | + | ||
| 2229 | +// You should have received a copy of the GNU General Public License along | ||
| 2230 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2231 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2232 | +// USA. | ||
| 2233 | + | ||
| 2234 | +// As a special exception, you may use this file as part of a free software | ||
| 2235 | +// library without restriction. Specifically, if other files instantiate | ||
| 2236 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2237 | +// this file and link it with other files to produce an executable, this | ||
| 2238 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2239 | +// the GNU General Public License. This exception does not however | ||
| 2240 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2241 | +// the GNU General Public License. | ||
| 2242 | + | ||
| 2243 | +// | ||
| 2244 | +// ISO C++ 14882: 22.2.5.1.2 - time_get virtual functions | ||
| 2245 | +// ISO C++ 14882: 22.2.5.3.2 - time_put virtual functions | ||
| 2246 | +// | ||
| 2247 | + | ||
| 2248 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 2249 | + | ||
| 2250 | +#include <locale> | ||
| 2251 | +#include <bits/c++locale_internal.h> | ||
| 2252 | + | ||
| 2253 | +#ifdef __UCLIBC_MJN3_ONLY__ | ||
| 2254 | +#warning tailor for stub locale support | ||
| 2255 | +#endif | ||
| 2256 | +#ifndef __UCLIBC_HAS_XLOCALE__ | ||
| 2257 | +#define __nl_langinfo_l(N, L) nl_langinfo((N)) | ||
| 2258 | +#endif | ||
| 2259 | + | ||
| 2260 | +namespace std | ||
| 2261 | +{ | ||
| 2262 | + template<> | ||
| 2263 | + void | ||
| 2264 | + __timepunct<char>:: | ||
| 2265 | + _M_put(char* __s, size_t __maxlen, const char* __format, | ||
| 2266 | + const tm* __tm) const | ||
| 2267 | + { | ||
| 2268 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 2269 | + const size_t __len = __strftime_l(__s, __maxlen, __format, __tm, | ||
| 2270 | + _M_c_locale_timepunct); | ||
| 2271 | +#else | ||
| 2272 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 2273 | + setlocale(LC_ALL, _M_name_timepunct); | ||
| 2274 | + const size_t __len = strftime(__s, __maxlen, __format, __tm); | ||
| 2275 | + setlocale(LC_ALL, __old); | ||
| 2276 | + free(__old); | ||
| 2277 | +#endif | ||
| 2278 | + // Make sure __s is null terminated. | ||
| 2279 | + if (__len == 0) | ||
| 2280 | + __s[0] = '\0'; | ||
| 2281 | + } | ||
| 2282 | + | ||
| 2283 | + template<> | ||
| 2284 | + void | ||
| 2285 | + __timepunct<char>::_M_initialize_timepunct(__c_locale __cloc) | ||
| 2286 | + { | ||
| 2287 | + if (!_M_data) | ||
| 2288 | + _M_data = new __timepunct_cache<char>; | ||
| 2289 | + | ||
| 2290 | + if (!__cloc) | ||
| 2291 | + { | ||
| 2292 | + // "C" locale | ||
| 2293 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
| 2294 | + | ||
| 2295 | + _M_data->_M_date_format = "%m/%d/%y"; | ||
| 2296 | + _M_data->_M_date_era_format = "%m/%d/%y"; | ||
| 2297 | + _M_data->_M_time_format = "%H:%M:%S"; | ||
| 2298 | + _M_data->_M_time_era_format = "%H:%M:%S"; | ||
| 2299 | + _M_data->_M_date_time_format = ""; | ||
| 2300 | + _M_data->_M_date_time_era_format = ""; | ||
| 2301 | + _M_data->_M_am = "AM"; | ||
| 2302 | + _M_data->_M_pm = "PM"; | ||
| 2303 | + _M_data->_M_am_pm_format = ""; | ||
| 2304 | + | ||
| 2305 | + // Day names, starting with "C"'s Sunday. | ||
| 2306 | + _M_data->_M_day1 = "Sunday"; | ||
| 2307 | + _M_data->_M_day2 = "Monday"; | ||
| 2308 | + _M_data->_M_day3 = "Tuesday"; | ||
| 2309 | + _M_data->_M_day4 = "Wednesday"; | ||
| 2310 | + _M_data->_M_day5 = "Thursday"; | ||
| 2311 | + _M_data->_M_day6 = "Friday"; | ||
| 2312 | + _M_data->_M_day7 = "Saturday"; | ||
| 2313 | + | ||
| 2314 | + // Abbreviated day names, starting with "C"'s Sun. | ||
| 2315 | + _M_data->_M_aday1 = "Sun"; | ||
| 2316 | + _M_data->_M_aday2 = "Mon"; | ||
| 2317 | + _M_data->_M_aday3 = "Tue"; | ||
| 2318 | + _M_data->_M_aday4 = "Wed"; | ||
| 2319 | + _M_data->_M_aday5 = "Thu"; | ||
| 2320 | + _M_data->_M_aday6 = "Fri"; | ||
| 2321 | + _M_data->_M_aday7 = "Sat"; | ||
| 2322 | + | ||
| 2323 | + // Month names, starting with "C"'s January. | ||
| 2324 | + _M_data->_M_month01 = "January"; | ||
| 2325 | + _M_data->_M_month02 = "February"; | ||
| 2326 | + _M_data->_M_month03 = "March"; | ||
| 2327 | + _M_data->_M_month04 = "April"; | ||
| 2328 | + _M_data->_M_month05 = "May"; | ||
| 2329 | + _M_data->_M_month06 = "June"; | ||
| 2330 | + _M_data->_M_month07 = "July"; | ||
| 2331 | + _M_data->_M_month08 = "August"; | ||
| 2332 | + _M_data->_M_month09 = "September"; | ||
| 2333 | + _M_data->_M_month10 = "October"; | ||
| 2334 | + _M_data->_M_month11 = "November"; | ||
| 2335 | + _M_data->_M_month12 = "December"; | ||
| 2336 | + | ||
| 2337 | + // Abbreviated month names, starting with "C"'s Jan. | ||
| 2338 | + _M_data->_M_amonth01 = "Jan"; | ||
| 2339 | + _M_data->_M_amonth02 = "Feb"; | ||
| 2340 | + _M_data->_M_amonth03 = "Mar"; | ||
| 2341 | + _M_data->_M_amonth04 = "Apr"; | ||
| 2342 | + _M_data->_M_amonth05 = "May"; | ||
| 2343 | + _M_data->_M_amonth06 = "Jun"; | ||
| 2344 | + _M_data->_M_amonth07 = "Jul"; | ||
| 2345 | + _M_data->_M_amonth08 = "Aug"; | ||
| 2346 | + _M_data->_M_amonth09 = "Sep"; | ||
| 2347 | + _M_data->_M_amonth10 = "Oct"; | ||
| 2348 | + _M_data->_M_amonth11 = "Nov"; | ||
| 2349 | + _M_data->_M_amonth12 = "Dec"; | ||
| 2350 | + } | ||
| 2351 | + else | ||
| 2352 | + { | ||
| 2353 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
| 2354 | + | ||
| 2355 | + _M_data->_M_date_format = __nl_langinfo_l(D_FMT, __cloc); | ||
| 2356 | + _M_data->_M_date_era_format = __nl_langinfo_l(ERA_D_FMT, __cloc); | ||
| 2357 | + _M_data->_M_time_format = __nl_langinfo_l(T_FMT, __cloc); | ||
| 2358 | + _M_data->_M_time_era_format = __nl_langinfo_l(ERA_T_FMT, __cloc); | ||
| 2359 | + _M_data->_M_date_time_format = __nl_langinfo_l(D_T_FMT, __cloc); | ||
| 2360 | + _M_data->_M_date_time_era_format = __nl_langinfo_l(ERA_D_T_FMT, | ||
| 2361 | + __cloc); | ||
| 2362 | + _M_data->_M_am = __nl_langinfo_l(AM_STR, __cloc); | ||
| 2363 | + _M_data->_M_pm = __nl_langinfo_l(PM_STR, __cloc); | ||
| 2364 | + _M_data->_M_am_pm_format = __nl_langinfo_l(T_FMT_AMPM, __cloc); | ||
| 2365 | + | ||
| 2366 | + // Day names, starting with "C"'s Sunday. | ||
| 2367 | + _M_data->_M_day1 = __nl_langinfo_l(DAY_1, __cloc); | ||
| 2368 | + _M_data->_M_day2 = __nl_langinfo_l(DAY_2, __cloc); | ||
| 2369 | + _M_data->_M_day3 = __nl_langinfo_l(DAY_3, __cloc); | ||
| 2370 | + _M_data->_M_day4 = __nl_langinfo_l(DAY_4, __cloc); | ||
| 2371 | + _M_data->_M_day5 = __nl_langinfo_l(DAY_5, __cloc); | ||
| 2372 | + _M_data->_M_day6 = __nl_langinfo_l(DAY_6, __cloc); | ||
| 2373 | + _M_data->_M_day7 = __nl_langinfo_l(DAY_7, __cloc); | ||
| 2374 | + | ||
| 2375 | + // Abbreviated day names, starting with "C"'s Sun. | ||
| 2376 | + _M_data->_M_aday1 = __nl_langinfo_l(ABDAY_1, __cloc); | ||
| 2377 | + _M_data->_M_aday2 = __nl_langinfo_l(ABDAY_2, __cloc); | ||
| 2378 | + _M_data->_M_aday3 = __nl_langinfo_l(ABDAY_3, __cloc); | ||
| 2379 | + _M_data->_M_aday4 = __nl_langinfo_l(ABDAY_4, __cloc); | ||
| 2380 | + _M_data->_M_aday5 = __nl_langinfo_l(ABDAY_5, __cloc); | ||
| 2381 | + _M_data->_M_aday6 = __nl_langinfo_l(ABDAY_6, __cloc); | ||
| 2382 | + _M_data->_M_aday7 = __nl_langinfo_l(ABDAY_7, __cloc); | ||
| 2383 | + | ||
| 2384 | + // Month names, starting with "C"'s January. | ||
| 2385 | + _M_data->_M_month01 = __nl_langinfo_l(MON_1, __cloc); | ||
| 2386 | + _M_data->_M_month02 = __nl_langinfo_l(MON_2, __cloc); | ||
| 2387 | + _M_data->_M_month03 = __nl_langinfo_l(MON_3, __cloc); | ||
| 2388 | + _M_data->_M_month04 = __nl_langinfo_l(MON_4, __cloc); | ||
| 2389 | + _M_data->_M_month05 = __nl_langinfo_l(MON_5, __cloc); | ||
| 2390 | + _M_data->_M_month06 = __nl_langinfo_l(MON_6, __cloc); | ||
| 2391 | + _M_data->_M_month07 = __nl_langinfo_l(MON_7, __cloc); | ||
| 2392 | + _M_data->_M_month08 = __nl_langinfo_l(MON_8, __cloc); | ||
| 2393 | + _M_data->_M_month09 = __nl_langinfo_l(MON_9, __cloc); | ||
| 2394 | + _M_data->_M_month10 = __nl_langinfo_l(MON_10, __cloc); | ||
| 2395 | + _M_data->_M_month11 = __nl_langinfo_l(MON_11, __cloc); | ||
| 2396 | + _M_data->_M_month12 = __nl_langinfo_l(MON_12, __cloc); | ||
| 2397 | + | ||
| 2398 | + // Abbreviated month names, starting with "C"'s Jan. | ||
| 2399 | + _M_data->_M_amonth01 = __nl_langinfo_l(ABMON_1, __cloc); | ||
| 2400 | + _M_data->_M_amonth02 = __nl_langinfo_l(ABMON_2, __cloc); | ||
| 2401 | + _M_data->_M_amonth03 = __nl_langinfo_l(ABMON_3, __cloc); | ||
| 2402 | + _M_data->_M_amonth04 = __nl_langinfo_l(ABMON_4, __cloc); | ||
| 2403 | + _M_data->_M_amonth05 = __nl_langinfo_l(ABMON_5, __cloc); | ||
| 2404 | + _M_data->_M_amonth06 = __nl_langinfo_l(ABMON_6, __cloc); | ||
| 2405 | + _M_data->_M_amonth07 = __nl_langinfo_l(ABMON_7, __cloc); | ||
| 2406 | + _M_data->_M_amonth08 = __nl_langinfo_l(ABMON_8, __cloc); | ||
| 2407 | + _M_data->_M_amonth09 = __nl_langinfo_l(ABMON_9, __cloc); | ||
| 2408 | + _M_data->_M_amonth10 = __nl_langinfo_l(ABMON_10, __cloc); | ||
| 2409 | + _M_data->_M_amonth11 = __nl_langinfo_l(ABMON_11, __cloc); | ||
| 2410 | + _M_data->_M_amonth12 = __nl_langinfo_l(ABMON_12, __cloc); | ||
| 2411 | + } | ||
| 2412 | + } | ||
| 2413 | + | ||
| 2414 | +#ifdef _GLIBCXX_USE_WCHAR_T | ||
| 2415 | + template<> | ||
| 2416 | + void | ||
| 2417 | + __timepunct<wchar_t>:: | ||
| 2418 | + _M_put(wchar_t* __s, size_t __maxlen, const wchar_t* __format, | ||
| 2419 | + const tm* __tm) const | ||
| 2420 | + { | ||
| 2421 | +#ifdef __UCLIBC_HAS_XLOCALE__ | ||
| 2422 | + __wcsftime_l(__s, __maxlen, __format, __tm, _M_c_locale_timepunct); | ||
| 2423 | + const size_t __len = __wcsftime_l(__s, __maxlen, __format, __tm, | ||
| 2424 | + _M_c_locale_timepunct); | ||
| 2425 | +#else | ||
| 2426 | + char* __old = strdup(setlocale(LC_ALL, NULL)); | ||
| 2427 | + setlocale(LC_ALL, _M_name_timepunct); | ||
| 2428 | + const size_t __len = wcsftime(__s, __maxlen, __format, __tm); | ||
| 2429 | + setlocale(LC_ALL, __old); | ||
| 2430 | + free(__old); | ||
| 2431 | +#endif | ||
| 2432 | + // Make sure __s is null terminated. | ||
| 2433 | + if (__len == 0) | ||
| 2434 | + __s[0] = L'\0'; | ||
| 2435 | + } | ||
| 2436 | + | ||
| 2437 | + template<> | ||
| 2438 | + void | ||
| 2439 | + __timepunct<wchar_t>::_M_initialize_timepunct(__c_locale __cloc) | ||
| 2440 | + { | ||
| 2441 | + if (!_M_data) | ||
| 2442 | + _M_data = new __timepunct_cache<wchar_t>; | ||
| 2443 | + | ||
| 2444 | +#warning wide time stuff | ||
| 2445 | +// if (!__cloc) | ||
| 2446 | + { | ||
| 2447 | + // "C" locale | ||
| 2448 | + _M_c_locale_timepunct = _S_get_c_locale(); | ||
| 2449 | + | ||
| 2450 | + _M_data->_M_date_format = L"%m/%d/%y"; | ||
| 2451 | + _M_data->_M_date_era_format = L"%m/%d/%y"; | ||
| 2452 | + _M_data->_M_time_format = L"%H:%M:%S"; | ||
| 2453 | + _M_data->_M_time_era_format = L"%H:%M:%S"; | ||
| 2454 | + _M_data->_M_date_time_format = L""; | ||
| 2455 | + _M_data->_M_date_time_era_format = L""; | ||
| 2456 | + _M_data->_M_am = L"AM"; | ||
| 2457 | + _M_data->_M_pm = L"PM"; | ||
| 2458 | + _M_data->_M_am_pm_format = L""; | ||
| 2459 | + | ||
| 2460 | + // Day names, starting with "C"'s Sunday. | ||
| 2461 | + _M_data->_M_day1 = L"Sunday"; | ||
| 2462 | + _M_data->_M_day2 = L"Monday"; | ||
| 2463 | + _M_data->_M_day3 = L"Tuesday"; | ||
| 2464 | + _M_data->_M_day4 = L"Wednesday"; | ||
| 2465 | + _M_data->_M_day5 = L"Thursday"; | ||
| 2466 | + _M_data->_M_day6 = L"Friday"; | ||
| 2467 | + _M_data->_M_day7 = L"Saturday"; | ||
| 2468 | + | ||
| 2469 | + // Abbreviated day names, starting with "C"'s Sun. | ||
| 2470 | + _M_data->_M_aday1 = L"Sun"; | ||
| 2471 | + _M_data->_M_aday2 = L"Mon"; | ||
| 2472 | + _M_data->_M_aday3 = L"Tue"; | ||
| 2473 | + _M_data->_M_aday4 = L"Wed"; | ||
| 2474 | + _M_data->_M_aday5 = L"Thu"; | ||
| 2475 | + _M_data->_M_aday6 = L"Fri"; | ||
| 2476 | + _M_data->_M_aday7 = L"Sat"; | ||
| 2477 | + | ||
| 2478 | + // Month names, starting with "C"'s January. | ||
| 2479 | + _M_data->_M_month01 = L"January"; | ||
| 2480 | + _M_data->_M_month02 = L"February"; | ||
| 2481 | + _M_data->_M_month03 = L"March"; | ||
| 2482 | + _M_data->_M_month04 = L"April"; | ||
| 2483 | + _M_data->_M_month05 = L"May"; | ||
| 2484 | + _M_data->_M_month06 = L"June"; | ||
| 2485 | + _M_data->_M_month07 = L"July"; | ||
| 2486 | + _M_data->_M_month08 = L"August"; | ||
| 2487 | + _M_data->_M_month09 = L"September"; | ||
| 2488 | + _M_data->_M_month10 = L"October"; | ||
| 2489 | + _M_data->_M_month11 = L"November"; | ||
| 2490 | + _M_data->_M_month12 = L"December"; | ||
| 2491 | + | ||
| 2492 | + // Abbreviated month names, starting with "C"'s Jan. | ||
| 2493 | + _M_data->_M_amonth01 = L"Jan"; | ||
| 2494 | + _M_data->_M_amonth02 = L"Feb"; | ||
| 2495 | + _M_data->_M_amonth03 = L"Mar"; | ||
| 2496 | + _M_data->_M_amonth04 = L"Apr"; | ||
| 2497 | + _M_data->_M_amonth05 = L"May"; | ||
| 2498 | + _M_data->_M_amonth06 = L"Jun"; | ||
| 2499 | + _M_data->_M_amonth07 = L"Jul"; | ||
| 2500 | + _M_data->_M_amonth08 = L"Aug"; | ||
| 2501 | + _M_data->_M_amonth09 = L"Sep"; | ||
| 2502 | + _M_data->_M_amonth10 = L"Oct"; | ||
| 2503 | + _M_data->_M_amonth11 = L"Nov"; | ||
| 2504 | + _M_data->_M_amonth12 = L"Dec"; | ||
| 2505 | + } | ||
| 2506 | +#if 0 | ||
| 2507 | + else | ||
| 2508 | + { | ||
| 2509 | + _M_c_locale_timepunct = _S_clone_c_locale(__cloc); | ||
| 2510 | + | ||
| 2511 | + union { char *__s; wchar_t *__w; } __u; | ||
| 2512 | + | ||
| 2513 | + __u.__s = __nl_langinfo_l(_NL_WD_FMT, __cloc); | ||
| 2514 | + _M_data->_M_date_format = __u.__w; | ||
| 2515 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_FMT, __cloc); | ||
| 2516 | + _M_data->_M_date_era_format = __u.__w; | ||
| 2517 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT, __cloc); | ||
| 2518 | + _M_data->_M_time_format = __u.__w; | ||
| 2519 | + __u.__s = __nl_langinfo_l(_NL_WERA_T_FMT, __cloc); | ||
| 2520 | + _M_data->_M_time_era_format = __u.__w; | ||
| 2521 | + __u.__s = __nl_langinfo_l(_NL_WD_T_FMT, __cloc); | ||
| 2522 | + _M_data->_M_date_time_format = __u.__w; | ||
| 2523 | + __u.__s = __nl_langinfo_l(_NL_WERA_D_T_FMT, __cloc); | ||
| 2524 | + _M_data->_M_date_time_era_format = __u.__w; | ||
| 2525 | + __u.__s = __nl_langinfo_l(_NL_WAM_STR, __cloc); | ||
| 2526 | + _M_data->_M_am = __u.__w; | ||
| 2527 | + __u.__s = __nl_langinfo_l(_NL_WPM_STR, __cloc); | ||
| 2528 | + _M_data->_M_pm = __u.__w; | ||
| 2529 | + __u.__s = __nl_langinfo_l(_NL_WT_FMT_AMPM, __cloc); | ||
| 2530 | + _M_data->_M_am_pm_format = __u.__w; | ||
| 2531 | + | ||
| 2532 | + // Day names, starting with "C"'s Sunday. | ||
| 2533 | + __u.__s = __nl_langinfo_l(_NL_WDAY_1, __cloc); | ||
| 2534 | + _M_data->_M_day1 = __u.__w; | ||
| 2535 | + __u.__s = __nl_langinfo_l(_NL_WDAY_2, __cloc); | ||
| 2536 | + _M_data->_M_day2 = __u.__w; | ||
| 2537 | + __u.__s = __nl_langinfo_l(_NL_WDAY_3, __cloc); | ||
| 2538 | + _M_data->_M_day3 = __u.__w; | ||
| 2539 | + __u.__s = __nl_langinfo_l(_NL_WDAY_4, __cloc); | ||
| 2540 | + _M_data->_M_day4 = __u.__w; | ||
| 2541 | + __u.__s = __nl_langinfo_l(_NL_WDAY_5, __cloc); | ||
| 2542 | + _M_data->_M_day5 = __u.__w; | ||
| 2543 | + __u.__s = __nl_langinfo_l(_NL_WDAY_6, __cloc); | ||
| 2544 | + _M_data->_M_day6 = __u.__w; | ||
| 2545 | + __u.__s = __nl_langinfo_l(_NL_WDAY_7, __cloc); | ||
| 2546 | + _M_data->_M_day7 = __u.__w; | ||
| 2547 | + | ||
| 2548 | + // Abbreviated day names, starting with "C"'s Sun. | ||
| 2549 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_1, __cloc); | ||
| 2550 | + _M_data->_M_aday1 = __u.__w; | ||
| 2551 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_2, __cloc); | ||
| 2552 | + _M_data->_M_aday2 = __u.__w; | ||
| 2553 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_3, __cloc); | ||
| 2554 | + _M_data->_M_aday3 = __u.__w; | ||
| 2555 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_4, __cloc); | ||
| 2556 | + _M_data->_M_aday4 = __u.__w; | ||
| 2557 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_5, __cloc); | ||
| 2558 | + _M_data->_M_aday5 = __u.__w; | ||
| 2559 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_6, __cloc); | ||
| 2560 | + _M_data->_M_aday6 = __u.__w; | ||
| 2561 | + __u.__s = __nl_langinfo_l(_NL_WABDAY_7, __cloc); | ||
| 2562 | + _M_data->_M_aday7 = __u.__w; | ||
| 2563 | + | ||
| 2564 | + // Month names, starting with "C"'s January. | ||
| 2565 | + __u.__s = __nl_langinfo_l(_NL_WMON_1, __cloc); | ||
| 2566 | + _M_data->_M_month01 = __u.__w; | ||
| 2567 | + __u.__s = __nl_langinfo_l(_NL_WMON_2, __cloc); | ||
| 2568 | + _M_data->_M_month02 = __u.__w; | ||
| 2569 | + __u.__s = __nl_langinfo_l(_NL_WMON_3, __cloc); | ||
| 2570 | + _M_data->_M_month03 = __u.__w; | ||
| 2571 | + __u.__s = __nl_langinfo_l(_NL_WMON_4, __cloc); | ||
| 2572 | + _M_data->_M_month04 = __u.__w; | ||
| 2573 | + __u.__s = __nl_langinfo_l(_NL_WMON_5, __cloc); | ||
| 2574 | + _M_data->_M_month05 = __u.__w; | ||
| 2575 | + __u.__s = __nl_langinfo_l(_NL_WMON_6, __cloc); | ||
| 2576 | + _M_data->_M_month06 = __u.__w; | ||
| 2577 | + __u.__s = __nl_langinfo_l(_NL_WMON_7, __cloc); | ||
| 2578 | + _M_data->_M_month07 = __u.__w; | ||
| 2579 | + __u.__s = __nl_langinfo_l(_NL_WMON_8, __cloc); | ||
| 2580 | + _M_data->_M_month08 = __u.__w; | ||
| 2581 | + __u.__s = __nl_langinfo_l(_NL_WMON_9, __cloc); | ||
| 2582 | + _M_data->_M_month09 = __u.__w; | ||
| 2583 | + __u.__s = __nl_langinfo_l(_NL_WMON_10, __cloc); | ||
| 2584 | + _M_data->_M_month10 = __u.__w; | ||
| 2585 | + __u.__s = __nl_langinfo_l(_NL_WMON_11, __cloc); | ||
| 2586 | + _M_data->_M_month11 = __u.__w; | ||
| 2587 | + __u.__s = __nl_langinfo_l(_NL_WMON_12, __cloc); | ||
| 2588 | + _M_data->_M_month12 = __u.__w; | ||
| 2589 | + | ||
| 2590 | + // Abbreviated month names, starting with "C"'s Jan. | ||
| 2591 | + __u.__s = __nl_langinfo_l(_NL_WABMON_1, __cloc); | ||
| 2592 | + _M_data->_M_amonth01 = __u.__w; | ||
| 2593 | + __u.__s = __nl_langinfo_l(_NL_WABMON_2, __cloc); | ||
| 2594 | + _M_data->_M_amonth02 = __u.__w; | ||
| 2595 | + __u.__s = __nl_langinfo_l(_NL_WABMON_3, __cloc); | ||
| 2596 | + _M_data->_M_amonth03 = __u.__w; | ||
| 2597 | + __u.__s = __nl_langinfo_l(_NL_WABMON_4, __cloc); | ||
| 2598 | + _M_data->_M_amonth04 = __u.__w; | ||
| 2599 | + __u.__s = __nl_langinfo_l(_NL_WABMON_5, __cloc); | ||
| 2600 | + _M_data->_M_amonth05 = __u.__w; | ||
| 2601 | + __u.__s = __nl_langinfo_l(_NL_WABMON_6, __cloc); | ||
| 2602 | + _M_data->_M_amonth06 = __u.__w; | ||
| 2603 | + __u.__s = __nl_langinfo_l(_NL_WABMON_7, __cloc); | ||
| 2604 | + _M_data->_M_amonth07 = __u.__w; | ||
| 2605 | + __u.__s = __nl_langinfo_l(_NL_WABMON_8, __cloc); | ||
| 2606 | + _M_data->_M_amonth08 = __u.__w; | ||
| 2607 | + __u.__s = __nl_langinfo_l(_NL_WABMON_9, __cloc); | ||
| 2608 | + _M_data->_M_amonth09 = __u.__w; | ||
| 2609 | + __u.__s = __nl_langinfo_l(_NL_WABMON_10, __cloc); | ||
| 2610 | + _M_data->_M_amonth10 = __u.__w; | ||
| 2611 | + __u.__s = __nl_langinfo_l(_NL_WABMON_11, __cloc); | ||
| 2612 | + _M_data->_M_amonth11 = __u.__w; | ||
| 2613 | + __u.__s = __nl_langinfo_l(_NL_WABMON_12, __cloc); | ||
| 2614 | + _M_data->_M_amonth12 = __u.__w; | ||
| 2615 | + } | ||
| 2616 | +#endif // 0 | ||
| 2617 | + } | ||
| 2618 | +#endif | ||
| 2619 | +} | ||
| 2620 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h | ||
| 2621 | --- gcc-4.0.0-100/libstdc++-v3/config/locale/uclibc/time_members.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 2622 | +++ gcc-4.0.0/libstdc++-v3/config/locale/uclibc/time_members.h 2004-05-22 18:46:31.000000000 -0500 | ||
| 2623 | @@ -0,0 +1,68 @@ | ||
| 2624 | +// std::time_get, std::time_put implementation, GNU version -*- C++ -*- | ||
| 2625 | + | ||
| 2626 | +// Copyright (C) 2001, 2002, 2003, 2004 Free Software Foundation, Inc. | ||
| 2627 | +// | ||
| 2628 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2629 | +// software; you can redistribute it and/or modify it under the | ||
| 2630 | +// terms of the GNU General Public License as published by the | ||
| 2631 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2632 | +// any later version. | ||
| 2633 | + | ||
| 2634 | +// This library is distributed in the hope that it will be useful, | ||
| 2635 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2636 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2637 | +// GNU General Public License for more details. | ||
| 2638 | + | ||
| 2639 | +// You should have received a copy of the GNU General Public License along | ||
| 2640 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2641 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2642 | +// USA. | ||
| 2643 | + | ||
| 2644 | +// As a special exception, you may use this file as part of a free software | ||
| 2645 | +// library without restriction. Specifically, if other files instantiate | ||
| 2646 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2647 | +// this file and link it with other files to produce an executable, this | ||
| 2648 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2649 | +// the GNU General Public License. This exception does not however | ||
| 2650 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2651 | +// the GNU General Public License. | ||
| 2652 | + | ||
| 2653 | +// | ||
| 2654 | +// ISO C++ 14882: 22.2.5.1.2 - time_get functions | ||
| 2655 | +// ISO C++ 14882: 22.2.5.3.2 - time_put functions | ||
| 2656 | +// | ||
| 2657 | + | ||
| 2658 | +// Written by Benjamin Kosnik <bkoz@redhat.com> | ||
| 2659 | + | ||
| 2660 | + template<typename _CharT> | ||
| 2661 | + __timepunct<_CharT>::__timepunct(size_t __refs) | ||
| 2662 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
| 2663 | + _M_name_timepunct(_S_get_c_name()) | ||
| 2664 | + { _M_initialize_timepunct(); } | ||
| 2665 | + | ||
| 2666 | + template<typename _CharT> | ||
| 2667 | + __timepunct<_CharT>::__timepunct(__cache_type* __cache, size_t __refs) | ||
| 2668 | + : facet(__refs), _M_data(__cache), _M_c_locale_timepunct(NULL), | ||
| 2669 | + _M_name_timepunct(_S_get_c_name()) | ||
| 2670 | + { _M_initialize_timepunct(); } | ||
| 2671 | + | ||
| 2672 | + template<typename _CharT> | ||
| 2673 | + __timepunct<_CharT>::__timepunct(__c_locale __cloc, const char* __s, | ||
| 2674 | + size_t __refs) | ||
| 2675 | + : facet(__refs), _M_data(NULL), _M_c_locale_timepunct(NULL), | ||
| 2676 | + _M_name_timepunct(__s) | ||
| 2677 | + { | ||
| 2678 | + char* __tmp = new char[std::strlen(__s) + 1]; | ||
| 2679 | + std::strcpy(__tmp, __s); | ||
| 2680 | + _M_name_timepunct = __tmp; | ||
| 2681 | + _M_initialize_timepunct(__cloc); | ||
| 2682 | + } | ||
| 2683 | + | ||
| 2684 | + template<typename _CharT> | ||
| 2685 | + __timepunct<_CharT>::~__timepunct() | ||
| 2686 | + { | ||
| 2687 | + if (_M_name_timepunct != _S_get_c_name()) | ||
| 2688 | + delete [] _M_name_timepunct; | ||
| 2689 | + delete _M_data; | ||
| 2690 | + _S_destroy_c_locale(_M_c_locale_timepunct); | ||
| 2691 | + } | ||
| 2692 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h | ||
| 2693 | --- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_base.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 2694 | +++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_base.h 2005-04-28 01:10:27.000000000 -0500 | ||
| 2695 | @@ -0,0 +1,64 @@ | ||
| 2696 | +// Locale support -*- C++ -*- | ||
| 2697 | + | ||
| 2698 | +// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2003, 2004 | ||
| 2699 | +// Free Software Foundation, Inc. | ||
| 2700 | +// | ||
| 2701 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2702 | +// software; you can redistribute it and/or modify it under the | ||
| 2703 | +// terms of the GNU General Public License as published by the | ||
| 2704 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2705 | +// any later version. | ||
| 2706 | + | ||
| 2707 | +// This library is distributed in the hope that it will be useful, | ||
| 2708 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2709 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2710 | +// GNU General Public License for more details. | ||
| 2711 | + | ||
| 2712 | +// You should have received a copy of the GNU General Public License along | ||
| 2713 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2714 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2715 | +// USA. | ||
| 2716 | + | ||
| 2717 | +// As a special exception, you may use this file as part of a free software | ||
| 2718 | +// library without restriction. Specifically, if other files instantiate | ||
| 2719 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2720 | +// this file and link it with other files to produce an executable, this | ||
| 2721 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2722 | +// the GNU General Public License. This exception does not however | ||
| 2723 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2724 | +// the GNU General Public License. | ||
| 2725 | + | ||
| 2726 | +// | ||
| 2727 | +// ISO C++ 14882: 22.1 Locales | ||
| 2728 | +// | ||
| 2729 | + | ||
| 2730 | +/** @file ctype_base.h | ||
| 2731 | + * This is an internal header file, included by other library headers. | ||
| 2732 | + * You should not attempt to use it directly. | ||
| 2733 | + */ | ||
| 2734 | + | ||
| 2735 | +// Information as gleaned from /usr/include/ctype.h | ||
| 2736 | + | ||
| 2737 | + /// @brief Base class for ctype. | ||
| 2738 | + struct ctype_base | ||
| 2739 | + { | ||
| 2740 | + // Note: In uClibc, the following two types depend on configuration. | ||
| 2741 | + | ||
| 2742 | + // Non-standard typedefs. | ||
| 2743 | + typedef const __ctype_touplow_t* __to_type; | ||
| 2744 | + | ||
| 2745 | + // NB: Offsets into ctype<char>::_M_table force a particular size | ||
| 2746 | + // on the mask type. Because of this, we don't use an enum. | ||
| 2747 | + typedef __ctype_mask_t mask; | ||
| 2748 | + static const mask upper = _ISupper; | ||
| 2749 | + static const mask lower = _ISlower; | ||
| 2750 | + static const mask alpha = _ISalpha; | ||
| 2751 | + static const mask digit = _ISdigit; | ||
| 2752 | + static const mask xdigit = _ISxdigit; | ||
| 2753 | + static const mask space = _ISspace; | ||
| 2754 | + static const mask print = _ISprint; | ||
| 2755 | + static const mask graph = _ISalpha | _ISdigit | _ISpunct; | ||
| 2756 | + static const mask cntrl = _IScntrl; | ||
| 2757 | + static const mask punct = _ISpunct; | ||
| 2758 | + static const mask alnum = _ISalpha | _ISdigit; | ||
| 2759 | + }; | ||
| 2760 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h | ||
| 2761 | --- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_inline.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 2762 | +++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_inline.h 2002-06-24 00:49:19.000000000 -0500 | ||
| 2763 | @@ -0,0 +1,69 @@ | ||
| 2764 | +// Locale support -*- C++ -*- | ||
| 2765 | + | ||
| 2766 | +// Copyright (C) 2000, 2002 Free Software Foundation, Inc. | ||
| 2767 | +// | ||
| 2768 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2769 | +// software; you can redistribute it and/or modify it under the | ||
| 2770 | +// terms of the GNU General Public License as published by the | ||
| 2771 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2772 | +// any later version. | ||
| 2773 | + | ||
| 2774 | +// This library is distributed in the hope that it will be useful, | ||
| 2775 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2776 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2777 | +// GNU General Public License for more details. | ||
| 2778 | + | ||
| 2779 | +// You should have received a copy of the GNU General Public License along | ||
| 2780 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2781 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2782 | +// USA. | ||
| 2783 | + | ||
| 2784 | +// As a special exception, you may use this file as part of a free software | ||
| 2785 | +// library without restriction. Specifically, if other files instantiate | ||
| 2786 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2787 | +// this file and link it with other files to produce an executable, this | ||
| 2788 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2789 | +// the GNU General Public License. This exception does not however | ||
| 2790 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2791 | +// the GNU General Public License. | ||
| 2792 | + | ||
| 2793 | +// | ||
| 2794 | +// ISO C++ 14882: 22.1 Locales | ||
| 2795 | +// | ||
| 2796 | + | ||
| 2797 | +// ctype bits to be inlined go here. Non-inlinable (ie virtual do_*) | ||
| 2798 | +// functions go in ctype.cc | ||
| 2799 | + | ||
| 2800 | + bool | ||
| 2801 | + ctype<char>:: | ||
| 2802 | + is(mask __m, char __c) const | ||
| 2803 | + { return _M_table[static_cast<unsigned char>(__c)] & __m; } | ||
| 2804 | + | ||
| 2805 | + const char* | ||
| 2806 | + ctype<char>:: | ||
| 2807 | + is(const char* __low, const char* __high, mask* __vec) const | ||
| 2808 | + { | ||
| 2809 | + while (__low < __high) | ||
| 2810 | + *__vec++ = _M_table[static_cast<unsigned char>(*__low++)]; | ||
| 2811 | + return __high; | ||
| 2812 | + } | ||
| 2813 | + | ||
| 2814 | + const char* | ||
| 2815 | + ctype<char>:: | ||
| 2816 | + scan_is(mask __m, const char* __low, const char* __high) const | ||
| 2817 | + { | ||
| 2818 | + while (__low < __high | ||
| 2819 | + && !(_M_table[static_cast<unsigned char>(*__low)] & __m)) | ||
| 2820 | + ++__low; | ||
| 2821 | + return __low; | ||
| 2822 | + } | ||
| 2823 | + | ||
| 2824 | + const char* | ||
| 2825 | + ctype<char>:: | ||
| 2826 | + scan_not(mask __m, const char* __low, const char* __high) const | ||
| 2827 | + { | ||
| 2828 | + while (__low < __high | ||
| 2829 | + && (_M_table[static_cast<unsigned char>(*__low)] & __m) != 0) | ||
| 2830 | + ++__low; | ||
| 2831 | + return __low; | ||
| 2832 | + } | ||
| 2833 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h | ||
| 2834 | --- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/ctype_noninline.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 2835 | +++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/ctype_noninline.h 2005-04-28 01:10:27.000000000 -0500 | ||
| 2836 | @@ -0,0 +1,92 @@ | ||
| 2837 | +// Locale support -*- C++ -*- | ||
| 2838 | + | ||
| 2839 | +// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004 | ||
| 2840 | +// Free Software Foundation, Inc. | ||
| 2841 | +// | ||
| 2842 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2843 | +// software; you can redistribute it and/or modify it under the | ||
| 2844 | +// terms of the GNU General Public License as published by the | ||
| 2845 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2846 | +// any later version. | ||
| 2847 | + | ||
| 2848 | +// This library is distributed in the hope that it will be useful, | ||
| 2849 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2850 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2851 | +// GNU General Public License for more details. | ||
| 2852 | + | ||
| 2853 | +// You should have received a copy of the GNU General Public License along | ||
| 2854 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2855 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2856 | +// USA. | ||
| 2857 | + | ||
| 2858 | +// As a special exception, you may use this file as part of a free software | ||
| 2859 | +// library without restriction. Specifically, if other files instantiate | ||
| 2860 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2861 | +// this file and link it with other files to produce an executable, this | ||
| 2862 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2863 | +// the GNU General Public License. This exception does not however | ||
| 2864 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2865 | +// the GNU General Public License. | ||
| 2866 | + | ||
| 2867 | +// | ||
| 2868 | +// ISO C++ 14882: 22.1 Locales | ||
| 2869 | +// | ||
| 2870 | + | ||
| 2871 | +// Information as gleaned from /usr/include/ctype.h | ||
| 2872 | + | ||
| 2873 | + const ctype_base::mask* | ||
| 2874 | + ctype<char>::classic_table() throw() | ||
| 2875 | + { return __C_ctype_b; } | ||
| 2876 | + | ||
| 2877 | + ctype<char>::ctype(__c_locale, const mask* __table, bool __del, | ||
| 2878 | + size_t __refs) | ||
| 2879 | + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), | ||
| 2880 | + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) | ||
| 2881 | + { | ||
| 2882 | + _M_toupper = __C_ctype_toupper; | ||
| 2883 | + _M_tolower = __C_ctype_tolower; | ||
| 2884 | + _M_table = __table ? __table : __C_ctype_b; | ||
| 2885 | + memset(_M_widen, 0, sizeof(_M_widen)); | ||
| 2886 | + memset(_M_narrow, 0, sizeof(_M_narrow)); | ||
| 2887 | + } | ||
| 2888 | + | ||
| 2889 | + ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) | ||
| 2890 | + : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()), | ||
| 2891 | + _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0) | ||
| 2892 | + { | ||
| 2893 | + _M_toupper = __C_ctype_toupper; | ||
| 2894 | + _M_tolower = __C_ctype_tolower; | ||
| 2895 | + _M_table = __table ? __table : __C_ctype_b; | ||
| 2896 | + memset(_M_widen, 0, sizeof(_M_widen)); | ||
| 2897 | + memset(_M_narrow, 0, sizeof(_M_narrow)); | ||
| 2898 | + } | ||
| 2899 | + | ||
| 2900 | + char | ||
| 2901 | + ctype<char>::do_toupper(char __c) const | ||
| 2902 | + { return _M_toupper[static_cast<unsigned char>(__c)]; } | ||
| 2903 | + | ||
| 2904 | + const char* | ||
| 2905 | + ctype<char>::do_toupper(char* __low, const char* __high) const | ||
| 2906 | + { | ||
| 2907 | + while (__low < __high) | ||
| 2908 | + { | ||
| 2909 | + *__low = _M_toupper[static_cast<unsigned char>(*__low)]; | ||
| 2910 | + ++__low; | ||
| 2911 | + } | ||
| 2912 | + return __high; | ||
| 2913 | + } | ||
| 2914 | + | ||
| 2915 | + char | ||
| 2916 | + ctype<char>::do_tolower(char __c) const | ||
| 2917 | + { return _M_tolower[static_cast<unsigned char>(__c)]; } | ||
| 2918 | + | ||
| 2919 | + const char* | ||
| 2920 | + ctype<char>::do_tolower(char* __low, const char* __high) const | ||
| 2921 | + { | ||
| 2922 | + while (__low < __high) | ||
| 2923 | + { | ||
| 2924 | + *__low = _M_tolower[static_cast<unsigned char>(*__low)]; | ||
| 2925 | + ++__low; | ||
| 2926 | + } | ||
| 2927 | + return __high; | ||
| 2928 | + } | ||
| 2929 | diff -urN gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h | ||
| 2930 | --- gcc-4.0.0-100/libstdc++-v3/config/os/uclibc/os_defines.h 1969-12-31 18:00:00.000000000 -0600 | ||
| 2931 | +++ gcc-4.0.0/libstdc++-v3/config/os/uclibc/os_defines.h 2005-04-28 01:10:27.000000000 -0500 | ||
| 2932 | @@ -0,0 +1,44 @@ | ||
| 2933 | +// Specific definitions for GNU/Linux -*- C++ -*- | ||
| 2934 | + | ||
| 2935 | +// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | ||
| 2936 | +// | ||
| 2937 | +// This file is part of the GNU ISO C++ Library. This library is free | ||
| 2938 | +// software; you can redistribute it and/or modify it under the | ||
| 2939 | +// terms of the GNU General Public License as published by the | ||
| 2940 | +// Free Software Foundation; either version 2, or (at your option) | ||
| 2941 | +// any later version. | ||
| 2942 | + | ||
| 2943 | +// This library is distributed in the hope that it will be useful, | ||
| 2944 | +// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 2945 | +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 2946 | +// GNU General Public License for more details. | ||
| 2947 | + | ||
| 2948 | +// You should have received a copy of the GNU General Public License along | ||
| 2949 | +// with this library; see the file COPYING. If not, write to the Free | ||
| 2950 | +// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, | ||
| 2951 | +// USA. | ||
| 2952 | + | ||
| 2953 | +// As a special exception, you may use this file as part of a free software | ||
| 2954 | +// library without restriction. Specifically, if other files instantiate | ||
| 2955 | +// templates or use macros or inline functions from this file, or you compile | ||
| 2956 | +// this file and link it with other files to produce an executable, this | ||
| 2957 | +// file does not by itself cause the resulting executable to be covered by | ||
| 2958 | +// the GNU General Public License. This exception does not however | ||
| 2959 | +// invalidate any other reasons why the executable file might be covered by | ||
| 2960 | +// the GNU General Public License. | ||
| 2961 | + | ||
| 2962 | +#ifndef _GLIBCXX_OS_DEFINES | ||
| 2963 | +#define _GLIBCXX_OS_DEFINES 1 | ||
| 2964 | + | ||
| 2965 | +// System-specific #define, typedefs, corrections, etc, go here. This | ||
| 2966 | +// file will come before all others. | ||
| 2967 | + | ||
| 2968 | +// This keeps isanum, et al from being propagated as macros. | ||
| 2969 | +#define __NO_CTYPE 1 | ||
| 2970 | + | ||
| 2971 | +#include <features.h> | ||
| 2972 | + | ||
| 2973 | +// We must not see the optimized string functions GNU libc defines. | ||
| 2974 | +#define __NO_STRING_INLINES | ||
| 2975 | + | ||
| 2976 | +#endif | ||
| 2977 | diff -urN gcc-4.0.0-100/libstdc++-v3/configure gcc-4.0.0/libstdc++-v3/configure | ||
| 2978 | --- gcc-4.0.0-100/libstdc++-v3/configure 2005-04-30 13:06:53.683055232 -0500 | ||
| 2979 | +++ gcc-4.0.0/libstdc++-v3/configure 2005-04-30 12:24:24.000000000 -0500 | ||
| 2980 | @@ -3998,6 +3998,11 @@ | ||
| 2981 | lt_cv_deplibs_check_method=pass_all | ||
| 2982 | ;; | ||
| 2983 | |||
| 2984 | +linux-uclibc*) | ||
| 2985 | + lt_cv_deplibs_check_method=pass_all | ||
| 2986 | + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` | ||
| 2987 | + ;; | ||
| 2988 | + | ||
| 2989 | netbsd* | knetbsd*-gnu) | ||
| 2990 | if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then | ||
| 2991 | lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' | ||
| 2992 | @@ -5672,7 +5677,7 @@ | ||
| 2993 | enableval="$enable_clocale" | ||
| 2994 | |||
| 2995 | case "$enableval" in | ||
| 2996 | - generic|gnu|ieee_1003.1-2001|yes|no|auto) ;; | ||
| 2997 | + generic|gnu|ieee_1003.1-2001|uclibc|yes|no|auto) ;; | ||
| 2998 | *) { { echo "$as_me:$LINENO: error: Unknown argument to enable/disable clocale" >&5 | ||
| 2999 | echo "$as_me: error: Unknown argument to enable/disable clocale" >&2;} | ||
| 3000 | { (exit 1); exit 1; }; } ;; | ||
| 3001 | @@ -5697,6 +5702,9 @@ | ||
| 3002 | # Default to "generic". | ||
| 3003 | if test $enable_clocale_flag = auto; then | ||
| 3004 | case ${target_os} in | ||
| 3005 | + linux-uclibc*) | ||
| 3006 | + enable_clocale_flag=uclibc | ||
| 3007 | + ;; | ||
| 3008 | linux* | gnu* | kfreebsd*-gnu | knetbsd*-gnu) | ||
| 3009 | cat >conftest.$ac_ext <<_ACEOF | ||
| 3010 | /* confdefs.h. */ | ||
| 3011 | @@ -5927,6 +5935,76 @@ | ||
| 3012 | CTIME_CC=config/locale/generic/time_members.cc | ||
| 3013 | CLOCALE_INTERNAL_H=config/locale/generic/c++locale_internal.h | ||
| 3014 | ;; | ||
| 3015 | + uclibc) | ||
| 3016 | + echo "$as_me:$LINENO: result: uclibc" >&5 | ||
| 3017 | +echo "${ECHO_T}uclibc" >&6 | ||
| 3018 | + | ||
| 3019 | + # Declare intention to use gettext, and add support for specific | ||
| 3020 | + # languages. | ||
| 3021 | + # For some reason, ALL_LINGUAS has to be before AM-GNU-GETTEXT | ||
| 3022 | + ALL_LINGUAS="de fr" | ||
| 3023 | + | ||
| 3024 | + # Don't call AM-GNU-GETTEXT here. Instead, assume glibc. | ||
| 3025 | + # Extract the first word of "msgfmt", so it can be a program name with args. | ||
| 3026 | +set dummy msgfmt; ac_word=$2 | ||
| 3027 | +echo "$as_me:$LINENO: checking for $ac_word" >&5 | ||
| 3028 | +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 | ||
| 3029 | +if test "${ac_cv_prog_check_msgfmt+set}" = set; then | ||
| 3030 | + echo $ECHO_N "(cached) $ECHO_C" >&6 | ||
| 3031 | +else | ||
| 3032 | + if test -n "$check_msgfmt"; then | ||
| 3033 | + ac_cv_prog_check_msgfmt="$check_msgfmt" # Let the user override the test. | ||
| 3034 | +else | ||
| 3035 | +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR | ||
| 3036 | +for as_dir in $PATH | ||
| 3037 | +do | ||
| 3038 | + IFS=$as_save_IFS | ||
| 3039 | + test -z "$as_dir" && as_dir=. | ||
| 3040 | + for ac_exec_ext in '' $ac_executable_extensions; do | ||
| 3041 | + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then | ||
| 3042 | + ac_cv_prog_check_msgfmt="yes" | ||
| 3043 | + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 | ||
| 3044 | + break 2 | ||
| 3045 | + fi | ||
| 3046 | +done | ||
| 3047 | +done | ||
| 3048 | + | ||
| 3049 | + test -z "$ac_cv_prog_check_msgfmt" && ac_cv_prog_check_msgfmt="no" | ||
| 3050 | +fi | ||
| 3051 | +fi | ||
| 3052 | +check_msgfmt=$ac_cv_prog_check_msgfmt | ||
| 3053 | +if test -n "$check_msgfmt"; then | ||
| 3054 | + echo "$as_me:$LINENO: result: $check_msgfmt" >&5 | ||
| 3055 | +echo "${ECHO_T}$check_msgfmt" >&6 | ||
| 3056 | +else | ||
| 3057 | + echo "$as_me:$LINENO: result: no" >&5 | ||
| 3058 | +echo "${ECHO_T}no" >&6 | ||
| 3059 | +fi | ||
| 3060 | + | ||
| 3061 | + if test x"$check_msgfmt" = x"yes" && test x"$enable_nls" = x"yes"; then | ||
| 3062 | + USE_NLS=yes | ||
| 3063 | + fi | ||
| 3064 | + # Export the build objects. | ||
| 3065 | + for ling in $ALL_LINGUAS; do \ | ||
| 3066 | + glibcxx_MOFILES="$glibcxx_MOFILES $ling.mo"; \ | ||
| 3067 | + glibcxx_POFILES="$glibcxx_POFILES $ling.po"; \ | ||
| 3068 | + done | ||
| 3069 | + | ||
| 3070 | + | ||
| 3071 | + | ||
| 3072 | + CLOCALE_H=config/locale/uclibc/c_locale.h | ||
| 3073 | + CLOCALE_CC=config/locale/uclibc/c_locale.cc | ||
| 3074 | + CCODECVT_CC=config/locale/uclibc/codecvt_members.cc | ||
| 3075 | + CCOLLATE_CC=config/locale/uclibc/collate_members.cc | ||
| 3076 | + CCTYPE_CC=config/locale/uclibc/ctype_members.cc | ||
| 3077 | + CMESSAGES_H=config/locale/uclibc/messages_members.h | ||
| 3078 | + CMESSAGES_CC=config/locale/uclibc/messages_members.cc | ||
| 3079 | + CMONEY_CC=config/locale/uclibc/monetary_members.cc | ||
| 3080 | + CNUMERIC_CC=config/locale/uclibc/numeric_members.cc | ||
| 3081 | + CTIME_H=config/locale/uclibc/time_members.h | ||
| 3082 | + CTIME_CC=config/locale/uclibc/time_members.cc | ||
| 3083 | + CLOCALE_INTERNAL_H=config/locale/uclibc/c++locale_internal.h | ||
| 3084 | + ;; | ||
| 3085 | esac | ||
| 3086 | |||
| 3087 | # This is where the testsuite looks for locale catalogs, using the | ||
| 3088 | diff -urN gcc-4.0.0-100/libstdc++-v3/configure.host gcc-4.0.0/libstdc++-v3/configure.host | ||
| 3089 | --- gcc-4.0.0-100/libstdc++-v3/configure.host 2005-04-30 13:06:53.688054472 -0500 | ||
| 3090 | +++ gcc-4.0.0/libstdc++-v3/configure.host 2005-04-28 20:20:32.000000000 -0500 | ||
| 3091 | @@ -249,6 +249,12 @@ | ||
| 3092 | ;; | ||
| 3093 | esac | ||
| 3094 | |||
| 3095 | +# Override for uClibc since linux-uclibc gets mishandled above. | ||
| 3096 | +case "${host_os}" in | ||
| 3097 | + *-uclibc*) | ||
| 3098 | + os_include_dir="os/uclibc" | ||
| 3099 | + ;; | ||
| 3100 | +esac | ||
| 3101 | |||
| 3102 | # Set any OS-dependent and CPU-dependent bits. | ||
| 3103 | # THIS TABLE IS SORTED. KEEP IT THAT WAY. | ||
| 3104 | diff -urN gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 gcc-4.0.0/libstdc++-v3/crossconfig.m4 | ||
| 3105 | --- gcc-4.0.0-100/libstdc++-v3/crossconfig.m4 2005-04-30 13:06:53.689054320 -0500 | ||
| 3106 | +++ gcc-4.0.0/libstdc++-v3/crossconfig.m4 2005-04-28 20:27:15.000000000 -0500 | ||
| 3107 | @@ -142,6 +142,98 @@ | ||
| 3108 | ;; | ||
| 3109 | esac | ||
| 3110 | ;; | ||
| 3111 | + *-uclibc*) | ||
| 3112 | +# Temporary hack until we implement the float versions of the libm funcs | ||
| 3113 | + AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ | ||
| 3114 | + machine/endian.h machine/param.h sys/machine.h sys/types.h \ | ||
| 3115 | + fp.h float.h endian.h inttypes.h locale.h float.h stdint.h]) | ||
| 3116 | + SECTION_FLAGS='-ffunction-sections -fdata-sections' | ||
| 3117 | + AC_SUBST(SECTION_FLAGS) | ||
| 3118 | + GLIBCXX_CHECK_LINKER_FEATURES | ||
| 3119 | + GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT | ||
| 3120 | + GLIBCXX_CHECK_WCHAR_T_SUPPORT | ||
| 3121 | + | ||
| 3122 | + # For LFS. | ||
| 3123 | + AC_DEFINE(HAVE_INT64_T) | ||
| 3124 | + case "$target" in | ||
| 3125 | + *-uclinux*) | ||
| 3126 | + # Don't enable LFS with uClinux | ||
| 3127 | + ;; | ||
| 3128 | + *) | ||
| 3129 | + AC_DEFINE(_GLIBCXX_USE_LFS) | ||
| 3130 | + esac | ||
| 3131 | + | ||
| 3132 | + # For showmanyc_helper(). | ||
| 3133 | + AC_CHECK_HEADERS(sys/ioctl.h sys/filio.h) | ||
| 3134 | + GLIBCXX_CHECK_POLL | ||
| 3135 | + GLIBCXX_CHECK_S_ISREG_OR_S_IFREG | ||
| 3136 | + | ||
| 3137 | + # For xsputn_2(). | ||
| 3138 | + AC_CHECK_HEADERS(sys/uio.h) | ||
| 3139 | + GLIBCXX_CHECK_WRITEV | ||
| 3140 | + | ||
| 3141 | +# AC_DEFINE(HAVE_ACOSF) | ||
| 3142 | +# AC_DEFINE(HAVE_ASINF) | ||
| 3143 | +# AC_DEFINE(HAVE_ATANF) | ||
| 3144 | +# AC_DEFINE(HAVE_ATAN2F) | ||
| 3145 | + AC_DEFINE(HAVE_CEILF) | ||
| 3146 | + AC_DEFINE(HAVE_COPYSIGN) | ||
| 3147 | +# AC_DEFINE(HAVE_COPYSIGNF) | ||
| 3148 | +# AC_DEFINE(HAVE_COSF) | ||
| 3149 | +# AC_DEFINE(HAVE_COSHF) | ||
| 3150 | +# AC_DEFINE(HAVE_EXPF) | ||
| 3151 | +# AC_DEFINE(HAVE_FABSF) | ||
| 3152 | + AC_DEFINE(HAVE_FINITE) | ||
| 3153 | + AC_DEFINE(HAVE_FINITEF) | ||
| 3154 | + AC_DEFINE(HAVE_FLOORF) | ||
| 3155 | +# AC_DEFINE(HAVE_FMODF) | ||
| 3156 | +# AC_DEFINE(HAVE_FREXPF) | ||
| 3157 | + AC_DEFINE(HAVE_HYPOT) | ||
| 3158 | +# AC_DEFINE(HAVE_HYPOTF) | ||
| 3159 | + AC_DEFINE(HAVE_ISINF) | ||
| 3160 | + AC_DEFINE(HAVE_ISINFF) | ||
| 3161 | + AC_DEFINE(HAVE_ISNAN) | ||
| 3162 | + AC_DEFINE(HAVE_ISNANF) | ||
| 3163 | +# AC_DEFINE(HAVE_LOGF) | ||
| 3164 | +# AC_DEFINE(HAVE_LOG10F) | ||
| 3165 | +# AC_DEFINE(HAVE_MODFF) | ||
| 3166 | +# AC_DEFINE(HAVE_SINF) | ||
| 3167 | +# AC_DEFINE(HAVE_SINHF) | ||
| 3168 | +# AC_DEFINE(HAVE_SINCOS) | ||
| 3169 | +# AC_DEFINE(HAVE_SINCOSF) | ||
| 3170 | + AC_DEFINE(HAVE_SQRTF) | ||
| 3171 | +# AC_DEFINE(HAVE_TANF) | ||
| 3172 | +# AC_DEFINE(HAVE_TANHF) | ||
| 3173 | + if test x"long_double_math_on_this_cpu" = x"yes"; then | ||
| 3174 | +# AC_DEFINE(HAVE_ACOSL) | ||
| 3175 | +# AC_DEFINE(HAVE_ASINL) | ||
| 3176 | +# AC_DEFINE(HAVE_ATANL) | ||
| 3177 | +# AC_DEFINE(HAVE_ATAN2L) | ||
| 3178 | +# AC_DEFINE(HAVE_CEILL) | ||
| 3179 | +# AC_DEFINE(HAVE_COPYSIGNL) | ||
| 3180 | +# AC_DEFINE(HAVE_COSL) | ||
| 3181 | +# AC_DEFINE(HAVE_COSHL) | ||
| 3182 | +# AC_DEFINE(HAVE_EXPL) | ||
| 3183 | +# AC_DEFINE(HAVE_FABSL) | ||
| 3184 | +# AC_DEFINE(HAVE_FINITEL) | ||
| 3185 | +# AC_DEFINE(HAVE_FLOORL) | ||
| 3186 | +# AC_DEFINE(HAVE_FMODL) | ||
| 3187 | +# AC_DEFINE(HAVE_FREXPL) | ||
| 3188 | +# AC_DEFINE(HAVE_HYPOTL) | ||
| 3189 | +# AC_DEFINE(HAVE_ISINFL) | ||
| 3190 | +# AC_DEFINE(HAVE_ISNANL) | ||
| 3191 | +# AC_DEFINE(HAVE_LOGL) | ||
| 3192 | +# AC_DEFINE(HAVE_LOG10L) | ||
| 3193 | +# AC_DEFINE(HAVE_MODFL) | ||
| 3194 | +# AC_DEFINE(HAVE_POWL) | ||
| 3195 | +# AC_DEFINE(HAVE_SINL) | ||
| 3196 | +# AC_DEFINE(HAVE_SINHL) | ||
| 3197 | +# AC_DEFINE(HAVE_SINCOSL) | ||
| 3198 | +# AC_DEFINE(HAVE_SQRTL) | ||
| 3199 | +# AC_DEFINE(HAVE_TANL) | ||
| 3200 | +# AC_DEFINE(HAVE_TANHL) | ||
| 3201 | + fi | ||
| 3202 | + ;; | ||
| 3203 | *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu) | ||
| 3204 | AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \ | ||
| 3205 | machine/endian.h machine/param.h sys/machine.h sys/types.h \ | ||
| 3206 | @@ -156,7 +248,7 @@ | ||
| 3207 | AC_DEFINE(HAVE_INT64_T) | ||
| 3208 | case "$target" in | ||
| 3209 | *-uclinux*) | ||
| 3210 | - # Don't enable LFS with uClibc | ||
| 3211 | + # Don't enable LFS with uClinux | ||
| 3212 | ;; | ||
| 3213 | *) | ||
| 3214 | AC_DEFINE(_GLIBCXX_USE_LFS) | ||
| 3215 | diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h | ||
| 3216 | --- gcc-4.0.0-100/libstdc++-v3/include/c_compatibility/wchar.h 2005-04-30 13:06:53.690054168 -0500 | ||
| 3217 | +++ gcc-4.0.0/libstdc++-v3/include/c_compatibility/wchar.h 2005-04-28 20:15:56.000000000 -0500 | ||
| 3218 | @@ -101,7 +101,9 @@ | ||
| 3219 | using std::wmemcpy; | ||
| 3220 | using std::wmemmove; | ||
| 3221 | using std::wmemset; | ||
| 3222 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
| 3223 | using std::wcsftime; | ||
| 3224 | +#endif | ||
| 3225 | |||
| 3226 | #if _GLIBCXX_USE_C99 | ||
| 3227 | using std::wcstold; | ||
| 3228 | diff -urN gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h | ||
| 3229 | --- gcc-4.0.0-100/libstdc++-v3/include/c_std/std_cwchar.h 2005-04-30 13:06:53.691054016 -0500 | ||
| 3230 | +++ gcc-4.0.0/libstdc++-v3/include/c_std/std_cwchar.h 2005-04-28 20:15:56.000000000 -0500 | ||
| 3231 | @@ -179,7 +179,9 @@ | ||
| 3232 | using ::wcscoll; | ||
| 3233 | using ::wcscpy; | ||
| 3234 | using ::wcscspn; | ||
| 3235 | +#if _GLIBCXX_HAVE_WCSFTIME | ||
| 3236 | using ::wcsftime; | ||
| 3237 | +#endif | ||
| 3238 | using ::wcslen; | ||
| 3239 | using ::wcsncat; | ||
| 3240 | using ::wcsncmp; | ||
