From d6f0fa250fd41cdd85a536717a7ed542f87d57c5 Mon Sep 17 00:00:00 2001
From: paolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Thu, 31 Mar 2011 16:06:12 +0000
Subject: 2011-03-31  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/48382
	* src/ctype.cc: Do not include <bits/ctype_noninline.h>.
	* src/Makefile.am: Add ctype_configure_char.cc to host_sources.
	* src/Makefile.in: Regenerate.
	* include/Makefile.am: Remove ctype_noninline.h from host_headers.
	* include/Makefile.in: Regenerate.
	* doc/xml/manual/internals.xml: Update.
	* config/os/newlib/ctype_noninline.h: Fixup and rename to...
	* config/os/newlib/ctype_configure_char.cc: ... this.
	* config/os/aix/ctype_noninline.h: Likewise.
	* config/os/aix/ctype_configure_char.cc: Likewise.
	* config/os/vxworks/ctype_noninline.h: Likewise.
	* config/os/vxworks/ctype_configure_char.cc
	* config/os/hpux/ctype_noninline.h: Likewise.
	* config/os/hpux/ctype_configure_char.cc: Likewise.
	* config/os/gnu-linux/ctype_noninline.h: Likewise.
	* config/os/gnu-linux/ctype_configure_char.cc: Likewise.
	* config/os/mingw32/ctype_noninline.h: Likewise.
	* config/os/mingw32/ctype_configure_char.cc: Likewise.
	* config/os/tpf/ctype_noninline.h: Likewise.
	* config/os/tpf/ctype_configure_char.cc: Likewise.
	* config/os/uclibc/ctype_noninline.h: Likewise.
	* config/os/uclibc/ctype_configure_char.cc: Likewise.
	* config/os/bionic/ctype_noninline.h: Likewise.
	* config/os/bionic/ctype_configure_char.cc: Likewise.
	* config/os/djgpp/ctype_noninline.h: Likewise.
	* config/os/djgpp/ctype_configure_char.cc: Likewise.
	* config/os/qnx/qnx6.1/ctype_noninline.h: Likewise.
	* config/os/qnx/qnx6.1/ctype_configure_char.cc: Likewise.
	* config/os/bsd/netbsd/ctype_noninline.h: Likewise.
	* config/os/bsd/netbsd/ctype_configure_char.cc: Likewise.
	* config/os/bsd/darwin/ctype_noninline.h: Likewise.
	* config/os/bsd/darwin/ctype_configure_char.cc: Likewise.
	* config/os/bsd/freebsd/ctype_noninline.h: Likewise.
	* config/os/bsd/freebsd/ctype_configure_char.cc: Likewise.
	* config/os/irix/irix6.5/ctype_noninline.h: Likewise.
	* config/os/irix/irix6.5/ctype_configure_char.cc: Likewise.
	* config/os/generic/ctype_noninline.h: Likewise.
	* config/os/generic/ctype_configure_char.cc: Likewise.
	* config/os/solaris/solaris2.7/ctype_noninline.h: Likewise.
	* config/os/solaris/solaris2.7/ctype_configure_char.cc: Likewise.



git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@171790 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libstdc++-v3/config/os/aix/ctype_configure_char.cc |  99 +++++++++
 libstdc++-v3/config/os/aix/ctype_noninline.h       |  91 --------
 .../config/os/bionic/ctype_configure_char.cc       | 105 +++++++++
 libstdc++-v3/config/os/bionic/ctype_noninline.h    |  98 ---------
 .../config/os/bsd/darwin/ctype_configure_char.cc   |  99 +++++++++
 .../config/os/bsd/darwin/ctype_noninline.h         |  92 --------
 .../config/os/bsd/freebsd/ctype_configure_char.cc  |  99 +++++++++
 .../config/os/bsd/freebsd/ctype_noninline.h        |  92 --------
 .../config/os/bsd/netbsd/ctype_configure_char.cc   | 101 +++++++++
 .../config/os/bsd/netbsd/ctype_noninline.h         |  94 --------
 .../config/os/djgpp/ctype_configure_char.cc        |  99 +++++++++
 libstdc++-v3/config/os/djgpp/ctype_noninline.h     |  92 --------
 .../config/os/generic/ctype_configure_char.cc      |  99 +++++++++
 libstdc++-v3/config/os/generic/ctype_noninline.h   |  92 --------
 .../config/os/gnu-linux/ctype_configure_char.cc    | 196 +++++++++++++++++
 libstdc++-v3/config/os/gnu-linux/ctype_noninline.h | 190 ----------------
 .../config/os/hpux/ctype_configure_char.cc         |  99 +++++++++
 libstdc++-v3/config/os/hpux/ctype_noninline.h      |  92 --------
 .../config/os/irix/irix6.5/ctype_configure_char.cc | 101 +++++++++
 .../config/os/irix/irix6.5/ctype_noninline.h       |  94 --------
 .../config/os/mingw32/ctype_configure_char.cc      | 243 +++++++++++++++++++++
 libstdc++-v3/config/os/mingw32/ctype_noninline.h   | 236 --------------------
 .../config/os/newlib/ctype_configure_char.cc       | 105 +++++++++
 libstdc++-v3/config/os/newlib/ctype_noninline.h    |  97 --------
 .../config/os/qnx/qnx6.1/ctype_configure_char.cc   |  97 ++++++++
 .../config/os/qnx/qnx6.1/ctype_noninline.h         |  89 --------
 .../os/solaris/solaris2.7/ctype_configure_char.cc  |  99 +++++++++
 .../config/os/solaris/solaris2.7/ctype_noninline.h |  92 --------
 libstdc++-v3/config/os/tpf/ctype_configure_char.cc | 120 ++++++++++
 libstdc++-v3/config/os/tpf/ctype_noninline.h       | 113 ----------
 .../config/os/uclibc/ctype_configure_char.cc       |  99 +++++++++
 libstdc++-v3/config/os/uclibc/ctype_noninline.h    |  92 --------
 .../config/os/vxworks/ctype_configure_char.cc      |  99 +++++++++
 libstdc++-v3/config/os/vxworks/ctype_noninline.h   |  92 --------
 34 files changed, 1959 insertions(+), 1838 deletions(-)
 create mode 100644 libstdc++-v3/config/os/aix/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/aix/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/bionic/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/bionic/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/djgpp/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/djgpp/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/generic/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/generic/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/hpux/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/hpux/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/mingw32/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/mingw32/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/newlib/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/newlib/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/tpf/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/tpf/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/uclibc/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/uclibc/ctype_noninline.h
 create mode 100644 libstdc++-v3/config/os/vxworks/ctype_configure_char.cc
 delete mode 100644 libstdc++-v3/config/os/vxworks/ctype_noninline.h

