summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-10 17:37:30 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2008-09-10 17:37:30 +0000
commit0f08c34a25011a1c375755c03b1cf79318913b28 (patch)
treea4315e53b08c6efaaa2a6c4127328ef6cada495d
parentf77b95e79ca9d6faf06e587911e76b7b29f7f2d3 (diff)
downloadgcc-0f08c34a25011a1c375755c03b1cf79318913b28.tar.gz
2008-09-10 Paolo Carlini <paolo.carlini@oracle.com>
* config/locale/darwin/ctype_members.cc (ctype<char>::_M_narrow_init, ctype<char>::_M_widen_init): Don't define here. * config/locale/gnu/ctype_members.cc: Likewise. * config/locale/generic/ctype_members.cc: Likewise. * src/ctype.cc: Define here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@140240 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/config/locale/darwin/ctype_members.cc41
-rw-r--r--libstdc++-v3/config/locale/generic/ctype_members.cc41
-rw-r--r--libstdc++-v3/config/locale/gnu/ctype_members.cc41
-rw-r--r--libstdc++-v3/src/ctype.cc43
5 files changed, 50 insertions, 124 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index b3ef9c0b46a..03371b4c421 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,13 @@
2008-09-10 Paolo Carlini <paolo.carlini@oracle.com>
+ * config/locale/darwin/ctype_members.cc (ctype<char>::_M_narrow_init,
+ ctype<char>::_M_widen_init): Don't define here.
+ * config/locale/gnu/ctype_members.cc: Likewise.
+ * config/locale/generic/ctype_members.cc: Likewise.
+ * src/ctype.cc: Define here.
+
+2008-09-10 Paolo Carlini <paolo.carlini@oracle.com>
+
PR libstdc++/37455
* include/bits/locale_facets.h (ctype<char>::_M_narrow_init,
ctype<char>::_M_widen_init): Don't define inline.
diff --git a/libstdc++-v3/config/locale/darwin/ctype_members.cc b/libstdc++-v3/config/locale/darwin/ctype_members.cc
index f839971469a..63a422c396a 100644
--- a/libstdc++-v3/config/locale/darwin/ctype_members.cc
+++ b/libstdc++-v3/config/locale/darwin/ctype_members.cc
@@ -42,47 +42,6 @@
namespace std
{
- // Fill in the narrowing cache and flag whether all values are
- // valid or not. _M_narrow_ok is set to 2 if memcpy can't
- // be used.
- void
- ctype<char>::
- _M_narrow_init() const
- {
- char __tmp[sizeof(_M_narrow)];
- for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
- __tmp[__i] = __i;
- do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
-
- _M_narrow_ok = 1;
- if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
- _M_narrow_ok = 2;
- else
- {
- // Deal with the special case of zero: renarrow with a
- // different default and compare.
- char __c;
- do_narrow(__tmp, __tmp + 1, 1, &__c);
- if (__c == 1)
- _M_narrow_ok = 2;
- }
- }
-
- void
- ctype<char>::
- _M_widen_init() const
- {
- char __tmp[sizeof(_M_widen)];
- for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
- __tmp[__i] = __i;
- do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
-
- _M_widen_ok = 1;
- // Set _M_widen_ok to 2 if memcpy can't be used.
- if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
- _M_widen_ok = 2;
- }
-
// NB: The other ctype<char> specializations are in src/locale.cc and
// various /config/os/* files.
diff --git a/libstdc++-v3/config/locale/generic/ctype_members.cc b/libstdc++-v3/config/locale/generic/ctype_members.cc
index 036f685d0e7..6b4fbd7ea7d 100644
--- a/libstdc++-v3/config/locale/generic/ctype_members.cc
+++ b/libstdc++-v3/config/locale/generic/ctype_members.cc
@@ -41,47 +41,6 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
- // Fill in the narrowing cache and flag whether all values are
- // valid or not. _M_narrow_ok is set to 2 if memcpy can't
- // be used.
- void
- ctype<char>::
- _M_narrow_init() const
- {
- char __tmp[sizeof(_M_narrow)];
- for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
- __tmp[__i] = __i;
- do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
-
- _M_narrow_ok = 1;
- if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
- _M_narrow_ok = 2;
- else
- {
- // Deal with the special case of zero: renarrow with a
- // different default and compare.
- char __c;
- do_narrow(__tmp, __tmp + 1, 1, &__c);
- if (__c == 1)
- _M_narrow_ok = 2;
- }
- }
-
- void
- ctype<char>::
- _M_widen_init() const
- {
- char __tmp[sizeof(_M_widen)];
- for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
- __tmp[__i] = __i;
- do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
-
- _M_widen_ok = 1;
- // Set _M_widen_ok to 2 if memcpy can't be used.
- if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
- _M_widen_ok = 2;
- }
-
// NB: The other ctype<char> specializations are in src/locale.cc and
// various /config/os/* files.
ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
diff --git a/libstdc++-v3/config/locale/gnu/ctype_members.cc b/libstdc++-v3/config/locale/gnu/ctype_members.cc
index f1243397698..9e517605914 100644
--- a/libstdc++-v3/config/locale/gnu/ctype_members.cc
+++ b/libstdc++-v3/config/locale/gnu/ctype_members.cc
@@ -40,47 +40,6 @@
_GLIBCXX_BEGIN_NAMESPACE(std)
- // Fill in the narrowing cache and flag whether all values are
- // valid or not. _M_narrow_ok is set to 2 if memcpy can't
- // be used.
- void
- ctype<char>::
- _M_narrow_init() const
- {
- char __tmp[sizeof(_M_narrow)];
- for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
- __tmp[__i] = __i;
- do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
-
- _M_narrow_ok = 1;
- if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
- _M_narrow_ok = 2;
- else
- {
- // Deal with the special case of zero: renarrow with a
- // different default and compare.
- char __c;
- do_narrow(__tmp, __tmp + 1, 1, &__c);
- if (__c == 1)
- _M_narrow_ok = 2;
- }
- }
-
- void
- ctype<char>::
- _M_widen_init() const
- {
- char __tmp[sizeof(_M_widen)];
- for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
- __tmp[__i] = __i;
- do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
-
- _M_widen_ok = 1;
- // Set _M_widen_ok to 2 if memcpy can't be used.
- if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
- _M_widen_ok = 2;
- }
-
// NB: The other ctype<char> specializations are in src/locale.cc and
// various /config/os/* files.
ctype_byname<char>::ctype_byname(const char* __s, size_t __refs)
diff --git a/libstdc++-v3/src/ctype.cc b/libstdc++-v3/src/ctype.cc
index a77e8e5b010..cb9c853906e 100644
--- a/libstdc++-v3/src/ctype.cc
+++ b/libstdc++-v3/src/ctype.cc
@@ -1,5 +1,5 @@
// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005,
-// 2006, 2007
+// 2006, 2007, 2008
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -87,6 +87,47 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
delete[] this->table();
}
+ // Fill in the narrowing cache and flag whether all values are
+ // valid or not. _M_narrow_ok is set to 2 if memcpy can't
+ // be used.
+ void
+ ctype<char>::
+ _M_narrow_init() const
+ {
+ char __tmp[sizeof(_M_narrow)];
+ for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
+ __tmp[__i] = __i;
+ do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
+
+ _M_narrow_ok = 1;
+ if (__builtin_memcmp(__tmp, _M_narrow, sizeof(_M_narrow)))
+ _M_narrow_ok = 2;
+ else
+ {
+ // Deal with the special case of zero: renarrow with a
+ // different default and compare.
+ char __c;
+ do_narrow(__tmp, __tmp + 1, 1, &__c);
+ if (__c == 1)
+ _M_narrow_ok = 2;
+ }
+ }
+
+ void
+ ctype<char>::
+ _M_widen_init() const
+ {
+ char __tmp[sizeof(_M_widen)];
+ for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
+ __tmp[__i] = __i;
+ do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
+
+ _M_widen_ok = 1;
+ // Set _M_widen_ok to 2 if memcpy can't be used.
+ if (__builtin_memcmp(__tmp, _M_widen, sizeof(_M_widen)))
+ _M_widen_ok = 2;
+ }
+
#ifdef _GLIBCXX_USE_WCHAR_T
ctype<wchar_t>::ctype(size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs),