summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/config/os
diff options
context:
space:
mode:
authorkan <kan@FreeBSD.org>2002-09-17 04:04:04 +0000
committerkan <kan@FreeBSD.org>2002-09-17 04:04:04 +0000
commitd28dfe2607c93215301923596ce65ae6df3d4cd9 (patch)
treee1352a09cb44f9237c705b49ba032895f99b4cba /contrib/libstdc++/config/os
parent366976642281939a5ef910427ef046ec6f72af8a (diff)
downloadFreeBSD-src-d28dfe2607c93215301923596ce65ae6df3d4cd9.zip
FreeBSD-src-d28dfe2607c93215301923596ce65ae6df3d4cd9.tar.gz
Gcc 3.2.1-prerelease C++ support bits from the FSF anoncvs repo gcc-3_2-branch on 16-Sep-2002 13:23:11 EDT.
Diffstat (limited to 'contrib/libstdc++/config/os')
-rw-r--r--contrib/libstdc++/config/os/gnu-linux/bits/ctype_base.h16
-rw-r--r--contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h85
2 files changed, 70 insertions, 31 deletions
diff --git a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_base.h b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_base.h
index 50a5f79..a431f97 100644
--- a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_base.h
+++ b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_base.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+// Copyright (C) 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -33,20 +33,6 @@
// Information as gleaned from /usr/include/ctype.h
-#if _GLIBCPP_USE_SHADOW_HEADERS
- using _C_legacy::_ISspace;
- using _C_legacy::_ISprint;
- using _C_legacy::_IScntrl;
- using _C_legacy::_ISupper;
- using _C_legacy::_ISlower;
- using _C_legacy::_ISalpha;
- using _C_legacy::_ISdigit;
- using _C_legacy::_ISpunct;
- using _C_legacy::_ISxdigit;
- using _C_legacy::_ISalnum;
- using _C_legacy::_ISgraph;
-#endif
-
struct ctype_base
{
// Non-standard typedefs.
diff --git a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
index ee70ab4..1578828 100644
--- a/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
+++ b/contrib/libstdc++/config/os/gnu-linux/bits/ctype_noninline.h
@@ -34,16 +34,32 @@
// Information as gleaned from /usr/include/ctype.h
-#if _GLIBCPP_USE_SHADOW_HEADERS
- using _C_legacy::__ctype_toupper;
- using _C_legacy::__ctype_tolower;
- using _C_legacy::__ctype_b;
-#endif
-
+#if _GLIBCPP_C_LOCALE_GNU
const ctype_base::mask*
ctype<char>::classic_table() throw()
- { return __ctype_b; }
-
+ {
+ if (!_S_c_locale)
+ _S_create_c_locale(_S_c_locale, "C");
+ return _S_c_locale->__ctype_b;
+ }
+#else
+ const ctype_base::mask*
+ ctype<char>::classic_table() throw()
+ {
+ const ctype_base::mask* __ret;
+ char* __old = strdup(setlocale(LC_CTYPE, NULL));
+ setlocale(LC_CTYPE, "C");
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __ret = *__ctype_b_loc();
+#else
+ __ret = __ctype_b;
+#endif
+ setlocale(LC_CTYPE, __old);
+ free(__old);
+ return __ret;
+ }
+#endif
+
#if _GLIBCPP_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
@@ -57,17 +73,54 @@
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
- : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
- _M_table(__table ? __table : classic_table())
- { _M_c_locale_ctype = _S_c_locale; }
+ : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ {
+ char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ setlocale(LC_CTYPE, "C");
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ _M_toupper = *__ctype_toupper_loc();
+ _M_tolower = *__ctype_tolower_loc();
+ _M_table = __table ? __table : *__ctype_b_loc();
+#else
+ _M_toupper = __ctype_toupper;
+ _M_tolower = __ctype_tolower;
+ _M_table = __table ? __table : __ctype_b;
+#endif
+ setlocale(LC_CTYPE, __old);
+ free(__old);
+ _M_c_locale_ctype = _S_c_locale;
+ }
#endif
+#if _GLIBCPP_C_LOCALE_GNU
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
+ __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ {
+ _M_c_locale_ctype = _S_c_locale;
+ _M_toupper = _M_c_locale_ctype->__ctype_toupper;
+ _M_tolower = _M_c_locale_ctype->__ctype_tolower;
+ _M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
+ }
+#else
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
- __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del),
- _M_toupper(__ctype_toupper), _M_tolower(__ctype_tolower),
- _M_table(__table ? __table : classic_table())
- { _M_c_locale_ctype = _S_c_locale; }
+ __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ {
+ char* __old=strdup(setlocale(LC_CTYPE, NULL));
+ setlocale(LC_CTYPE, "C");
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ _M_toupper = *__ctype_toupper_loc();
+ _M_tolower = *__ctype_tolower_loc();
+ _M_table = __table ? __table : *__ctype_b_loc();
+#else
+ _M_toupper = __ctype_toupper;
+ _M_tolower = __ctype_tolower;
+ _M_table = __table ? __table : __ctype_b;
+#endif
+ setlocale(LC_CTYPE, __old);
+ free(__old);
+ _M_c_locale_ctype = _S_c_locale;
+ }
+#endif
char
ctype<char>::do_toupper(char __c) const
OpenPOWER on IntegriCloud