(limited to 'libstdc++-v3/config')

diff --git a/libstdc++-v3/config/os/aix/ctype_configure_char.cc b/libstdc++-v3/config/os/aix/ctype_configure_char.cc
new file mode 100644
index 00000000000..d6ca6b5fbcd
--- /dev/null
+++ b/libstdc++-v3/config/os/aix/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/aix/ctype_noninline.h b/libstdc++-v3/config/os/aix/ctype_noninline.h
deleted file mode 100644
index 71024bdcb5e..00000000000
--- a/libstdc++-v3/config/os/aix/ctype_noninline.h
+++ /dev/null
@@ -1,91 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2000, 2001, 2002, 2009, 2010 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/bionic/ctype_configure_char.cc b/libstdc++-v3/config/os/bionic/ctype_configure_char.cc
new file mode 100644
index 00000000000..d5a8fe16314
--- /dev/null
+++ b/libstdc++-v3/config/os/bionic/ctype_configure_char.cc
@@ -0,0 +1,105 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _ctype_ + 1; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  {
+    int __x = __c;
+    return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
+  }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  {
+    int __x = __c;
+    return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
+  }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/bionic/ctype_noninline.h b/libstdc++-v3/config/os/bionic/ctype_noninline.h
deleted file mode 100644
index 78bc2960800..00000000000
--- a/libstdc++-v3/config/os/bionic/ctype_noninline.h
+++ /dev/null
@@ -1,98 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2010 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return _ctype_ + 1; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  {
-    int __x = __c;
-    return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
-  }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_toupper(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  {
-    int __x = __c;
-    return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
-  }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_tolower(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
diff --git a/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc
new file mode 100644
index 00000000000..30cf4ad6a02
--- /dev/null
+++ b/libstdc++-v3/config/os/bsd/darwin/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h b/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h
deleted file mode 100644
index e8e22f62836..00000000000
--- a/libstdc++-v3/config/os/bsd/darwin/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2000, 2001, 2002, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-  
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc
new file mode 100644
index 00000000000..30cf4ad6a02
--- /dev/null
+++ b/libstdc++-v3/config/os/bsd/freebsd/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
deleted file mode 100644
index e8e22f62836..00000000000
--- a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2000, 2001, 2002, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-  
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc b/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc
new file mode 100644
index 00000000000..77fe6275693
--- /dev/null
+++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_configure_char.cc
@@ -0,0 +1,101 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  extern "C" const u_int8_t _C_ctype_[];
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _C_ctype_ + 1; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table())
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table())
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
deleted file mode 100644
index 724523f5a8a..00000000000
--- a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2000, 2001, 2002, 2003, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-
-  extern "C" const u_int8_t _C_ctype_[];
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return _C_ctype_ + 1; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table())
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table())
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc
new file mode 100644
index 00000000000..f755eb70c4e
--- /dev/null
+++ b/libstdc++-v3/config/os/djgpp/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from DJGPP <ctype.h>
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return __dj_ctype_flags+1; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/djgpp/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/ctype_noninline.h
deleted file mode 100644
index 7b14d38b63d..00000000000
--- a/libstdc++-v3/config/os/djgpp/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from DJGPP <ctype.h>
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return __dj_ctype_flags+1; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/generic/ctype_configure_char.cc b/libstdc++-v3/config/os/generic/ctype_configure_char.cc
new file mode 100644
index 00000000000..0daedf54356
--- /dev/null
+++ b/libstdc++-v3/config/os/generic/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table())
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/generic/ctype_noninline.h b/libstdc++-v3/config/os/generic/ctype_noninline.h
deleted file mode 100644
index 30045899f76..00000000000
--- a/libstdc++-v3/config/os/generic/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
-//  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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table())
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc b/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc
new file mode 100644
index 00000000000..5eadeaaace6
--- /dev/null
+++ b/libstdc++-v3/config/os/gnu-linux/ctype_configure_char.cc
@@ -0,0 +1,196 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+#if _GLIBCXX_C_LOCALE_GNU
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _S_get_c_locale()->__ctype_b; }
+#else
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  {
+    const ctype_base::mask* __ret;
+    char* __old = setlocale(LC_CTYPE, NULL);
+    char* __sav = NULL;
+    if (__builtin_strcmp(__old, "C"))
+      {
+	const size_t __len = __builtin_strlen(__old) + 1;
+	__sav = new char[__len];
+	__builtin_memcpy(__sav, __old, __len);
+	setlocale(LC_CTYPE, "C");
+      }
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+    __ret = *__ctype_b_loc();
+#else
+    __ret = __ctype_b;
+#endif
+    if (__sav)
+      {
+	setlocale(LC_CTYPE, __sav);
+	delete [] __sav;
+      }
+    return __ret;
+  }
+#endif
+
+#if _GLIBCXX_C_LOCALE_GNU
+  ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
+		     size_t __refs)
+  : 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)
+  {
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+#else
+  ctype<char>::ctype(__c_locale, 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 = setlocale(LC_CTYPE, NULL);
+    char* __sav = NULL;
+    if (__builtin_strcmp(__old, "C"))
+      {
+	const size_t __len = __builtin_strlen(__old) + 1;
+	__sav = new char[__len];
+	__builtin_memcpy(__sav, __old, __len);
+	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
+    if (__sav)
+      {
+	setlocale(LC_CTYPE, __sav);
+	delete [] __sav;
+      }
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+#endif
+
+#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)
+  {
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+#else
+  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 = setlocale(LC_CTYPE, NULL);
+    char* __sav = NULL;
+    if (__builtin_strcmp(__old, "C"))
+      {
+	const size_t __len = __builtin_strlen(__old) + 1;
+	__sav = new char[__len];
+	__builtin_memcpy(__sav, __old, __len);
+	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
+    if (__sav)
+      {
+	setlocale(LC_CTYPE, __sav);
+	delete [] __sav;
+      }
+    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
+    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+#endif
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
deleted file mode 100644
index 45785d4a5e8..00000000000
--- a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
+++ /dev/null
@@ -1,190 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
-// 2006, 2007, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from /usr/include/ctype.h
-
-#if _GLIBCXX_C_LOCALE_GNU
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return _S_get_c_locale()->__ctype_b; }
-#else
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  {
-    const ctype_base::mask* __ret;
-    char* __old = setlocale(LC_CTYPE, NULL);
-    char* __sav = NULL;
-    if (__builtin_strcmp(__old, "C"))
-      {
-	const size_t __len = __builtin_strlen(__old) + 1;
-	__sav = new char[__len];
-	__builtin_memcpy(__sav, __old, __len);
-	setlocale(LC_CTYPE, "C");
-      }
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
-    __ret = *__ctype_b_loc();
-#else
-    __ret = __ctype_b;
-#endif
-    if (__sav)
-      {
-	setlocale(LC_CTYPE, __sav);
-	delete [] __sav;
-      }
-    return __ret;
-  }
-#endif
-
-#if _GLIBCXX_C_LOCALE_GNU
-  ctype<char>::ctype(__c_locale __cloc, const mask* __table, bool __del,
-		     size_t __refs)
-  : 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)
-  {
-    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
-    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-#else
-  ctype<char>::ctype(__c_locale, 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 = setlocale(LC_CTYPE, NULL);
-    char* __sav = NULL;
-    if (__builtin_strcmp(__old, "C"))
-      {
-	const size_t __len = __builtin_strlen(__old) + 1;
-	__sav = new char[__len];
-	__builtin_memcpy(__sav, __old, __len);
-	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
-    if (__sav)
-      {
-	setlocale(LC_CTYPE, __sav);
-	delete [] __sav;
-      }
-    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
-    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-#endif
-
-#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)
-  {
-    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
-    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-#else
-  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 = setlocale(LC_CTYPE, NULL);
-    char* __sav = NULL;
-    if (__builtin_strcmp(__old, "C"))
-      {
-	const size_t __len = __builtin_strlen(__old) + 1;
-	__sav = new char[__len];
-	__builtin_memcpy(__sav, __old, __len);
-	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
-    if (__sav)
-      {
-	setlocale(LC_CTYPE, __sav);
-	delete [] __sav;
-      }
-    __builtin_memset(_M_widen, 0, sizeof(_M_widen));
-    __builtin_memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-#endif
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/hpux/ctype_configure_char.cc b/libstdc++-v3/config/os/hpux/ctype_configure_char.cc
new file mode 100644
index 00000000000..4ac958a2797
--- /dev/null
+++ b/libstdc++-v3/config/os/hpux/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return __SB_masks; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : (const mask *) __SB_masks) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : (const mask *) __SB_masks) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/hpux/ctype_noninline.h b/libstdc++-v3/config/os/hpux/ctype_noninline.h
deleted file mode 100644
index 9d178443e29..00000000000
--- a/libstdc++-v3/config/os/hpux/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return __SB_masks; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : (const mask *) __SB_masks) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : (const mask *) __SB_masks) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc b/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc
new file mode 100644
index 00000000000..aa2481bce02
--- /dev/null
+++ b/libstdc++-v3/config/os/irix/irix6.5/ctype_configure_char.cc
@@ -0,0 +1,101 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(!__table ?
+	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(!__table ?
+	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _toupper(__c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = do_toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _tolower(__c); }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = do_tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
deleted file mode 100644
index 3f7af67e860..00000000000
--- a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
+++ /dev/null
@@ -1,94 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2001, 2002, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(!__table ?
-	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(!__table ?
-	   (const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _toupper(__c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = do_toupper(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _tolower(__c); }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = do_tolower(*__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc b/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc
new file mode 100644
index 00000000000..12184075d77
--- /dev/null
+++ b/libstdc++-v3/config/os/mingw32/ctype_configure_char.cc
@@ -0,0 +1,243 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+  // The classic table used in libstdc++ is *not* the C _ctype table
+  // used by mscvrt, but is based on the ctype masks defined for libstdc++
+  // in ctype_base.h.
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  {
+    static const ctype_base::mask _S_classic_table[256] =
+    {
+      cntrl /* null */,
+      cntrl /* ^A */,
+      cntrl /* ^B */,
+      cntrl /* ^C */,
+      cntrl /* ^D */,
+      cntrl /* ^E */,
+      cntrl /* ^F */,
+      cntrl /* ^G */,
+      cntrl /* ^H */,
+      ctype_base::mask(space | cntrl) /* tab */,
+      ctype_base::mask(space | cntrl) /* LF */,
+      ctype_base::mask(space | cntrl) /* ^K */,
+      ctype_base::mask(space | cntrl) /* FF */,
+      ctype_base::mask(space | cntrl) /* ^M */,
+      cntrl /* ^N */,
+      cntrl /* ^O */,
+      cntrl /* ^P */,
+      cntrl /* ^Q */,
+      cntrl /* ^R */,
+      cntrl /* ^S */,
+      cntrl /* ^T */,
+      cntrl /* ^U */,
+      cntrl /* ^V */,
+      cntrl /* ^W */,
+      cntrl /* ^X */,
+      cntrl /* ^Y */,
+      cntrl /* ^Z */,
+      cntrl /* esc */,
+      cntrl /* ^\ */,
+      cntrl /* ^] */,
+      cntrl /* ^^ */,
+      cntrl /* ^_ */,
+      ctype_base::mask(space | print) /*   */,
+      ctype_base::mask(punct | print) /* ! */,
+      ctype_base::mask(punct | print) /* " */,
+      ctype_base::mask(punct | print) /* # */,
+      ctype_base::mask(punct | print) /* $ */,
+      ctype_base::mask(punct | print) /* % */,
+      ctype_base::mask(punct | print) /* & */,
+      ctype_base::mask(punct | print) /* ' */,
+      ctype_base::mask(punct | print) /* ( */,
+      ctype_base::mask(punct | print) /* ) */,
+      ctype_base::mask(punct | print) /* * */,
+      ctype_base::mask(punct | print) /* + */,
+      ctype_base::mask(punct | print) /* , */,
+      ctype_base::mask(punct | print) /* - */,
+      ctype_base::mask(punct | print) /* . */,
+      ctype_base::mask(punct | print) /* / */,
+      ctype_base::mask(digit | xdigit | print) /* 0 */,
+      ctype_base::mask(digit | xdigit | print) /* 1 */,
+      ctype_base::mask(digit | xdigit | print) /* 2 */,
+      ctype_base::mask(digit | xdigit | print) /* 3 */,
+      ctype_base::mask(digit | xdigit | print) /* 4 */,
+      ctype_base::mask(digit | xdigit | print) /* 5 */,
+      ctype_base::mask(digit | xdigit | print) /* 6 */,
+      ctype_base::mask(digit | xdigit | print) /* 7 */,
+      ctype_base::mask(digit | xdigit | print) /* 8 */,
+      ctype_base::mask(digit | xdigit | print) /* 9 */,
+      ctype_base::mask(punct | print) /* : */,
+      ctype_base::mask(punct | print) /* ; */,
+      ctype_base::mask(punct | print) /* < */,
+      ctype_base::mask(punct | print) /* = */,
+      ctype_base::mask(punct | print) /* > */,
+      ctype_base::mask(punct | print) /* ? */,
+      ctype_base::mask(punct | print) /* ! */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* A */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* B */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* C */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* D */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* E */,
+      ctype_base::mask(alpha | upper | xdigit | print) /* F */,
+      ctype_base::mask(alpha | upper | print) /* G */,
+      ctype_base::mask(alpha | upper | print) /* H */,
+      ctype_base::mask(alpha | upper | print) /* I */,
+      ctype_base::mask(alpha | upper | print) /* J */,
+      ctype_base::mask(alpha | upper | print) /* K */,
+      ctype_base::mask(alpha | upper | print) /* L */,
+      ctype_base::mask(alpha | upper | print) /* M */,
+      ctype_base::mask(alpha | upper | print) /* N */,
+      ctype_base::mask(alpha | upper | print) /* O */,
+      ctype_base::mask(alpha | upper | print) /* P */,
+      ctype_base::mask(alpha | upper | print) /* Q */,
+      ctype_base::mask(alpha | upper | print) /* R */,
+      ctype_base::mask(alpha | upper | print) /* S */,
+      ctype_base::mask(alpha | upper | print) /* T */,
+      ctype_base::mask(alpha | upper | print) /* U */,
+      ctype_base::mask(alpha | upper | print) /* V */,
+      ctype_base::mask(alpha | upper | print) /* W */,
+      ctype_base::mask(alpha | upper | print) /* X */,
+      ctype_base::mask(alpha | upper | print) /* Y */,
+      ctype_base::mask(alpha | upper | print) /* Z */,
+      ctype_base::mask(punct | print) /* [ */,
+      ctype_base::mask(punct | print) /* \ */,
+      ctype_base::mask(punct | print) /* ] */,
+      ctype_base::mask(punct | print) /* ^ */,
+      ctype_base::mask(punct | print) /* _ */,
+      ctype_base::mask(punct | print) /* ` */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* a */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* b */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* c */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* d */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* e */,
+      ctype_base::mask(alpha | lower | xdigit | print) /* f */,
+      ctype_base::mask(alpha | lower | print) /* g */,
+      ctype_base::mask(alpha | lower | print) /* h */,
+      ctype_base::mask(alpha | lower | print) /* i */,
+      ctype_base::mask(alpha | lower | print) /* j */,
+      ctype_base::mask(alpha | lower | print) /* k */,
+      ctype_base::mask(alpha | lower | print) /* l */,
+      ctype_base::mask(alpha | lower | print) /* m */,
+      ctype_base::mask(alpha | lower | print) /* n */,
+      ctype_base::mask(alpha | lower | print) /* o */,
+      ctype_base::mask(alpha | lower | print) /* p */,
+      ctype_base::mask(alpha | lower | print) /* q */,
+      ctype_base::mask(alpha | lower | print) /* r */,
+      ctype_base::mask(alpha | lower | print) /* s */,
+      ctype_base::mask(alpha | lower | print) /* t */,
+      ctype_base::mask(alpha | lower | print) /* u */,
+      ctype_base::mask(alpha | lower | print) /* v */,
+      ctype_base::mask(alpha | lower | print) /* w */,
+      ctype_base::mask(alpha | lower | print) /* x */,
+      ctype_base::mask(alpha | lower | print) /* y */,
+      ctype_base::mask(alpha | lower | print) /* x */,
+      ctype_base::mask(punct | print) /* { */,
+      ctype_base::mask(punct | print) /* | */,
+      ctype_base::mask(punct | print) /* } */,
+      ctype_base::mask(punct | print) /* ~ */,
+      cntrl /* del (0x7f)*/,
+      /* The next 128 entries are all 0.   */
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+    };
+    return _S_classic_table;
+  }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/mingw32/ctype_noninline.h b/libstdc++-v3/config/os/mingw32/ctype_noninline.h
deleted file mode 100644
index 10b1fbc490c..00000000000
--- a/libstdc++-v3/config/os/mingw32/ctype_noninline.h
+++ /dev/null
@@ -1,236 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2002, 2007, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// The classic table used in libstdc++ is *not* the C _ctype table
-// used by mscvrt, but is based on the ctype masks defined for libstdc++
-// in ctype_base.h.
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  {
-    static const ctype_base::mask _S_classic_table[256] =
-    {
-      cntrl /* null */,
-      cntrl /* ^A */,
-      cntrl /* ^B */,
-      cntrl /* ^C */,
-      cntrl /* ^D */,
-      cntrl /* ^E */,
-      cntrl /* ^F */,
-      cntrl /* ^G */,
-      cntrl /* ^H */,
-      ctype_base::mask(space | cntrl) /* tab */,
-      ctype_base::mask(space | cntrl) /* LF */,
-      ctype_base::mask(space | cntrl) /* ^K */,
-      ctype_base::mask(space | cntrl) /* FF */,
-      ctype_base::mask(space | cntrl) /* ^M */,
-      cntrl /* ^N */,
-      cntrl /* ^O */,
-      cntrl /* ^P */,
-      cntrl /* ^Q */,
-      cntrl /* ^R */,
-      cntrl /* ^S */,
-      cntrl /* ^T */,
-      cntrl /* ^U */,
-      cntrl /* ^V */,
-      cntrl /* ^W */,
-      cntrl /* ^X */,
-      cntrl /* ^Y */,
-      cntrl /* ^Z */,
-      cntrl /* esc */,
-      cntrl /* ^\ */,
-      cntrl /* ^] */,
-      cntrl /* ^^ */,
-      cntrl /* ^_ */,
-      ctype_base::mask(space | print) /*   */,
-      ctype_base::mask(punct | print) /* ! */,
-      ctype_base::mask(punct | print) /* " */,
-      ctype_base::mask(punct | print) /* # */,
-      ctype_base::mask(punct | print) /* $ */,
-      ctype_base::mask(punct | print) /* % */,
-      ctype_base::mask(punct | print) /* & */,
-      ctype_base::mask(punct | print) /* ' */,
-      ctype_base::mask(punct | print) /* ( */,
-      ctype_base::mask(punct | print) /* ) */,
-      ctype_base::mask(punct | print) /* * */,
-      ctype_base::mask(punct | print) /* + */,
-      ctype_base::mask(punct | print) /* , */,
-      ctype_base::mask(punct | print) /* - */,
-      ctype_base::mask(punct | print) /* . */,
-      ctype_base::mask(punct | print) /* / */,
-      ctype_base::mask(digit | xdigit | print) /* 0 */,
-      ctype_base::mask(digit | xdigit | print) /* 1 */,
-      ctype_base::mask(digit | xdigit | print) /* 2 */,
-      ctype_base::mask(digit | xdigit | print) /* 3 */,
-      ctype_base::mask(digit | xdigit | print) /* 4 */,
-      ctype_base::mask(digit | xdigit | print) /* 5 */,
-      ctype_base::mask(digit | xdigit | print) /* 6 */,
-      ctype_base::mask(digit | xdigit | print) /* 7 */,
-      ctype_base::mask(digit | xdigit | print) /* 8 */,
-      ctype_base::mask(digit | xdigit | print) /* 9 */,
-      ctype_base::mask(punct | print) /* : */,
-      ctype_base::mask(punct | print) /* ; */,
-      ctype_base::mask(punct | print) /* < */,
-      ctype_base::mask(punct | print) /* = */,
-      ctype_base::mask(punct | print) /* > */,
-      ctype_base::mask(punct | print) /* ? */,
-      ctype_base::mask(punct | print) /* ! */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* A */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* B */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* C */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* D */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* E */,
-      ctype_base::mask(alpha | upper | xdigit | print) /* F */,
-      ctype_base::mask(alpha | upper | print) /* G */,
-      ctype_base::mask(alpha | upper | print) /* H */,
-      ctype_base::mask(alpha | upper | print) /* I */,
-      ctype_base::mask(alpha | upper | print) /* J */,
-      ctype_base::mask(alpha | upper | print) /* K */,
-      ctype_base::mask(alpha | upper | print) /* L */,
-      ctype_base::mask(alpha | upper | print) /* M */,
-      ctype_base::mask(alpha | upper | print) /* N */,
-      ctype_base::mask(alpha | upper | print) /* O */,
-      ctype_base::mask(alpha | upper | print) /* P */,
-      ctype_base::mask(alpha | upper | print) /* Q */,
-      ctype_base::mask(alpha | upper | print) /* R */,
-      ctype_base::mask(alpha | upper | print) /* S */,
-      ctype_base::mask(alpha | upper | print) /* T */,
-      ctype_base::mask(alpha | upper | print) /* U */,
-      ctype_base::mask(alpha | upper | print) /* V */,
-      ctype_base::mask(alpha | upper | print) /* W */,
-      ctype_base::mask(alpha | upper | print) /* X */,
-      ctype_base::mask(alpha | upper | print) /* Y */,
-      ctype_base::mask(alpha | upper | print) /* Z */,
-      ctype_base::mask(punct | print) /* [ */,
-      ctype_base::mask(punct | print) /* \ */,
-      ctype_base::mask(punct | print) /* ] */,
-      ctype_base::mask(punct | print) /* ^ */,
-      ctype_base::mask(punct | print) /* _ */,
-      ctype_base::mask(punct | print) /* ` */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* a */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* b */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* c */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* d */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* e */,
-      ctype_base::mask(alpha | lower | xdigit | print) /* f */,
-      ctype_base::mask(alpha | lower | print) /* g */,
-      ctype_base::mask(alpha | lower | print) /* h */,
-      ctype_base::mask(alpha | lower | print) /* i */,
-      ctype_base::mask(alpha | lower | print) /* j */,
-      ctype_base::mask(alpha | lower | print) /* k */,
-      ctype_base::mask(alpha | lower | print) /* l */,
-      ctype_base::mask(alpha | lower | print) /* m */,
-      ctype_base::mask(alpha | lower | print) /* n */,
-      ctype_base::mask(alpha | lower | print) /* o */,
-      ctype_base::mask(alpha | lower | print) /* p */,
-      ctype_base::mask(alpha | lower | print) /* q */,
-      ctype_base::mask(alpha | lower | print) /* r */,
-      ctype_base::mask(alpha | lower | print) /* s */,
-      ctype_base::mask(alpha | lower | print) /* t */,
-      ctype_base::mask(alpha | lower | print) /* u */,
-      ctype_base::mask(alpha | lower | print) /* v */,
-      ctype_base::mask(alpha | lower | print) /* w */,
-      ctype_base::mask(alpha | lower | print) /* x */,
-      ctype_base::mask(alpha | lower | print) /* y */,
-      ctype_base::mask(alpha | lower | print) /* x */,
-      ctype_base::mask(punct | print) /* { */,
-      ctype_base::mask(punct | print) /* | */,
-      ctype_base::mask(punct | print) /* } */,
-      ctype_base::mask(punct | print) /* ~ */,
-      cntrl /* del (0x7f)*/,
-      /* The next 128 entries are all 0.   */
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
-      0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-    };
-    return _S_classic_table;
-  }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return (this->is(ctype_base::lower, __c) ? (__c - 'a' + 'A') : __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_toupper(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return (this->is(ctype_base::upper, __c) ? (__c - 'A' + 'a') : __c); }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_tolower(*__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/newlib/ctype_configure_char.cc b/libstdc++-v3/config/os/newlib/ctype_configure_char.cc
new file mode 100644
index 00000000000..d5a8fe16314
--- /dev/null
+++ b/libstdc++-v3/config/os/newlib/ctype_configure_char.cc
@@ -0,0 +1,105 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return _ctype_ + 1; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del),
+  _M_toupper(NULL), _M_tolower(NULL),
+  _M_table(__table ? __table : classic_table())
+  {
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  {
+    int __x = __c;
+    return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
+  }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  {
+    int __x = __c;
+    return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
+  }
+
+  const char*
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = this->do_tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/newlib/ctype_noninline.h b/libstdc++-v3/config/os/newlib/ctype_noninline.h
deleted file mode 100644
index 947bce589e6..00000000000
--- a/libstdc++-v3/config/os/newlib/ctype_noninline.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2000, 2001, 2002, 2009, 2010 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return _ctype_ + 1; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del),
-  _M_toupper(NULL), _M_tolower(NULL),
-  _M_table(__table ? __table : classic_table())
-  {
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  {
-    int __x = __c;
-    return (this->is(ctype_base::lower, __c) ? (__x - 'a' + 'A') : __x);
-  }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_toupper(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  {
-    int __x = __c;
-    return (this->is(ctype_base::upper, __c) ? (__x - 'A' + 'a') : __x);
-  }
-
-  const char*
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = this->do_tolower(*__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc
new file mode 100644
index 00000000000..b6dd7f43204
--- /dev/null
+++ b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_configure_char.cc
@@ -0,0 +1,97 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+  
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return 0; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return ::toupper((int) __c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::toupper((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return ::tolower((int) __c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = ::tolower((int) *__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
deleted file mode 100644
index b74e070594e..00000000000
--- a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
+++ /dev/null
@@ -1,89 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2002, 2009, 2010 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-  
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return 0; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return ::toupper((int) __c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::toupper((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return ::tolower((int) __c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = ::tolower((int) *__low);
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc
new file mode 100644
index 00000000000..d3519429a01
--- /dev/null
+++ b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+  
+  const ctype_base::mask* 
+  ctype<char>::classic_table() throw()
+  { return __ctype_mask; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(__trans_upper), _M_tolower(__trans_lower),
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(__trans_upper), _M_tolower(__trans_lower),
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
deleted file mode 100644
index 4713c87265b..00000000000
--- a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-  
-  const ctype_base::mask* 
-  ctype<char>::classic_table() throw()
-  { return __ctype_mask; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(__trans_upper), _M_tolower(__trans_lower),
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(__trans_upper), _M_tolower(__trans_lower),
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/tpf/ctype_configure_char.cc b/libstdc++-v3/config/os/tpf/ctype_configure_char.cc
new file mode 100644
index 00000000000..643abd3f728
--- /dev/null
+++ b/libstdc++-v3/config/os/tpf/ctype_configure_char.cc
@@ -0,0 +1,120 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  {
+    const ctype_base::mask* __ret;
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
+    setlocale(LC_CTYPE, "C");
+    __ret = *__ctype_b_loc();
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
+    return __ret;
+  }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del)
+  {
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
+    setlocale(LC_CTYPE, "C");
+    _M_toupper = *__ctype_toupper_loc();
+    _M_tolower = *__ctype_tolower_loc();
+    _M_table = __table ? __table : *__ctype_b_loc();
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
+    _M_c_locale_ctype = _S_get_c_locale();
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
+  : facet(__refs), _M_del(__table != 0 && __del)
+  {
+    char* __old = setlocale(LC_CTYPE, NULL);
+    const size_t __len = __builtin_strlen(__old) + 1;
+    char* __sav = new char[__len];
+    __builtin_memcpy(__sav, __old, __len);
+    setlocale(LC_CTYPE, "C");
+    _M_toupper = *__ctype_toupper_loc();
+    _M_tolower = *__ctype_tolower_loc();
+    _M_table = __table ? __table : *__ctype_b_loc();
+    setlocale(LC_CTYPE, __sav);
+    delete [] __sav;
+    _M_c_locale_ctype = _S_get_c_locale();
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/tpf/ctype_noninline.h b/libstdc++-v3/config/os/tpf/ctype_noninline.h
deleted file mode 100644
index 251270344c0..00000000000
--- a/libstdc++-v3/config/os/tpf/ctype_noninline.h
+++ /dev/null
@@ -1,113 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  {
-    const ctype_base::mask* __ret;
-    char* __old = setlocale(LC_CTYPE, NULL);
-    const size_t __len = __builtin_strlen(__old) + 1;
-    char* __sav = new char[__len];
-    __builtin_memcpy(__sav, __old, __len);
-    setlocale(LC_CTYPE, "C");
-    __ret = *__ctype_b_loc();
-    setlocale(LC_CTYPE, __sav);
-    delete [] __sav;
-    return __ret;
-  }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del)
-  {
-    char* __old = setlocale(LC_CTYPE, NULL);
-    const size_t __len = __builtin_strlen(__old) + 1;
-    char* __sav = new char[__len];
-    __builtin_memcpy(__sav, __old, __len);
-    setlocale(LC_CTYPE, "C");
-    _M_toupper = *__ctype_toupper_loc();
-    _M_tolower = *__ctype_tolower_loc();
-    _M_table = __table ? __table : *__ctype_b_loc();
-    setlocale(LC_CTYPE, __sav);
-    delete [] __sav;
-    _M_c_locale_ctype = _S_get_c_locale();
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
-  : facet(__refs), _M_del(__table != 0 && __del)
-  {
-    char* __old = setlocale(LC_CTYPE, NULL);
-    const size_t __len = __builtin_strlen(__old) + 1;
-    char* __sav = new char[__len];
-    __builtin_memcpy(__sav, __old, __len);
-    setlocale(LC_CTYPE, "C");
-    _M_toupper = *__ctype_toupper_loc();
-    _M_tolower = *__ctype_tolower_loc();
-    _M_table = __table ? __table : *__ctype_b_loc();
-    setlocale(LC_CTYPE, __sav);
-    delete [] __sav;
-    _M_c_locale_ctype = _S_get_c_locale();
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc b/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc
new file mode 100644
index 00000000000..245c7991725
--- /dev/null
+++ b/libstdc++-v3/config/os/uclibc/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from /usr/include/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return __C_ctype_b; }
+
+  ctype<char>::ctype(__c_locale, 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)
+  {
+    _M_toupper = __C_ctype_toupper;
+    _M_tolower = __C_ctype_tolower;
+    _M_table = __table ? __table : __C_ctype_b;
+    memset(_M_widen, 0, sizeof(_M_widen));
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+
+  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)
+  {
+    _M_toupper = __C_ctype_toupper;
+    _M_tolower = __C_ctype_tolower;
+    _M_table = __table ? __table : __C_ctype_b;
+    memset(_M_widen, 0, sizeof(_M_widen));
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return _M_toupper[static_cast<unsigned char>(__c)]; }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return _M_tolower[static_cast<unsigned char>(__c)]; }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/uclibc/ctype_noninline.h b/libstdc++-v3/config/os/uclibc/ctype_noninline.h
deleted file mode 100644
index 389e76eb86f..00000000000
--- a/libstdc++-v3/config/os/uclibc/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2006, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-  
-// Information as gleaned from /usr/include/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return __C_ctype_b; }
-
-  ctype<char>::ctype(__c_locale, 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)
-  {
-    _M_toupper = __C_ctype_toupper;
-    _M_tolower = __C_ctype_tolower;
-    _M_table = __table ? __table : __C_ctype_b;
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-
-  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)
-  {
-    _M_toupper = __C_ctype_toupper;
-    _M_tolower = __C_ctype_tolower;
-    _M_table = __table ? __table : __C_ctype_b;
-    memset(_M_widen, 0, sizeof(_M_widen));
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return _M_toupper[static_cast<unsigned char>(__c)]; }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_toupper[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return _M_tolower[static_cast<unsigned char>(__c)]; }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = _M_tolower[static_cast<unsigned char>(*__low)];
-	++__low;
-      }
-    return __high;
-  }
diff --git a/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc b/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc
new file mode 100644
index 00000000000..7d2904b782d
--- /dev/null
+++ b/libstdc++-v3/config/os/vxworks/ctype_configure_char.cc
@@ -0,0 +1,99 @@
+// Locale support -*- C++ -*-
+
+// Copyright (C) 2011 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
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 3, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+
+// Under Section 7 of GPL version 3, you are granted additional
+// permissions described in the GCC Runtime Library Exception, version
+// 3.1, as published by the Free Software Foundation.
+
+// You should have received a copy of the GNU General Public License and
+// a copy of the GCC Runtime Library Exception along with this program;
+// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
+// <http://www.gnu.org/licenses/>.
+
+/** @file ctype_configure_char.cc */
+
+//
+// ISO C++ 14882: 22.1  Locales
+//
+
+#include <locale>
+#include <cstdlib>
+#include <cstring>
+
+namespace std _GLIBCXX_VISIBILITY(default)
+{
+_GLIBCXX_BEGIN_NAMESPACE_VERSION
+
+// Information as gleaned from target/h/ctype.h
+
+  const ctype_base::mask*
+  ctype<char>::classic_table() throw()
+  { return __ctype; }
+
+  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
+		     size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table()) 
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
+  : facet(__refs), _M_del(__table != 0 && __del), 
+  _M_toupper(NULL), _M_tolower(NULL), 
+  _M_table(__table ? __table : classic_table())
+  { 
+    memset(_M_widen, 0, sizeof(_M_widen));
+    _M_widen_ok = 0;
+    memset(_M_narrow, 0, sizeof(_M_narrow));
+    _M_narrow_ok = 0;
+  }
+
+  char
+  ctype<char>::do_toupper(char __c) const
+  { return __toupper(__c); }
+
+  const char*
+  ctype<char>::do_toupper(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = __toupper(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+  char
+  ctype<char>::do_tolower(char __c) const
+  { return __tolower(__c); }
+
+  const char* 
+  ctype<char>::do_tolower(char* __low, const char* __high) const
+  {
+    while (__low < __high)
+      {
+	*__low = __tolower(*__low);
+	++__low;
+      }
+    return __high;
+  }
+
+_GLIBCXX_END_NAMESPACE_VERSION
+} // namespace
diff --git a/libstdc++-v3/config/os/vxworks/ctype_noninline.h b/libstdc++-v3/config/os/vxworks/ctype_noninline.h
deleted file mode 100644
index 23521b76d0f..00000000000
--- a/libstdc++-v3/config/os/vxworks/ctype_noninline.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Locale support -*- C++ -*-
-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2009, 2010
-// 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
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 3, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-
-// Under Section 7 of GPL version 3, you are granted additional
-// permissions described in the GCC Runtime Library Exception, version
-// 3.1, as published by the Free Software Foundation.
-
-// You should have received a copy of the GNU General Public License and
-// a copy of the GCC Runtime Library Exception along with this program;
-// see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
-// <http://www.gnu.org/licenses/>.
-
-/** @file bits/ctype_noninline.h
- *  This is an internal header file, included by other library headers.
- *  Do not attempt to use it directly. @headername{locale}
- */
-
-//
-// ISO C++ 14882: 22.1  Locales
-//
-
-// Information as gleaned from target/h/ctype.h
-
-  const ctype_base::mask*
-  ctype<char>::classic_table() throw()
-  { return __ctype; }
-
-  ctype<char>::ctype(__c_locale, const mask* __table, bool __del, 
-		     size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table()) 
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  ctype<char>::ctype(const mask* __table, bool __del, size_t __refs) 
-  : facet(__refs), _M_del(__table != 0 && __del), 
-  _M_toupper(NULL), _M_tolower(NULL), 
-  _M_table(__table ? __table : classic_table())
-  { 
-    memset(_M_widen, 0, sizeof(_M_widen));
-    _M_widen_ok = 0;
-    memset(_M_narrow, 0, sizeof(_M_narrow));
-    _M_narrow_ok = 0;
-  }
-
-  char
-  ctype<char>::do_toupper(char __c) const
-  { return __toupper(__c); }
-
-  const char*
-  ctype<char>::do_toupper(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = __toupper(*__low);
-	++__low;
-      }
-    return __high;
-  }
-
-  char
-  ctype<char>::do_tolower(char __c) const
-  { return __tolower(__c); }
-
-  const char* 
-  ctype<char>::do_tolower(char* __low, const char* __high) const
-  {
-    while (__low < __high)
-      {
-	*__low = __tolower(*__low);
-	++__low;
-      }
-    return __high;
-  }
-- 
cgit v1.2.1