summaryrefslogtreecommitdiffstats
path: root/contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h')
-rw-r--r--contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h55
1 files changed, 31 insertions, 24 deletions
diff --git a/contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h b/contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h
index 8f06d13..925a5d0 100644
--- a/contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h
+++ b/contrib/libstdc++/config/os/gnu-linux/ctype_noninline.h
@@ -1,6 +1,6 @@
// Locale support -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -34,13 +34,10 @@
// Information as gleaned from /usr/include/ctype.h
-#if _GLIBCPP_C_LOCALE_GNU
+#if _GLIBCXX_C_LOCALE_GNU
const ctype_base::mask*
ctype<char>::classic_table() throw()
- {
- locale::classic();
- return _S_c_locale->__ctype_b;
- }
+ { return _S_get_c_locale()->__ctype_b; }
#else
const ctype_base::mask*
ctype<char>::classic_table() throw()
@@ -59,20 +56,24 @@
}
#endif
-#if _GLIBCPP_C_LOCALE_GNU
+#if _GLIBCXX_C_LOCALE_GNU
ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
size_t __refs)
- : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ : facet(__refs), _M_c_locale_ctype(_S_clone_c_locale(__cloc)),
+ _M_del(__table != 0 && __del),
+ _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),
+ _M_widen_ok(0), _M_narrow_ok(0)
{
- _M_c_locale_ctype = _S_clone_c_locale(__cloc);
- _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;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
}
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
size_t __refs)
- : __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
@@ -87,22 +88,27 @@
#endif
setlocale(LC_CTYPE, __old);
free(__old);
- _M_c_locale_ctype = _S_c_locale;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
}
#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)
+#if _GLIBCXX_C_LOCALE_GNU
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del),
+ _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),
+ _M_widen_ok(0), _M_narrow_ok(0)
{
- _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;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
}
#else
- ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) :
- __ctype_abstract_base<char>(__refs), _M_del(__table != 0 && __del)
+ ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+ : facet(__refs), _M_c_locale_ctype(_S_get_c_locale()),
+ _M_del(__table != 0 && __del), _M_widen_ok(0), _M_narrow_ok(0)
{
char* __old=strdup(setlocale(LC_CTYPE, NULL));
setlocale(LC_CTYPE, "C");
@@ -117,7 +123,8 @@
#endif
setlocale(LC_CTYPE, __old);
free(__old);
- _M_c_locale_ctype = _S_c_locale;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ memset(_M_narrow, 0, sizeof(_M_narrow));
}
#endif
OpenPOWER on IntegriCloud