summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2005-06-17 20:40:33 +0000
committerMarc Espie <espie@cvs.openbsd.org>2005-06-17 20:40:33 +0000
commitbe7004e483155fec9dc1404ce22b9bf05c193127 (patch)
tree324b7c12f3d62c06a7c4873e563b9c5491af99e4 /gnu
parentbca5a28b4734025b47828589f2a0704cc7e1d9e9 (diff)
next citrus step.
reviewed by millert, otto, kevlo, naddy, kettenis... libc+libstdc++ bump
Diffstat (limited to 'gnu')
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.cc6
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h3
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/io/c_io_libio_codecvt.c10
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/codecvt_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/collate_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/ctype_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/messages_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/monetary_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/numeric_members.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.cc4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/backward/fstream.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/backward/iostream.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/basic_ios.tcc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/basic_string.tcc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/char_traits.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/fpos.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/fstream.tcc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/istream.tcc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.h14
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.tcc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/localefwd.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/ostream.tcc466
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/sstream.tcc4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/bits/streambuf.tcc50
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/c_compatibility/wchar.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/c_std/std_cstdio.h10
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h34
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/c_std/std_cwctype.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/std/std_fstream.h4
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/std/std_iomanip.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/std/std_iosfwd.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/include/std/std_iostream.h2
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/_G_config.h29
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/fileops.c2
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/genops.c8
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/iofopen.c4
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/iofwide.c18
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/libio.h10
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/libioP.h6
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/stdfiles.c4
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c2
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/wfileops.c2
-rw-r--r--gnu/lib/libstdc++/libstdc++/libio/wgenops.c2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/codecvt.cc4
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/complex_io.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/concept-inst.cc6
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/ctype.cc6
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/ext-inst.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc8
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/fstream.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/globals.cc8
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/io-inst.cc6
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/ios.cc8
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/istream-inst.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/limits.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/locale-inst.cc28
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/locale.cc29
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/localename.cc10
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/misc-inst.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc2
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc8
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc4
-rw-r--r--gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc36
-rw-r--r--gnu/lib/libstdc++/shlib_version2
67 files changed, 485 insertions, 442 deletions
diff --git a/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.cc b/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.cc
index 60eb006a847..995dbeeabf2 100644
--- a/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.cc
@@ -42,7 +42,7 @@ namespace std
_lock = __lock;
#endif
// Don't set the orientation of the stream when initializing.
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_IO_no_init(this, 0, 0, &_M_wfile, 0);
#else /* !defined(_GLIBCPP_USE_WCHAR_T) */
_IO_no_init(this, 0, 0, NULL, 0);
@@ -99,7 +99,7 @@ namespace std
{ return _IO_file_doallocate(this); }
// __basic_file<wchar_t> definitions
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
__basic_file<wchar_t>::__basic_file(__c_lock* __lock)
{
#ifdef _IO_MTSAFE_IO
@@ -180,7 +180,7 @@ namespace std
// Need to instantiate base class here for type-info bits, etc
template struct __basic_file_base<char>;
template class __basic_file<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template struct __basic_file_base<wchar_t>;
template class __basic_file<wchar_t>;
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.h b/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.h
index 57d83c49d00..48e18216ba5 100644
--- a/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.h
+++ b/gnu/lib/libstdc++/libstdc++/config/io/basic_file_libio.h
@@ -122,7 +122,7 @@ namespace std
template<typename _CharT>
class __basic_file: public __basic_file_base<_CharT>
{
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
__c_wfile_type _M_wfile;
# endif
@@ -292,7 +292,7 @@ namespace std
__basic_file<char>::doallocate();
// __basic_file<wchar_t> specializations
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
__basic_file<wchar_t>::__basic_file(__c_lock* __lock);
diff --git a/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h b/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h
index acf65207f18..3a3a881eb19 100644
--- a/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h
+++ b/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h
@@ -57,8 +57,7 @@ namespace std
// from basic_file.h
typedef _IO_FILE __c_file_type;
typedef _IO_wide_data __c_wfile_type;
-
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern "C" _IO_codecvt __c_libio_codecvt;
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio_codecvt.c b/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio_codecvt.c
index 38d8b55e0c2..b11a1fa6730 100644
--- a/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio_codecvt.c
+++ b/gnu/lib/libstdc++/libstdc++/config/io/c_io_libio_codecvt.c
@@ -23,11 +23,19 @@
other reasons why the executable file might be covered by the GNU
General Public License. */
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
/* Slightly modified from glibc/libio/iofwide.c */
#include <libio.h>
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result
diff --git a/gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h b/gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h
index a46e243cf9f..c7dad5b3a73 100644
--- a/gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h
+++ b/gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h
@@ -41,7 +41,7 @@ namespace std
// for fpos.h
typedef long streamoff;
typedef ptrdiff_t streamsize; // Signed integral type
-#if defined(_GLIBCPP_USE_WCHAR_T)
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef ptrdiff_t wstreamsize;
#endif
typedef fpos_t __c_streampos;
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/codecvt_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/codecvt_members.cc
index ff65dffa1e9..c7b3b10f171 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/codecvt_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/codecvt_members.cc
@@ -38,7 +38,7 @@
namespace std
{
// Specializations.
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
codecvt_base::result
codecvt<wchar_t, char, mbstate_t>::
do_out(state_type& __state, const intern_type* __from,
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/collate_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/collate_members.cc
index 93767d93e3b..349c7935fef 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/collate_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/collate_members.cc
@@ -53,7 +53,7 @@ namespace std
size_t __n) const
{ return strxfrm(__to, __from, __n); }
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
int
collate<wchar_t>::_M_compare(const wchar_t* __one,
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/ctype_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/ctype_members.cc
index 71e810abef7..7a550ced53a 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/ctype_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/ctype_members.cc
@@ -47,7 +47,7 @@ namespace std
_S_create_c_locale(_M_c_locale_ctype, __s);
}
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
ctype<wchar_t>::__wmask_type
ctype<wchar_t>::_M_convert_to_wmask(const mask __m) const
{
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/messages_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/messages_members.cc
index f38f82beed2..d810dadb6fa 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/messages_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/messages_members.cc
@@ -43,7 +43,7 @@ namespace std
messages<char>::do_get(catalog, int, int, const string& __dfault) const
{ return __dfault; }
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring& __dfault) const
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/monetary_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/monetary_members.cc
index 1921f46e98c..1becc6d8edc 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/monetary_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/monetary_members.cc
@@ -83,7 +83,7 @@ namespace std
moneypunct<char, false>::~moneypunct()
{ }
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
void
moneypunct<wchar_t, true>::_M_initialize_moneypunct(__c_locale,
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/numeric_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/numeric_members.cc
index f942e0415b0..fd324934de4 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/numeric_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/numeric_members.cc
@@ -53,7 +53,7 @@ namespace std
numpunct<char>::~numpunct()
{ }
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
void
numpunct<wchar_t>::_M_initialize_numpunct(__c_locale)
diff --git a/gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.cc b/gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.cc
index df43f03a53d..acdccd209f6 100644
--- a/gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.cc
+++ b/gnu/lib/libstdc++/libstdc++/config/locale/generic/time_members.cc
@@ -113,7 +113,7 @@ namespace std
_M_month_a12 = "Dec";
}
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
void
__timepunct<wchar_t>::
@@ -122,7 +122,9 @@ namespace std
{
char* __old = strdup(setlocale(LC_ALL, NULL));
setlocale(LC_ALL, _M_name_timepunct);
+# if defined(_GLIBCPP_USE_WCHAR_T)
wcsftime(__s, __maxlen, __format, __tm);
+# endif
setlocale(LC_ALL, __old);
free(__old);
}
diff --git a/gnu/lib/libstdc++/libstdc++/include/backward/fstream.h b/gnu/lib/libstdc++/libstdc++/include/backward/fstream.h
index 44461f464dd..72a9eb3345e 100644
--- a/gnu/lib/libstdc++/libstdc++/include/backward/fstream.h
+++ b/gnu/lib/libstdc++/libstdc++/include/backward/fstream.h
@@ -37,7 +37,7 @@ using std::ofstream;
using std::fstream;
using std::streampos;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
using std::wfilebuf;
using std::wifstream;
using std::wofstream;
diff --git a/gnu/lib/libstdc++/libstdc++/include/backward/iostream.h b/gnu/lib/libstdc++/libstdc++/include/backward/iostream.h
index 5346d9d22e8..63b6040553f 100644
--- a/gnu/lib/libstdc++/libstdc++/include/backward/iostream.h
+++ b/gnu/lib/libstdc++/libstdc++/include/backward/iostream.h
@@ -41,7 +41,7 @@ using std::cout;
using std::cin;
using std::cerr;
using std::clog;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
using std::wcout;
using std::wcin;
using std::wcerr;
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/basic_ios.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/basic_ios.tcc
index 48e2f3fbf25..87e2c70d2ec 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/basic_ios.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/basic_ios.tcc
@@ -214,7 +214,7 @@ namespace std
#if defined(_GLIBCPP_EXTERN_TEMPLATE)
extern template class basic_ios<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_ios<wchar_t>;
#endif
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/basic_string.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/basic_string.tcc
index d76b55a370b..9aeeed9046e 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/basic_string.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/basic_string.tcc
@@ -1072,7 +1072,7 @@ namespace std
basic_istream<char>&
getline(basic_istream<char>&, string&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_string<wchar_t>;
extern template
basic_istream<wchar_t>&
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/char_traits.h b/gnu/lib/libstdc++/libstdc++/include/bits/char_traits.h
index 1cb982b4856..c42078344d4 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/char_traits.h
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/char_traits.h
@@ -189,9 +189,7 @@ namespace std
typedef wchar_t char_type;
typedef wint_t int_type;
typedef streamoff off_type;
-#ifdef _GLIBCPP_USE_WCHAR_T
typedef wstreampos pos_type;
-#endif
typedef mbstate_t state_type;
static void
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h b/gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h
index 9ab9f94e71d..6ec5b68684a 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h
@@ -259,7 +259,7 @@
do_max_length() const throw();
};
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
// codecvt<wchar_t, char, mbstate_t> required specialization
template<>
class codecvt<wchar_t, char, mbstate_t>
@@ -330,7 +330,7 @@
// Include host and configuration specific partial specializations
// with additional functionality, if possible.
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
#include <bits/codecvt_specializations.h>
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/fpos.h b/gnu/lib/libstdc++/libstdc++/include/bits/fpos.h
index 5432527421a..c14b998a849 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/fpos.h
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/fpos.h
@@ -118,7 +118,7 @@ namespace std
/// 27.2, paragraph 10 about fpos/char_traits circularity
typedef fpos<mbstate_t> streampos;
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
/// 27.2, paragraph 10 about fpos/char_traits circularity
typedef fpos<mbstate_t> wstreampos;
# endif
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/fstream.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/fstream.tcc
index c8fa1b4239e..06b176d7316 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/fstream.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/fstream.tcc
@@ -518,7 +518,7 @@ namespace std
extern template class basic_ofstream<char>;
extern template class basic_fstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_filebuf<wchar_t>;
extern template class basic_ifstream<wchar_t>;
extern template class basic_ofstream<wchar_t>;
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/istream.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/istream.tcc
index 07af8b2f3b8..56fefb5b969 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/istream.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/istream.tcc
@@ -1149,7 +1149,7 @@ namespace std
extern template istream& operator>>(istream&, unsigned char*);
extern template istream& operator>>(istream&, signed char*);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_istream<wchar_t>;
extern template wistream& ws(wistream&);
extern template wistream& operator>>(wistream&, wchar_t&);
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.h b/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.h
index 37f6875bc25..8347284c35e 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.h
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.h
@@ -51,7 +51,7 @@
namespace std
{
// NB: Don't instantiate required wchar_t facets if no wchar_t support.
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define _GLIBCPP_NUM_FACETS 28
#else
# define _GLIBCPP_NUM_FACETS 14
@@ -424,7 +424,7 @@ namespace std
const ctype<char>&
use_facet<ctype<char> >(const locale& __loc);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
// 22.2.1.3 ctype<wchar_t> specialization
template<>
class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
@@ -670,7 +670,7 @@ namespace std
void
numpunct<char>::_M_initialize_numpunct(__c_locale __cloc);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
numpunct<wchar_t>::~numpunct();
@@ -1053,7 +1053,7 @@ namespace std
size_t
collate<char>::_M_transform(char*, const char*, size_t) const;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
int
collate<wchar_t>::_M_compare(const wchar_t*, const wchar_t*) const;
@@ -1287,7 +1287,7 @@ namespace std
void
__timepunct<char>::_M_put(char*, size_t, const char*, const tm*) const;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
const wchar_t*
__timepunct<wchar_t>::_S_timezones[14];
@@ -1624,7 +1624,7 @@ namespace std
void
moneypunct<char, false>::_M_initialize_moneypunct(__c_locale, const char*);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
moneypunct<wchar_t, true>::~moneypunct();
@@ -1865,7 +1865,7 @@ namespace std
string
messages<char>::do_get(catalog, int, int, const string&) const;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
wstring
messages<wchar_t>::do_get(catalog, int, int, const wstring&) const;
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.tcc
index 8b3bbc3971d..b3013c75cbf 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/locale_facets.tcc
@@ -2630,7 +2630,7 @@ namespace std
bool
has_facet<messages<char> >(const locale&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class moneypunct<wchar_t, false>;
extern template class moneypunct<wchar_t, true>;
extern template class moneypunct_byname<wchar_t, false>;
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/localefwd.h b/gnu/lib/libstdc++/libstdc++/include/bits/localefwd.h
index ac9e1a95425..7c42a0b1263 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/localefwd.h
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/localefwd.h
@@ -110,7 +110,7 @@ namespace std
template<typename _CharT>
class ctype;
template<> class ctype<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<> class ctype<wchar_t>;
#endif
template<typename _CharT>
@@ -122,7 +122,7 @@ namespace std
template<typename _InternT, typename _ExternT, typename _StateT>
class codecvt;
template<> class codecvt<char, char, mbstate_t>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<> class codecvt<wchar_t, char, mbstate_t>;
#endif
template<typename _InternT, typename _ExternT, typename _StateT>
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/ostream.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/ostream.tcc
index ab15ae8703b..f4aeb37e574 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/ostream.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/ostream.tcc
@@ -40,7 +40,7 @@ namespace std
{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
- sentry(basic_ostream<_CharT,_Traits>& __os)
+ sentry(basic_ostream<_CharT, _Traits>& __os)
: _M_os(__os)
{
// XXX MT
@@ -61,21 +61,10 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(__ostream_type& (*__pf)(__ostream_type&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- return *this;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ return __pf(*this);
}
template<typename _CharT, typename _Traits>
@@ -83,20 +72,10 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(__ios_type& (*__pf)(__ios_type&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
return *this;
}
@@ -105,132 +84,91 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(ios_base& (*__pf)(ios_base&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- return *this;
- }
-
- template<typename _CharT, typename _Traits>
- basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(__streambuf_type* __sbin)
- {
- sentry __cerb(*this);
- if (__cerb && __sbin)
- {
- try
- {
- if (!__copy_streambufs(*this, __sbin, this->rdbuf()))
- this->setstate(ios_base::failbit);
- }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- else if (!__sbin)
- this->setstate(ios_base::badbit);
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(bool __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(bool __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
+ bool __b = false;
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (_M_check_facet(_M_fnumput))
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
{
- bool __b = false;
- if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
- {
- unsigned long __l = static_cast<unsigned long>(__n);
- __b = _M_fnumput->put(*this, *this, __c, __l).failed();
- }
- else
- __b = _M_fnumput->put(*this, *this, __c, __n).failed();
- if (__b)
- this->setstate(ios_base::badbit);
+ unsigned long __l = static_cast<unsigned long>(__n);
+ __b = __np.put(*this, *this, __c, __l).failed();
}
+ else
+ __b = __np.put(*this, *this, __c, __n).failed();
+ if (__b)
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(unsigned long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -238,63 +176,59 @@ namespace std
#ifdef _GLIBCPP_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
+ bool __b = false;
char_type __c = this->fill();
ios_base::fmtflags __fmt = this->flags() & ios_base::basefield;
- if (_M_check_facet(_M_fnumput))
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
{
- bool __b = false;
- if ((__fmt & ios_base::oct) || (__fmt & ios_base::hex))
- {
- unsigned long long __l;
- __l = static_cast<unsigned long long>(__n);
- __b = _M_fnumput->put(*this, *this, __c, __l).failed();
- }
- else
- __b = _M_fnumput->put(*this, *this, __c, __n).failed();
- if (__b)
- this->setstate(ios_base::badbit);
+ unsigned long long __l;
+ __l = static_cast<unsigned long long>(__n);
+ __b = __np.put(*this, *this, __c, __l).failed();
}
+ else
+ __b = __np.put(*this, *this, __c, __n).failed();
+ if (__b)
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(unsigned long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -302,76 +236,97 @@ namespace std
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(double __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(double __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long double __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long double __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(const void* __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- if (_M_check_facet(_M_fnumput))
- if (_M_fnumput->put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ _M_check_facet(this->_M_fnumput);
+ const __numput_type& __np = *this->_M_fnumput;
+ if (__np.put(*this, *this, this->fill(), __n).failed())
+ __err |= ios_base::badbit;
}
catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(__streambuf_type* __sbin)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this);
+ if (__cerb && __sbin)
+ {
+ try
{
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
+ if (!__copy_streambufs(*this, __sbin, this->rdbuf()))
+ __err |= ios_base::failbit;
}
+ catch(...)
+ { this->_M_setstate(ios_base::failbit); }
}
+ else if (!__sbin)
+ __err |= ios_base::badbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -379,26 +334,55 @@ namespace std
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::put(char_type __c)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::put(char_type) is an unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
sentry __cerb(*this);
if (__cerb)
{
- int_type __put = rdbuf()->sputc(__c);
- if (traits_type::eq_int_type(__put, traits_type::eof()))
- this->setstate(ios_base::badbit);
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ int_type __put = this->rdbuf()->sputc(__c);
+ if (traits_type::eq_int_type(__put, traits_type::eof()))
+ __err |= ios_base::badbit;
+ }
+ catch (...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
- return *this;
- }
-
+ return *this;
+ }
+
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::write(const _CharT* __s, streamsize __n)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::write(const char_type*, streamsize) is an
+ // unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
sentry __cerb(*this);
if (__cerb)
{
- streamsize __put = this->rdbuf()->sputn(__s, __n);
- if ( __put != __n)
- this->setstate(ios_base::badbit);
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ streamsize __put = this->rdbuf()->sputn(__s, __n);
+ if (__put != __n)
+ __err |= ios_base::badbit;
+ }
+ catch (...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -407,12 +391,19 @@ namespace std
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::flush()
{
- sentry __cerb(*this);
- if (__cerb)
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::flush() is *not* an unformatted output function.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -421,8 +412,13 @@ namespace std
basic_ostream<_CharT, _Traits>::tellp()
{
pos_type __ret = pos_type(-1);
- if (!this->fail())
- __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
return __ret;
}
@@ -431,37 +427,51 @@ namespace std
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
{
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
-#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
- pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::out);
-
-// 129. Need error indication from seekp() and seekg()
- if (__err == pos_type(off_type(-1)))
- this->setstate(ios_base::failbit);
-#endif
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
- seekp(off_type __off, ios_base::seekdir __d)
+ seekp(off_type __off, ios_base::seekdir __dir)
{
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
-#ifdef _GLIBCPP_RESOLVE_LIB_DEFECTS
-// 136. seekp, seekg setting wrong streams?
- pos_type __err = this->rdbuf()->pubseekoff(__off, __d,
- ios_base::out);
-
-// 129. Need error indication from seekp() and seekg()
- if (__err == pos_type(off_type(-1)))
- this->setstate(ios_base::failbit);
-#endif
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -490,13 +500,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
return __out;
}
@@ -526,13 +530,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
return __out;
}
@@ -561,13 +559,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -610,13 +602,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -649,13 +635,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -709,7 +689,7 @@ namespace std
extern template ostream& operator<<(ostream&, const unsigned char*);
extern template ostream& operator<<(ostream&, const signed char*);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_ostream<wchar_t>;
extern template wostream& endl(wostream&);
extern template wostream& ends(wostream&);
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/sstream.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/sstream.tcc
index 606705c02e9..6c5fcb57099 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/sstream.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/sstream.tcc
@@ -225,17 +225,19 @@ namespace std
// Inhibit implicit instantiations for required instantiations,
// which are defined via explicit instantiations elsewhere.
// NB: This syntax is a GNU extension.
+#if _GLIBCXX_EXTERN_TEMPLATE
extern template class basic_stringbuf<char>;
extern template class basic_istringstream<char>;
extern template class basic_ostringstream<char>;
extern template class basic_stringstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_stringbuf<wchar_t>;
extern template class basic_istringstream<wchar_t>;
extern template class basic_ostringstream<wchar_t>;
extern template class basic_stringstream<wchar_t>;
#endif
+#endif
} // namespace std
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/include/bits/streambuf.tcc b/gnu/lib/libstdc++/libstdc++/include/bits/streambuf.tcc
index be858621b85..67477b84ec8 100644
--- a/gnu/lib/libstdc++/libstdc++/include/bits/streambuf.tcc
+++ b/gnu/lib/libstdc++/libstdc++/include/bits/streambuf.tcc
@@ -194,42 +194,32 @@ namespace std
// necessary.
template<typename _CharT, typename _Traits>
streamsize
- __copy_streambufs(basic_ios<_CharT, _Traits>& __ios,
+ __copy_streambufs(basic_ios<_CharT, _Traits>&,
basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout)
{
streamsize __ret = 0;
- try
+ typename _Traits::int_type __c = __sbin->sgetc();
+ while (!_Traits::eq_int_type(__c, _Traits::eof()))
{
- typename _Traits::int_type __c = __sbin->sgetc();
- while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ const size_t __n = __sbin->_M_in_end - __sbin->_M_in_cur;
+ if (__n > 1)
{
- const size_t __n = __sbin->_M_in_end - __sbin->_M_in_cur;
- if (__n > 1)
- {
- const size_t __wrote = __sbout->sputn(__sbin->_M_in_cur,
- __n);
- __sbin->_M_in_cur_move(__wrote);
- __ret += __wrote;
- if (__wrote < __n)
- break;
- __c = __sbin->underflow();
- }
- else
- {
- __c = __sbout->sputc(_Traits::to_char_type(__c));
- if (_Traits::eq_int_type(__c, _Traits::eof()))
- break;
- ++__ret;
- __c = __sbin->snextc();
- }
+ const size_t __wrote = __sbout->sputn(__sbin->_M_in_cur, __n);
+ __sbin->_M_in_cur_move(__wrote);
+ __ret += __wrote;
+ if (__wrote < __n)
+ break;
+ __c = __sbin->underflow();
+ }
+ else
+ {
+ __c = __sbout->sputc(_Traits::to_char_type(__c));
+ if (_Traits::eq_int_type(__c, _Traits::eof()))
+ break;
+ ++__ret;
+ __c = __sbin->snextc();
}
- }
- catch(exception& __fail)
- {
- __ios.setstate(ios_base::failbit);
- if ((__ios.exceptions() & ios_base::failbit) != 0)
- __throw_exception_again;
}
return __ret;
}
@@ -244,7 +234,7 @@ namespace std
__copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
basic_streambuf<char>*);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template class basic_streambuf<wchar_t>;
extern template
streamsize
diff --git a/gnu/lib/libstdc++/libstdc++/include/c_compatibility/wchar.h b/gnu/lib/libstdc++/libstdc++/include/c_compatibility/wchar.h
index a6a8f8f4a5b..8f9bdb7f4ed 100644
--- a/gnu/lib/libstdc++/libstdc++/include/c_compatibility/wchar.h
+++ b/gnu/lib/libstdc++/libstdc++/include/c_compatibility/wchar.h
@@ -34,7 +34,7 @@
using std::mbstate_t;
-#if defined(_GLIBCPP_USE_WCHAR_T)
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
using std::wint_t;
using std::btowc;
@@ -45,6 +45,7 @@ using std::fgetws;
using std::fputwc;
using std::fputws;
using std::fwide;
+#if defined(_GLIBCPP_USE_WCHAR_T)
using std::fwprintf;
using std::fwscanf;
using std::swprintf;
@@ -57,6 +58,7 @@ using std::vwprintf;
using std::vwscanf;
using std::wprintf;
using std::wscanf;
+#endif
using std::getwc;
using std::getwchar;
using std::mbsinit;
diff --git a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cstdio.h b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cstdio.h
index 7b8fc0dad92..93ff0c280c1 100644
--- a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cstdio.h
+++ b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cstdio.h
@@ -145,7 +145,7 @@ namespace std
#if defined(_GLIBCPP_USE_C99) || defined(_GLIBCPP_USE_C99_SNPRINTF)
#undef snprintf
-//#undef vfscanf
+#undef vfscanf
#undef vscanf
#undef vsnprintf
#undef vsscanf
@@ -155,8 +155,8 @@ namespace __gnu_cxx
#if defined(_GLIBCPP_USE_C99_CHECK) || defined(_GLIBCPP_USE_C99_DYNAMIC)
extern "C" int
(snprintf)(char * restrict, size_t, const char * restrict, ...);
-// extern "C" int
-// (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
+ extern "C" int
+ (vfscanf)(FILE * restrict, const char * restrict, __gnuc_va_list);
extern "C" int (vscanf)(const char * restrict, __gnuc_va_list);
extern "C" int
(vsnprintf)(char * restrict, size_t, const char * restrict, __gnuc_va_list);
@@ -165,7 +165,7 @@ namespace __gnu_cxx
#endif
#if !defined(_GLIBCPP_USE_C99_DYNAMIC)
using ::snprintf;
-//using ::vfscanf;
+ using ::vfscanf;
using ::vscanf;
using ::vsnprintf;
using ::vsscanf;
@@ -175,7 +175,7 @@ namespace __gnu_cxx
namespace std
{
using __gnu_cxx::snprintf;
-//using __gnu_cxx::vfscanf;
+ using __gnu_cxx::vfscanf;
using __gnu_cxx::vscanf;
using __gnu_cxx::vsnprintf;
using __gnu_cxx::vsscanf;
diff --git a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h
index a2c75430699..6374087a822 100644
--- a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h
+++ b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwchar.h
@@ -129,7 +129,7 @@ namespace std
#undef wprintf
#undef wscanf
-#if defined(_GLIBCPP_USE_WCHAR_T)
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
namespace std
{
using ::wint_t;
@@ -140,8 +140,25 @@ namespace std
using ::fputwc;
using ::fputws;
using ::fwide;
+#if defined(_GLIBCPP_USE_WCHAR_T)
using ::fwprintf;
using ::fwscanf;
+ using ::swprintf;
+ using ::swscanf;
+ using ::vfwprintf;
+ using ::vfwscanf;
+ using ::vswprintf;
+ using ::vswscanf;
+ using ::vwprintf;
+ using ::vwscanf;
+ using ::wcsftime;
+ using ::wcstod;
+ using ::wcstof;
+ using ::wcstol;
+ using ::wcstoul;
+ using ::wprintf;
+ using ::wscanf;
+#endif
using ::getwc;
using ::getwchar;
using ::mbrlen;
@@ -150,41 +167,26 @@ namespace std
using ::mbsrtowcs;
using ::putwc;
using ::putwchar;
- using ::swprintf;
- using ::swscanf;
using ::ungetwc;
- using ::vfwprintf;
- using ::vfwscanf;
- using ::vswprintf;
- using ::vswscanf;
- using ::vwprintf;
- using ::vwscanf;
using ::wcrtomb;
using ::wcscat;
using ::wcscmp;
using ::wcscoll;
using ::wcscpy;
using ::wcscspn;
- using ::wcsftime;
using ::wcslen;
using ::wcsncat;
using ::wcsncmp;
using ::wcsncpy;
using ::wcsrtombs;
using ::wcsspn;
- using ::wcstod;
- using ::wcstof;
using ::wcstok;
- using ::wcstol;
- using ::wcstoul;
using ::wcsxfrm;
using ::wctob;
using ::wmemcmp;
using ::wmemcpy;
using ::wmemmove;
using ::wmemset;
- using ::wprintf;
- using ::wscanf;
using ::wcschr;
diff --git a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwctype.h b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwctype.h
index c3117d65b75..d330e5ff054 100644
--- a/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwctype.h
+++ b/gnu/lib/libstdc++/libstdc++/include/c_std/std_cwctype.h
@@ -73,7 +73,7 @@
#undef wctrans
#undef wctype
-#if defined(_GLIBCPP_USE_WCHAR_T)
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
namespace std
{
using ::wint_t; // cwchar
@@ -97,8 +97,10 @@ namespace std
using ::iswctype;
using ::towlower;
using ::towupper;
+#if defined(_GLIBCPP_USE_WCHAR_T)
using ::towctrans;
using ::wctrans;
+#endif
using ::wctype;
}
#endif //_GLIBCPP_USE_WCHAR_T
diff --git a/gnu/lib/libstdc++/libstdc++/include/std/std_fstream.h b/gnu/lib/libstdc++/libstdc++/include/std/std_fstream.h
index bcbbb971946..88159a87516 100644
--- a/gnu/lib/libstdc++/libstdc++/include/std/std_fstream.h
+++ b/gnu/lib/libstdc++/libstdc++/include/std/std_fstream.h
@@ -441,11 +441,11 @@ namespace std
basic_filebuf<char>::int_type
basic_filebuf<char>::_M_underflow_common(bool __bump);
- #ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
basic_filebuf<wchar_t>::int_type
basic_filebuf<wchar_t>::_M_underflow_common(bool __bump);
- #endif
+# endif
// Generic definitions.
template <typename _CharT, typename _Traits>
diff --git a/gnu/lib/libstdc++/libstdc++/include/std/std_iomanip.h b/gnu/lib/libstdc++/libstdc++/include/std/std_iomanip.h
index 490d5ac1cfb..94139659eb0 100644
--- a/gnu/lib/libstdc++/libstdc++/include/std/std_iomanip.h
+++ b/gnu/lib/libstdc++/libstdc++/include/std/std_iomanip.h
@@ -280,7 +280,7 @@ namespace std
extern template istream& operator>>(istream&, _Setprecision);
extern template istream& operator>>(istream&, _Setw);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern template wostream& operator<<(wostream&, _Setfill<wchar_t>);
extern template wostream& operator<<(wostream&, _Setiosflags);
extern template wostream& operator<<(wostream&, _Resetiosflags);
diff --git a/gnu/lib/libstdc++/libstdc++/include/std/std_iosfwd.h b/gnu/lib/libstdc++/libstdc++/include/std/std_iosfwd.h
index 55b0e0b19fa..325229cea1c 100644
--- a/gnu/lib/libstdc++/libstdc++/include/std/std_iosfwd.h
+++ b/gnu/lib/libstdc++/libstdc++/include/std/std_iosfwd.h
@@ -147,7 +147,7 @@ namespace std
typedef basic_ofstream<char> ofstream; ///< @isiosfwd
typedef basic_fstream<char> fstream; ///< @isiosfwd
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef basic_ios<wchar_t> wios; ///< @isiosfwd
typedef basic_streambuf<wchar_t> wstreambuf; ///< @isiosfwd
typedef basic_istream<wchar_t> wistream; ///< @isiosfwd
diff --git a/gnu/lib/libstdc++/libstdc++/include/std/std_iostream.h b/gnu/lib/libstdc++/libstdc++/include/std/std_iostream.h
index d70949377df..45851c5cf3b 100644
--- a/gnu/lib/libstdc++/libstdc++/include/std/std_iostream.h
+++ b/gnu/lib/libstdc++/libstdc++/include/std/std_iostream.h
@@ -65,7 +65,7 @@ namespace std
extern ostream cerr; ///< Linked to standard error (unbuffered)
extern ostream clog; ///< Linked to standard error (buffered)
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern wistream wcin; ///< Linked to standard input
extern wostream wcout; ///< Linked to standard output
extern wostream wcerr; ///< Linked to standard error (unbuffered)
diff --git a/gnu/lib/libstdc++/libstdc++/libio/_G_config.h b/gnu/lib/libstdc++/libstdc++/libio/_G_config.h
index d6738c2bf7b..d52795189b2 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/_G_config.h
+++ b/gnu/lib/libstdc++/libstdc++/libio/_G_config.h
@@ -1,3 +1,28 @@
+/* Copyright (C) 1999, 2000, 2004 Free Software Foundation, Inc.
+ This file is part of the GNU IO 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 2, 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.
+
+ You should have received a copy of the GNU General Public License
+ along with this library; see the file COPYING. If not, write to
+ the Free Software Foundation, 59 Temple Place - Suite 330, Boston,
+ MA 02111-1307, USA.
+
+ As a special exception, if you link this library with files
+ compiled with a GNU compiler to produce an executable, this does
+ not cause the resulting executable to be covered by the GNU General
+ Public License. This exception does not however invalidate any
+ other reasons why the executable file might be covered by the GNU
+ General Public License. */
+
/* This file is needed by libio to define various configuration parameters.
These are always the same in the GNU C library. */
@@ -52,7 +77,7 @@ typedef struct
typedef size_t _G_size_t;
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef struct
{
__off_t __pos;
@@ -76,7 +101,7 @@ typedef __off64_t _G_fpos64_t;
#define _G_wchar_t wchar_t
#define _G_wint_t wint_t
#define _G_stat64 stat64
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# include <iconv.h>
typedef iconv_t _G_iconv_t;
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/libio/fileops.c b/gnu/lib/libstdc++/libstdc++/libio/fileops.c
index a830b5cd439..cdebc9f3bba 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/fileops.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/fileops.c
@@ -160,7 +160,7 @@ _IO_new_file_close_it (fp)
_IO_setg (fp, NULL, NULL, NULL);
_IO_setp (fp, NULL, NULL);
}
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
else
{
_IO_wsetb (fp, NULL, NULL, 0);
diff --git a/gnu/lib/libstdc++/libstdc++/libio/genops.c b/gnu/lib/libstdc++/libstdc++/libio/genops.c
index b1ae5afc506..11b2bab6d35 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/genops.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/genops.c
@@ -285,7 +285,7 @@ int
__underflow (fp)
_IO_FILE *fp;
{
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
#endif
@@ -317,7 +317,7 @@ int
__uflow (fp)
_IO_FILE *fp;
{
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
#endif
@@ -584,7 +584,7 @@ _IO_no_init (fp, flags, orientation, wd, jmp)
_IO_lock_init (*fp->_lock);
#endif
fp->_mode = orientation;
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
if (orientation >= 0)
{
fp->_wide_data = wd;
@@ -755,7 +755,7 @@ _IO_flush_all ()
struct _IO_FILE *fp;
for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base)
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
|| (fp->_vtable_offset == 0
&& fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
> fp->_wide_data->_IO_write_base))
diff --git a/gnu/lib/libstdc++/libstdc++/libio/iofopen.c b/gnu/lib/libstdc++/libstdc++/libio/iofopen.c
index 2dcdee0235c..09deeb40c70 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/iofopen.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/iofopen.c
@@ -44,7 +44,7 @@ _IO_new_fopen (filename, mode)
#ifdef _IO_MTSAFE_IO
_IO_lock_t lock;
#endif
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
struct _IO_wide_data wd;
#endif /* !(defined _LIBC || defined _GLIBCPP_USE_WCHAR_T) */
} *new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
@@ -54,7 +54,7 @@ _IO_new_fopen (filename, mode)
#ifdef _IO_MTSAFE_IO
new_f->fp.file._lock = &new_f->lock;
#endif
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_IO_no_init (&new_f->fp.file, 0, 0, &new_f->wd, &_IO_wfile_jumps);
#else
_IO_no_init (&new_f->fp.file, 1, 0, NULL, NULL);
diff --git a/gnu/lib/libstdc++/libstdc++/libio/iofwide.c b/gnu/lib/libstdc++/libstdc++/libio/iofwide.c
index 76a20ce3fb4..0e81e154fd3 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/iofwide.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/iofwide.c
@@ -34,11 +34,11 @@
#include <stdlib.h>
#include <string.h>
-#if defined(_LIBC) || defined(_GLIBCPP_USE_WCHAR_T)
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# include <langinfo.h>
#endif
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__c_mbstate_t *statep,
@@ -104,7 +104,7 @@ _IO_fwide (fp, mode)
/* Set the orientation appropriately. */
if (mode > 0)
{
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
struct _IO_codecvt *cc = fp->_codecvt;
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
@@ -148,7 +148,7 @@ _IO_fwide (fp, mode)
cc->__cd_out.__cd.__data[0].__trans = &libio_translit;
}
#else
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
{
/* Determine internal and external character sets.
XXX For now we make our life easy: we assume a fixed internal
@@ -190,7 +190,7 @@ _IO_fwide (fp, mode)
weak_alias (_IO_fwide, fwide)
#endif
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
static enum __codecvt_result
do_out (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
@@ -235,7 +235,7 @@ do_out (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
break;
}
#else
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
size_t res;
const char *from_start_copy = (const char *) from_start;
size_t from_len = from_end - from_start;
@@ -299,7 +299,7 @@ do_unshift (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
break;
}
#else
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
size_t res;
char *to_start_copy = (char *) to_start;
size_t to_len = to_end - to_start;
@@ -363,7 +363,7 @@ do_in (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
break;
}
#else
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
size_t res;
const char *from_start_copy = (const char *) from_start;
size_t from_len = from_end - from_start;
@@ -442,7 +442,7 @@ do_length (struct _IO_codecvt *codecvt, __c_mbstate_t *statep,
result = cp - (const unsigned char *) from_start;
#else
-# ifdef _GLIBCPP_USE_WCHAR_T
+# if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
const char *from_start_copy = (const char *) from_start;
size_t from_len = from_end - from_start;
wchar_t to_buf[max];
diff --git a/gnu/lib/libstdc++/libstdc++/libio/libio.h b/gnu/lib/libstdc++/libstdc++/libio/libio.h
index e2a2a15bcb0..c951ef407fe 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/libio.h
+++ b/gnu/lib/libstdc++/libstdc++/libio/libio.h
@@ -205,7 +205,7 @@ enum __codecvt_result
__codecvt_noconv
};
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
/* The order of the elements in the following struct must match the order
of the virtual functions in the libstdc++ codecvt class. */
struct _IO_codecvt
@@ -252,7 +252,7 @@ struct _IO_wide_data
backup area */
wchar_t *_IO_save_end; /* Pointer to end of non-current get area. */
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
__c_mbstate_t _IO_state;
__c_mbstate_t _IO_last_state;
#endif
@@ -260,7 +260,7 @@ struct _IO_wide_data
wchar_t _shortbuf[1];
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
struct _IO_jump_t *_wide_vtable;
#endif
};
@@ -317,7 +317,7 @@ struct _IO_FILE_complete
#endif
#if defined _G_IO_IO_FILE_VERSION && _G_IO_IO_FILE_VERSION == 0x20001
_IO_off64_t _offset;
-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
/* Wide character stream stuff. */
struct _IO_codecvt *_codecvt;
struct _IO_wide_data *_wide_data;
@@ -475,7 +475,7 @@ extern _IO_off64_t _IO_seekpos (_IO_FILE *, _IO_off64_t, int) __THROW;
extern void _IO_free_backup_area (_IO_FILE *) __THROW;
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern _IO_wint_t _IO_getwc (_IO_FILE *__fp) __THROW;
extern _IO_wint_t _IO_putwc (wchar_t __wc, _IO_FILE *__fp) __THROW;
extern int _IO_fwide (_IO_FILE *__fp, int __mode) __THROW;
diff --git a/gnu/lib/libstdc++/libstdc++/libio/libioP.h b/gnu/lib/libstdc++/libstdc++/libio/libioP.h
index 4aecf4eaa1b..11772e929a8 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/libioP.h
+++ b/gnu/lib/libstdc++/libstdc++/libio/libioP.h
@@ -434,7 +434,7 @@ extern int _IO_new_fsetpos64 __P ((_IO_FILE *, const _IO_fpos64_t *));
extern int _IO_old_fsetpos64 __P ((_IO_FILE *, const _IO_fpos64_t *));
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define _IO_do_flush(_f) \
((_f)->_mode <= 0 \
? _IO_do_write(_f, (_f)->_IO_write_base, \
@@ -726,7 +726,7 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list));
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
# else
-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
@@ -747,7 +747,7 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list));
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD }
# else
-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
diff --git a/gnu/lib/libstdc++/libstdc++/libio/stdfiles.c b/gnu/lib/libstdc++/libstdc++/libio/stdfiles.c
index b81fef8b883..35e5b0baa75 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/stdfiles.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/stdfiles.c
@@ -33,7 +33,7 @@
#include "libioP.h"
#ifdef _IO_MTSAFE_IO
-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static _IO_lock_t _IO_stdfile_##FD##_lock = _IO_lock_initializer; \
static struct _IO_wide_data _IO_wide_data_##FD \
@@ -49,7 +49,7 @@
&_IO_file_jumps};
# endif
#else
-# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
+# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
# define DEF_STDFILE(NAME, FD, CHAIN, FLAGS) \
static struct _IO_wide_data _IO_wide_data_##FD \
= { ._wide_vtable = &_IO_wfile_jumps }; \
diff --git a/gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c b/gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c
index dddbd44fd3b..156b38b0de8 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c
@@ -46,7 +46,7 @@
# define _POSIX_SOURCE
#endif
#include "libioP.h"
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
#include <sys/types.h>
#include <sys/stat.h>
#ifdef __STDC__
diff --git a/gnu/lib/libstdc++/libstdc++/libio/wfileops.c b/gnu/lib/libstdc++/libstdc++/libio/wfileops.c
index 1dd524a3ffb..b36fc01e27d 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/wfileops.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/wfileops.c
@@ -27,7 +27,7 @@
#include <assert.h>
#include <libioP.h>
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
#include <wchar.h>
#ifdef HAVE_GCONV_H
# include <gconv.h>
diff --git a/gnu/lib/libstdc++/libstdc++/libio/wgenops.c b/gnu/lib/libstdc++/libstdc++/libio/wgenops.c
index 74854524295..991a5d2e724 100644
--- a/gnu/lib/libstdc++/libstdc++/libio/wgenops.c
+++ b/gnu/lib/libstdc++/libstdc++/libio/wgenops.c
@@ -28,7 +28,7 @@
/* Generic or default I/O operations. */
#include "libioP.h"
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
#ifdef __STDC__
#include <stdlib.h>
#endif
diff --git a/gnu/lib/libstdc++/libstdc++/src/codecvt.cc b/gnu/lib/libstdc++/libstdc++/src/codecvt.cc
index bc5508a4f40..c35bd4d5c11 100644
--- a/gnu/lib/libstdc++/libstdc++/src/codecvt.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/codecvt.cc
@@ -34,7 +34,7 @@ namespace std
// Definitions for locale::id of standard facets that are specialized.
locale::id codecvt<char, char, mbstate_t>::id;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
locale::id codecvt<wchar_t, char, mbstate_t>::id;
#endif
@@ -112,7 +112,7 @@ namespace std
do_max_length() const throw()
{ return 1; }
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
// codecvt<wchar_t, char, mbstate_t> required specialization
codecvt<wchar_t, char, mbstate_t>::
codecvt(size_t __refs)
diff --git a/gnu/lib/libstdc++/libstdc++/src/complex_io.cc b/gnu/lib/libstdc++/libstdc++/src/complex_io.cc
index a6d502f2dad..7b0abad3cd6 100644
--- a/gnu/lib/libstdc++/libstdc++/src/complex_io.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/complex_io.cc
@@ -59,7 +59,7 @@ namespace std
operator<<(basic_ostream<char, char_traits<char> >&,
const complex<long double>&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
basic_istream<wchar_t, char_traits<wchar_t> >&
operator>>(basic_istream<wchar_t, char_traits<wchar_t> >&,
diff --git a/gnu/lib/libstdc++/libstdc++/src/concept-inst.cc b/gnu/lib/libstdc++/libstdc++/src/concept-inst.cc
index e173549105d..ff5194cb21c 100644
--- a/gnu/lib/libstdc++/libstdc++/src/concept-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/concept-inst.cc
@@ -54,7 +54,7 @@ namespace __gnu_cxx
_Instantiate(_InputIteratorConcept<char const*> );
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_Instantiate(_InputIteratorConcept<wchar_t*> );
_Instantiate(_InputIteratorConcept<wchar_t const*> );
@@ -75,7 +75,7 @@ namespace __gnu_cxx
_Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator<
char, std::char_traits<char> >, char> );
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_Instantiate(_OutputIteratorConcept<std::ostreambuf_iterator<
wchar_t, std::char_traits<wchar_t> >, wchar_t> );
#endif
@@ -90,7 +90,7 @@ namespace __gnu_cxx
_Instantiate(_RandomAccessIteratorConcept<
__normal_iterator<char*, std::string> > );
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_Instantiate(_RandomAccessIteratorConcept<
__normal_iterator<wchar_t const*,
std::basic_string<wchar_t, std::char_traits<wchar_t>,
diff --git a/gnu/lib/libstdc++/libstdc++/src/ctype.cc b/gnu/lib/libstdc++/libstdc++/src/ctype.cc
index 3d5ee618c53..718bfc807fd 100644
--- a/gnu/lib/libstdc++/libstdc++/src/ctype.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/ctype.cc
@@ -38,7 +38,7 @@ namespace std
// Definitions for locale::id of standard facets that are specialized.
locale::id ctype<char>::id;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
locale::id ctype<wchar_t>::id;
#endif
@@ -51,7 +51,7 @@ namespace std
return static_cast<const ctype<char>&>(*(__tmp->_M_facets[__i]));
}
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
const ctype<wchar_t>&
use_facet<ctype<wchar_t> >(const locale& __loc)
@@ -124,7 +124,7 @@ namespace std
return __hi;
}
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
ctype<wchar_t>::ctype(size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
{ _M_c_locale_ctype = _S_c_locale; }
diff --git a/gnu/lib/libstdc++/libstdc++/src/ext-inst.cc b/gnu/lib/libstdc++/libstdc++/src/ext-inst.cc
index 4896b110d42..b951f1751a7 100644
--- a/gnu/lib/libstdc++/libstdc++/src/ext-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/ext-inst.cc
@@ -47,7 +47,7 @@ namespace __gnu_cxx
template class stdio_filebuf<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
const unsigned long
rope<wchar_t, std::allocator<wchar_t> >::_S_min_len;
diff --git a/gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc b/gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc
index 8b866c0c927..94e00ffef54 100644
--- a/gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc
@@ -38,25 +38,25 @@ namespace std
{
// filebuf
template class basic_filebuf<char, char_traits<char> >;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_filebuf<wchar_t, char_traits<wchar_t> >;
#endif
// ifstream
template class basic_ifstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_ifstream<wchar_t>;
#endif
// ofstream
template class basic_ofstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_ofstream<wchar_t>;
#endif
// fstream
template class basic_fstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_fstream<wchar_t>;
#endif
} // namespace std
diff --git a/gnu/lib/libstdc++/libstdc++/src/fstream.cc b/gnu/lib/libstdc++/libstdc++/src/fstream.cc
index 2a099d69227..b5f38f5a48c 100644
--- a/gnu/lib/libstdc++/libstdc++/src/fstream.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/fstream.cc
@@ -104,7 +104,7 @@ namespace std
return __ret;
}
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
basic_filebuf<wchar_t>::int_type
basic_filebuf<wchar_t>::_M_underflow_common(bool __bump)
diff --git a/gnu/lib/libstdc++/libstdc++/src/globals.cc b/gnu/lib/libstdc++/libstdc++/src/globals.cc
index efbfdbe854b..5a9b31d9187 100644
--- a/gnu/lib/libstdc++/libstdc++/src/globals.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/globals.cc
@@ -158,7 +158,7 @@ namespace __gnu_cxx
fake_messages_c messages_c;
_GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx10messages_cE, _ZSt10messages_c, GLIBCPP_3.2)
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef char fake_wtype_w[sizeof(std::ctype<wchar_t>)]
__attribute__ ((aligned(__alignof__(std::ctype<wchar_t>))));
fake_wtype_w ctype_w;
@@ -234,7 +234,7 @@ namespace __gnu_cxx
__attribute__ ((aligned(__alignof__(std::__locale_cache<numpunct<char> >))));
fake_locale_cache_np_c locale_cache_np_c;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef char fake_locale_cache_np_w[sizeof(std::__locale_cache<numpunct<wchar_t> >)]
__attribute__ ((aligned(__alignof__(std::__locale_cache<numpunct<wchar_t> >))));
fake_locale_cache_np_w locale_cache_np_w;
@@ -249,7 +249,7 @@ namespace __gnu_cxx
_GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx7buf_cinE, _ZSt7buf_cin, GLIBCPP_3.2)
_GLIBCPP_ASM_SYMVER(_ZN9__gnu_cxx8buf_cerrE, _ZSt8buf_cerr, GLIBCPP_3.2)
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef char fake_wfilebuf[sizeof(stdio_filebuf<wchar_t>)]
__attribute__ ((aligned(__alignof__(stdio_filebuf<wchar_t>))));
fake_wfilebuf buf_wcout;
@@ -304,7 +304,7 @@ namespace std
fake_ostream cerr;
fake_ostream clog;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
typedef char fake_wistream[sizeof(wistream)]
__attribute__ ((aligned(__alignof__(wistream))));
typedef char fake_wostream[sizeof(wostream)]
diff --git a/gnu/lib/libstdc++/libstdc++/src/io-inst.cc b/gnu/lib/libstdc++/libstdc++/src/io-inst.cc
index 31f53b4e395..32200dbbf99 100644
--- a/gnu/lib/libstdc++/libstdc++/src/io-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/io-inst.cc
@@ -40,21 +40,21 @@ namespace std
{
// basic_ios
template class basic_ios<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_ios<wchar_t>;
#endif
// iomanip
template class _Setfill<char>;
template _Setfill<char> setfill(char);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class _Setfill<wchar_t>;
template _Setfill<wchar_t> setfill(wchar_t);
#endif
// iostream
template class basic_iostream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_iostream<wchar_t>;
#endif
} // namespace std
diff --git a/gnu/lib/libstdc++/libstdc++/src/ios.cc b/gnu/lib/libstdc++/libstdc++/src/ios.cc
index 00dbe1219c6..ec81bbd823f 100644
--- a/gnu/lib/libstdc++/libstdc++/src/ios.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/ios.cc
@@ -49,7 +49,7 @@ namespace __gnu_cxx
extern stdio_filebuf<char> buf_cin;
extern stdio_filebuf<char> buf_cerr;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern stdio_filebuf<wchar_t> buf_wcout;
extern stdio_filebuf<wchar_t> buf_wcin;
extern stdio_filebuf<wchar_t> buf_wcerr;
@@ -65,7 +65,7 @@ namespace std
extern ostream cerr;
extern ostream clog;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern wistream wcin;
extern wostream wcout;
extern wostream wcerr;
@@ -185,7 +185,7 @@ namespace std
cin.tie(&cout);
cerr.flags(ios_base::unitbuf);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
new (&buf_wcout) stdio_filebuf<wchar_t>(stdout, ios_base::out, __out_size);
new (&buf_wcin) stdio_filebuf<wchar_t>(stdin, ios_base::in, __in_size);
new (&buf_wcerr) stdio_filebuf<wchar_t>(stderr, ios_base::out, __out_size);
@@ -212,7 +212,7 @@ namespace std
buf_cin.~stdio_filebuf();
buf_cerr.~stdio_filebuf();
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
buf_wcout.~stdio_filebuf();
buf_wcin.~stdio_filebuf();
buf_wcerr.~stdio_filebuf();
diff --git a/gnu/lib/libstdc++/libstdc++/src/istream-inst.cc b/gnu/lib/libstdc++/libstdc++/src/istream-inst.cc
index f2c72fde198..8b78274c600 100644
--- a/gnu/lib/libstdc++/libstdc++/src/istream-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/istream-inst.cc
@@ -54,7 +54,7 @@ namespace std
template istream& operator>>(istream&, _Setprecision);
template istream& operator>>(istream&, _Setw);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_istream<wchar_t>;
template wistream& ws(wistream&);
template wistream& operator>>(wistream&, wchar_t&);
diff --git a/gnu/lib/libstdc++/libstdc++/src/limits.cc b/gnu/lib/libstdc++/libstdc++/src/limits.cc
index 294673ea186..2c0637bd938 100644
--- a/gnu/lib/libstdc++/libstdc++/src/limits.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/limits.cc
@@ -159,7 +159,7 @@ namespace std
// wchar_t
// This used to be problematic...
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
const bool numeric_limits<wchar_t>::is_specialized;
const int numeric_limits<wchar_t>::digits;
const int numeric_limits<wchar_t>::digits10;
diff --git a/gnu/lib/libstdc++/libstdc++/src/locale-inst.cc b/gnu/lib/libstdc++/libstdc++/src/locale-inst.cc
index 8da410f7ff8..fda2faa2989 100644
--- a/gnu/lib/libstdc++/libstdc++/src/locale-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/locale-inst.cc
@@ -47,7 +47,7 @@ namespace std
template class money_put<char, ostreambuf_iterator<char> >;
template class __locale_cache<numpunct<char> >;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class moneypunct<wchar_t, false>;
template class moneypunct<wchar_t, true>;
template class moneypunct_byname<wchar_t, false>;
@@ -100,7 +100,7 @@ namespace std
_M_convert_float(ostreambuf_iterator<char>, ios_base&, char, char,
long double) const;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class numpunct<wchar_t>;
template class numpunct_byname<wchar_t>;
template class num_get<wchar_t, istreambuf_iterator<wchar_t> >;
@@ -173,7 +173,7 @@ namespace std
unsigned long long) const;
#endif
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
ostreambuf_iterator<wchar_t>
num_put<wchar_t, ostreambuf_iterator<wchar_t> >::
@@ -210,7 +210,7 @@ namespace std
template class time_get<char, istreambuf_iterator<char> >;
template class time_get_byname<char, istreambuf_iterator<char> >;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class __timepunct<wchar_t>;
template class time_put<wchar_t, ostreambuf_iterator<wchar_t> >;
template class time_put_byname<wchar_t, ostreambuf_iterator<wchar_t> >;
@@ -221,7 +221,7 @@ namespace std
// messages
template class messages<char>;
template class messages_byname<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class messages<wchar_t>;
template class messages_byname<wchar_t>;
#endif
@@ -229,7 +229,7 @@ namespace std
// ctype
inline template class __ctype_abstract_base<char>;
template class ctype_byname<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
inline template class __ctype_abstract_base<wchar_t>;
template class ctype_byname<wchar_t>;
#endif
@@ -237,7 +237,7 @@ namespace std
// codecvt
inline template class __codecvt_abstract_base<char, char, mbstate_t>;
template class codecvt_byname<char, char, mbstate_t>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
inline template class __codecvt_abstract_base<wchar_t, char, mbstate_t>;
template class codecvt_byname<wchar_t, char, mbstate_t>;
#endif
@@ -245,7 +245,7 @@ namespace std
// collate
template class collate<char>;
template class collate_byname<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class collate<wchar_t>;
template class collate_byname<wchar_t>;
#endif
@@ -304,7 +304,7 @@ namespace std
const messages<char>&
use_facet<messages<char> >(const locale&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
const codecvt<wchar_t, char, mbstate_t>&
use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
@@ -411,7 +411,7 @@ namespace std
bool
has_facet<messages<char> >(const locale&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
bool
has_facet<ctype<wchar_t> >(const locale&);
@@ -470,7 +470,7 @@ namespace std
const __locale_cache<numpunct<char> >&
__use_cache<numpunct<char> >(const locale& __loc);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
const __locale_cache<numpunct<wchar_t> >&
__use_cache<numpunct<wchar_t> >(const locale& __loc);
@@ -488,7 +488,7 @@ namespace std
template class __pad<char, char_traits<char> >;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
wchar_t*
__add_grouping<wchar_t>(wchar_t*, wchar_t, char const*, char const*,
@@ -538,7 +538,7 @@ namespace std
__int_to_char(char*, const int, unsigned long, const char*,
ios_base::fmtflags, bool);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
int
__int_to_char(wchar_t*, const int, unsigned long, const wchar_t*,
@@ -551,7 +551,7 @@ namespace std
__int_to_char(char*, const int, unsigned long long, const char*,
ios_base::fmtflags, bool);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
int
__int_to_char(wchar_t*, const int, unsigned long long, const wchar_t*,
diff --git a/gnu/lib/libstdc++/libstdc++/src/locale.cc b/gnu/lib/libstdc++/libstdc++/src/locale.cc
index 17ccdc2e4c6..f1a56789fcc 100644
--- a/gnu/lib/libstdc++/libstdc++/src/locale.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/locale.cc
@@ -72,7 +72,7 @@ namespace std
{
&std::ctype<char>::id,
&codecvt<char, char, mbstate_t>::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&std::ctype<wchar_t>::id,
&codecvt<wchar_t, char, mbstate_t>::id,
#endif
@@ -85,7 +85,7 @@ namespace std
&num_get<char>::id,
&num_put<char>::id,
&numpunct<char>::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&num_get<wchar_t>::id,
&num_put<wchar_t>::id,
&numpunct<wchar_t>::id,
@@ -97,7 +97,7 @@ namespace std
locale::_Impl::_S_id_collate[] =
{
&std::collate<char>::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&std::collate<wchar_t>::id,
#endif
0
@@ -109,7 +109,7 @@ namespace std
&__timepunct<char>::id,
&time_get<char>::id,
&time_put<char>::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&__timepunct<wchar_t>::id,
&time_get<wchar_t>::id,
&time_put<wchar_t>::id,
@@ -124,7 +124,7 @@ namespace std
&money_put<char>::id,
&moneypunct<char, false>::id,
&moneypunct<char, true >::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&money_get<wchar_t>::id,
&money_put<wchar_t>::id,
&moneypunct<wchar_t, false>::id,
@@ -137,7 +137,7 @@ namespace std
locale::_Impl::_S_id_messages[] =
{
&std::messages<char>::id,
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
&std::messages<wchar_t>::id,
#endif
0
@@ -194,19 +194,19 @@ namespace std
}
else
{
- char* __res;
+ string __res;
// LANG may set a default different from "C".
char* __env = getenv("LANG");
if (!__env || strcmp(__env, "") == 0 || strcmp(__env, "C") == 0
|| strcmp(__env, "POSIX") == 0)
- __res = strdup("C");
+ __res = "C";
else
- __res = strdup(__env);
+ __res = __env;
// Scan the categories looking for the first one
// different from LANG.
size_t __i = 0;
- if (strcmp(__res, "C") == 0)
+ if (__res == "C")
for (; __i < _S_categories_size
+ _S_extra_categories_size; ++__i)
{
@@ -222,7 +222,7 @@ namespace std
{
__env = getenv(_S_categories[__i]);
if (__env && strcmp(__env, "") != 0
- && strcmp(__env, __res) != 0)
+ && __res != __env)
break;
}
@@ -273,11 +273,10 @@ namespace std
}
// ... otherwise either an additional instance of
// the "C" locale or LANG.
- else if (strcmp(__res, "C") == 0)
+ else if (__res == "C")
(_M_impl = _S_classic)->_M_add_reference();
else
- _M_impl = new _Impl(__res, 1);
- free(__res);
+ _M_impl = new _Impl(__res.c_str(), 1);
}
}
}
@@ -487,7 +486,7 @@ namespace std
"IST", "EET", "CST", "JST"
};
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template<>
const wchar_t*
__timepunct<wchar_t>::_S_timezones[14] =
diff --git a/gnu/lib/libstdc++/libstdc++/src/localename.cc b/gnu/lib/libstdc++/libstdc++/src/localename.cc
index b837870fac3..45b0c0ed24b 100644
--- a/gnu/lib/libstdc++/libstdc++/src/localename.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/localename.cc
@@ -53,7 +53,7 @@ namespace __gnu_cxx
extern time_get<char> time_get_c;
extern time_put<char> time_put_c;
extern std::messages<char> messages_c;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern std::ctype<wchar_t> ctype_w;
extern std::collate<wchar_t> collate_w;
extern numpunct<wchar_t> numpunct_w;
@@ -71,7 +71,7 @@ namespace __gnu_cxx
#endif
extern std::__locale_cache<numpunct<char> > locale_cache_np_c;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
extern std::__locale_cache<numpunct<wchar_t> > locale_cache_np_w;
#endif
} // namespace __gnu_cxx
@@ -203,7 +203,7 @@ namespace std
_M_init_facet(new time_put<char>);
_M_init_facet(new std::messages<char>(__cloc, __s));
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_M_init_facet(new std::ctype<wchar_t>(__cloc));
_M_init_facet(new codecvt<wchar_t, char, mbstate_t>);
_M_init_facet(new numpunct<wchar_t>(__cloc));
@@ -274,7 +274,7 @@ namespace std
_M_init_facet(new (&time_get_c) time_get<char>(1));
_M_init_facet(new (&time_put_c) time_put<char>(1));
_M_init_facet(new (&messages_c) std::messages<char>(1));
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
_M_init_facet(new (&ctype_w) std::ctype<wchar_t>(1));
_M_init_facet(new (&codecvt_w) codecvt<wchar_t, char, mbstate_t>(1));
_M_init_facet(new (&numpunct_w) numpunct<wchar_t>(1));
@@ -303,7 +303,7 @@ namespace std
_M_facets[numpunct<char>::id._M_id() + _M_facets_size] =
reinterpret_cast<locale::facet*>(__lc);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
__locale_cache<numpunct<wchar_t> >* __wlc =
new (&locale_cache_np_w) __locale_cache<numpunct<wchar_t> >(ltmp, true);
_M_facets[numpunct<wchar_t>::id._M_id() + _M_facets_size] =
diff --git a/gnu/lib/libstdc++/libstdc++/src/misc-inst.cc b/gnu/lib/libstdc++/libstdc++/src/misc-inst.cc
index 61cb1b36449..3d7ad507888 100644
--- a/gnu/lib/libstdc++/libstdc++/src/misc-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/misc-inst.cc
@@ -54,7 +54,7 @@ namespace std
template
basic_istream<char>&
getline(basic_istream<char>&, string&);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
basic_istream<wchar_t>&
operator>>(basic_istream<wchar_t>&, wstring&);
diff --git a/gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc b/gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc
index b834640646b..77f2b50ced3 100644
--- a/gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc
@@ -56,7 +56,7 @@ namespace std
template ostream& operator<<(ostream&, _Setprecision);
template ostream& operator<<(ostream&, _Setw);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_ostream<wchar_t>;
template wostream& endl(wostream&);
template wostream& ends(wostream&);
diff --git a/gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc b/gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc
index 6c0272ba289..b13eded8abe 100644
--- a/gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc
@@ -38,25 +38,25 @@ namespace std
{
// stringbuf
template class basic_stringbuf<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_stringbuf<wchar_t>;
#endif
// istringstream
template class basic_istringstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_istringstream<wchar_t>;
#endif
// ostringstream
template class basic_ostringstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_ostringstream<wchar_t>;
#endif
// stringstream
template class basic_stringstream<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_stringstream<wchar_t>;
#endif
} // namespace std
diff --git a/gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc b/gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc
index 438752e7e5b..b55cde9d212 100644
--- a/gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc
@@ -39,7 +39,7 @@ namespace std
{
// streambuf
template class basic_streambuf<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template class basic_streambuf<wchar_t>;
#endif
@@ -47,7 +47,7 @@ namespace std
streamsize
__copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
basic_streambuf<char>*);
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
template
streamsize
__copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
diff --git a/gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc b/gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc
index 0200fd42d67..08e935d8cf9 100644
--- a/gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc
+++ b/gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc
@@ -1,6 +1,40 @@
+// wide string support -*- C++ -*-
+
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+// 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 2, 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.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// As a special exception, you may use this file as part of a free software
+// library without restriction. Specifically, if other files instantiate
+// templates or use macros or inline functions from this file, or you compile
+// this file and link it with other files to produce an executable, this
+// file does not by itself cause the resulting executable to be covered by
+// the GNU General Public License. This exception does not however
+// invalidate any other reasons why the executable file might be covered by
+// the GNU General Public License.
+
+//
+// ISO C++ 14882: 21 Strings library
+//
+
#include <bits/c++config.h>
-#ifdef _GLIBCPP_USE_WCHAR_T
+#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T)
#define C wchar_t
#include "string-inst.cc"
#endif
diff --git a/gnu/lib/libstdc++/shlib_version b/gnu/lib/libstdc++/shlib_version
index b97da722d51..56607597f5e 100644
--- a/gnu/lib/libstdc++/shlib_version
+++ b/gnu/lib/libstdc++/shlib_version
@@ -1,2 +1,2 @@
-major=39
+major=40
minor=0