From be7004e483155fec9dc1404ce22b9bf05c193127 Mon Sep 17 00:00:00 2001 From: Marc Espie Date: Fri, 17 Jun 2005 20:40:33 +0000 Subject: next citrus step. reviewed by millert, otto, kevlo, naddy, kettenis... libc+libstdc++ bump --- .../libstdc++/config/io/basic_file_libio.cc | 6 +- .../libstdc++/config/io/basic_file_libio.h | 4 +- gnu/lib/libstdc++/libstdc++/config/io/c_io_libio.h | 3 +- .../libstdc++/config/io/c_io_libio_codecvt.c | 10 +- gnu/lib/libstdc++/libstdc++/config/io/c_io_stdio.h | 2 +- .../config/locale/generic/codecvt_members.cc | 2 +- .../config/locale/generic/collate_members.cc | 2 +- .../config/locale/generic/ctype_members.cc | 2 +- .../config/locale/generic/messages_members.cc | 2 +- .../config/locale/generic/monetary_members.cc | 2 +- .../config/locale/generic/numeric_members.cc | 2 +- .../config/locale/generic/time_members.cc | 4 +- .../libstdc++/libstdc++/include/backward/fstream.h | 2 +- .../libstdc++/include/backward/iostream.h | 2 +- .../libstdc++/libstdc++/include/bits/basic_ios.tcc | 2 +- .../libstdc++/include/bits/basic_string.tcc | 2 +- .../libstdc++/libstdc++/include/bits/char_traits.h | 2 - gnu/lib/libstdc++/libstdc++/include/bits/codecvt.h | 4 +- gnu/lib/libstdc++/libstdc++/include/bits/fpos.h | 2 +- .../libstdc++/libstdc++/include/bits/fstream.tcc | 2 +- .../libstdc++/libstdc++/include/bits/istream.tcc | 2 +- .../libstdc++/include/bits/locale_facets.h | 14 +- .../libstdc++/include/bits/locale_facets.tcc | 2 +- .../libstdc++/libstdc++/include/bits/localefwd.h | 4 +- .../libstdc++/libstdc++/include/bits/ostream.tcc | 466 ++++++++++----------- .../libstdc++/libstdc++/include/bits/sstream.tcc | 4 +- .../libstdc++/libstdc++/include/bits/streambuf.tcc | 50 +-- .../libstdc++/include/c_compatibility/wchar.h | 4 +- .../libstdc++/libstdc++/include/c_std/std_cstdio.h | 10 +- .../libstdc++/libstdc++/include/c_std/std_cwchar.h | 34 +- .../libstdc++/include/c_std/std_cwctype.h | 4 +- .../libstdc++/libstdc++/include/std/std_fstream.h | 4 +- .../libstdc++/libstdc++/include/std/std_iomanip.h | 2 +- .../libstdc++/libstdc++/include/std/std_iosfwd.h | 2 +- .../libstdc++/libstdc++/include/std/std_iostream.h | 2 +- gnu/lib/libstdc++/libstdc++/libio/_G_config.h | 29 +- gnu/lib/libstdc++/libstdc++/libio/fileops.c | 2 +- gnu/lib/libstdc++/libstdc++/libio/genops.c | 8 +- gnu/lib/libstdc++/libstdc++/libio/iofopen.c | 4 +- gnu/lib/libstdc++/libstdc++/libio/iofwide.c | 18 +- gnu/lib/libstdc++/libstdc++/libio/libio.h | 10 +- gnu/lib/libstdc++/libstdc++/libio/libioP.h | 6 +- gnu/lib/libstdc++/libstdc++/libio/stdfiles.c | 4 +- gnu/lib/libstdc++/libstdc++/libio/wfiledoalloc.c | 2 +- gnu/lib/libstdc++/libstdc++/libio/wfileops.c | 2 +- gnu/lib/libstdc++/libstdc++/libio/wgenops.c | 2 +- gnu/lib/libstdc++/libstdc++/src/codecvt.cc | 4 +- gnu/lib/libstdc++/libstdc++/src/complex_io.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/concept-inst.cc | 6 +- gnu/lib/libstdc++/libstdc++/src/ctype.cc | 6 +- gnu/lib/libstdc++/libstdc++/src/ext-inst.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/fstream-inst.cc | 8 +- gnu/lib/libstdc++/libstdc++/src/fstream.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/globals.cc | 8 +- gnu/lib/libstdc++/libstdc++/src/io-inst.cc | 6 +- gnu/lib/libstdc++/libstdc++/src/ios.cc | 8 +- gnu/lib/libstdc++/libstdc++/src/istream-inst.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/limits.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/locale-inst.cc | 28 +- gnu/lib/libstdc++/libstdc++/src/locale.cc | 29 +- gnu/lib/libstdc++/libstdc++/src/localename.cc | 10 +- gnu/lib/libstdc++/libstdc++/src/misc-inst.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/ostream-inst.cc | 2 +- gnu/lib/libstdc++/libstdc++/src/sstream-inst.cc | 8 +- gnu/lib/libstdc++/libstdc++/src/streambuf-inst.cc | 4 +- gnu/lib/libstdc++/libstdc++/src/wstring-inst.cc | 36 +- gnu/lib/libstdc++/shlib_version | 2 +- 67 files changed, 485 insertions(+), 442 deletions(-) (limited to 'gnu/lib') 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 definitions -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) __basic_file::__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; template class __basic_file; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template struct __basic_file_base; template class __basic_file; #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 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::doallocate(); // __basic_file specializations -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> __basic_file::__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 -#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:: 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::_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::__wmask_type ctype::_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::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::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::~moneypunct() { } -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> void moneypunct::_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::~numpunct() { } -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> void numpunct::_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:: @@ -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; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class basic_ios; #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& getline(basic_istream&, string&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class basic_string; extern template basic_istream& 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 required specialization template<> class codecvt @@ -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 #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 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 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; extern template class basic_fstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class basic_filebuf; extern template class basic_ifstream; extern template class basic_ofstream; 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; 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& use_facet >(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 specialization template<> class ctype : public __ctype_abstract_base @@ -670,7 +670,7 @@ namespace std void numpunct::_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::~numpunct(); @@ -1053,7 +1053,7 @@ namespace std size_t collate::_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::_M_compare(const wchar_t*, const wchar_t*) const; @@ -1287,7 +1287,7 @@ namespace std void __timepunct::_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::_S_timezones[14]; @@ -1624,7 +1624,7 @@ namespace std void moneypunct::_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::~moneypunct(); @@ -1865,7 +1865,7 @@ namespace std string messages::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::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 >(const locale&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class moneypunct; extern template class moneypunct; extern template class moneypunct_byname; 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 class ctype; template<> class ctype; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> class ctype; #endif template @@ -122,7 +122,7 @@ namespace std template class codecvt; template<> class codecvt; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> class codecvt; #endif template 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 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 @@ -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 - 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 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 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(__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(__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 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 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(__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(__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 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 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 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 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 + 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 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 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; 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; extern template class basic_istringstream; extern template class basic_ostringstream; extern template class basic_stringstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class basic_stringbuf; extern template class basic_istringstream; extern template class basic_ostringstream; extern template class basic_stringstream; #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 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&, basic_streambuf*, basic_streambuf*); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern template class basic_streambuf; 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::int_type basic_filebuf::_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::int_type basic_filebuf::_M_underflow_common(bool __bump); - #endif +# endif // Generic definitions. template 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); 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 ofstream; ///< @isiosfwd typedef basic_fstream fstream; ///< @isiosfwd -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) typedef basic_ios wios; ///< @isiosfwd typedef basic_streambuf wstreambuf; ///< @isiosfwd typedef basic_istream 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 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 #include -#if defined(_LIBC) || defined(_GLIBCPP_USE_WCHAR_T) +#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T || defined(_GLIBCPP_USE_TYPE_WCHAR_T) # include #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 #include #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 #include -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) #include #ifdef HAVE_GCONV_H # include 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 #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::id; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) locale::id codecvt::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 required specialization codecvt:: 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 >&, const complex&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template basic_istream >& operator>>(basic_istream >&, 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 ); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) _Instantiate(_InputIteratorConcept ); _Instantiate(_InputIteratorConcept ); @@ -75,7 +75,7 @@ namespace __gnu_cxx _Instantiate(_OutputIteratorConcept >, char> ); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) _Instantiate(_OutputIteratorConcept >, wchar_t> ); #endif @@ -90,7 +90,7 @@ namespace __gnu_cxx _Instantiate(_RandomAccessIteratorConcept< __normal_iterator > ); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) _Instantiate(_RandomAccessIteratorConcept< __normal_iterator, 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::id; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) locale::id ctype::id; #endif @@ -51,7 +51,7 @@ namespace std return static_cast&>(*(__tmp->_M_facets[__i])); } -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template<> const ctype& use_facet >(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::ctype(size_t __refs) : __ctype_abstract_base(__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; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template const unsigned long rope >::_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 >; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_filebuf >; #endif // ifstream template class basic_ifstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_ifstream; #endif // ofstream template class basic_ofstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_ofstream; #endif // fstream template class basic_fstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_fstream; #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::int_type basic_filebuf::_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)] __attribute__ ((aligned(__alignof__(std::ctype)))); fake_wtype_w ctype_w; @@ -234,7 +234,7 @@ namespace __gnu_cxx __attribute__ ((aligned(__alignof__(std::__locale_cache >)))); 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 >)] __attribute__ ((aligned(__alignof__(std::__locale_cache >)))); 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)] __attribute__ ((aligned(__alignof__(stdio_filebuf)))); 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; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_ios; #endif // iomanip template class _Setfill; template _Setfill setfill(char); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class _Setfill; template _Setfill setfill(wchar_t); #endif // iostream template class basic_iostream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_iostream; #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 buf_cin; extern stdio_filebuf buf_cerr; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern stdio_filebuf buf_wcout; extern stdio_filebuf buf_wcin; extern stdio_filebuf 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(stdout, ios_base::out, __out_size); new (&buf_wcin) stdio_filebuf(stdin, ios_base::in, __in_size); new (&buf_wcerr) stdio_filebuf(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; 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::is_specialized; const int numeric_limits::digits; const int numeric_limits::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 >; template class __locale_cache >; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class moneypunct; template class moneypunct; template class moneypunct_byname; @@ -100,7 +100,7 @@ namespace std _M_convert_float(ostreambuf_iterator, 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; template class numpunct_byname; template class num_get >; @@ -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 num_put >:: @@ -210,7 +210,7 @@ namespace std template class time_get >; template class time_get_byname >; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class __timepunct; template class time_put >; template class time_put_byname >; @@ -221,7 +221,7 @@ namespace std // messages template class messages; template class messages_byname; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class messages; template class messages_byname; #endif @@ -229,7 +229,7 @@ namespace std // ctype inline template class __ctype_abstract_base; template class ctype_byname; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) inline template class __ctype_abstract_base; template class ctype_byname; #endif @@ -237,7 +237,7 @@ namespace std // codecvt inline template class __codecvt_abstract_base; template class codecvt_byname; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) inline template class __codecvt_abstract_base; template class codecvt_byname; #endif @@ -245,7 +245,7 @@ namespace std // collate template class collate; template class collate_byname; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class collate; template class collate_byname; #endif @@ -304,7 +304,7 @@ namespace std const messages& use_facet >(const locale&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template const codecvt& use_facet >(locale const&); @@ -411,7 +411,7 @@ namespace std bool has_facet >(const locale&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template bool has_facet >(const locale&); @@ -470,7 +470,7 @@ namespace std const __locale_cache >& __use_cache >(const locale& __loc); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template const __locale_cache >& __use_cache >(const locale& __loc); @@ -488,7 +488,7 @@ namespace std template class __pad >; -#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, 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::id, &codecvt::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &std::ctype::id, &codecvt::id, #endif @@ -85,7 +85,7 @@ namespace std &num_get::id, &num_put::id, &numpunct::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &num_get::id, &num_put::id, &numpunct::id, @@ -97,7 +97,7 @@ namespace std locale::_Impl::_S_id_collate[] = { &std::collate::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &std::collate::id, #endif 0 @@ -109,7 +109,7 @@ namespace std &__timepunct::id, &time_get::id, &time_put::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &__timepunct::id, &time_get::id, &time_put::id, @@ -124,7 +124,7 @@ namespace std &money_put::id, &moneypunct::id, &moneypunct::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &money_get::id, &money_put::id, &moneypunct::id, @@ -137,7 +137,7 @@ namespace std locale::_Impl::_S_id_messages[] = { &std::messages::id, -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) &std::messages::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::_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 time_get_c; extern time_put time_put_c; extern std::messages messages_c; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) extern std::ctype ctype_w; extern std::collate collate_w; extern numpunct numpunct_w; @@ -71,7 +71,7 @@ namespace __gnu_cxx #endif extern std::__locale_cache > 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 > locale_cache_np_w; #endif } // namespace __gnu_cxx @@ -203,7 +203,7 @@ namespace std _M_init_facet(new time_put); _M_init_facet(new std::messages(__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(__cloc)); _M_init_facet(new codecvt); _M_init_facet(new numpunct(__cloc)); @@ -274,7 +274,7 @@ namespace std _M_init_facet(new (&time_get_c) time_get(1)); _M_init_facet(new (&time_put_c) time_put(1)); _M_init_facet(new (&messages_c) std::messages(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(1)); _M_init_facet(new (&codecvt_w) codecvt(1)); _M_init_facet(new (&numpunct_w) numpunct(1)); @@ -303,7 +303,7 @@ namespace std _M_facets[numpunct::id._M_id() + _M_facets_size] = reinterpret_cast(__lc); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) __locale_cache >* __wlc = new (&locale_cache_np_w) __locale_cache >(ltmp, true); _M_facets[numpunct::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& getline(basic_istream&, string&); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template basic_istream& operator>>(basic_istream&, 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; 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; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_stringbuf; #endif // istringstream template class basic_istringstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_istringstream; #endif // ostringstream template class basic_ostringstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_ostringstream; #endif // stringstream template class basic_stringstream; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_stringstream; #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; -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template class basic_streambuf; #endif @@ -47,7 +47,7 @@ namespace std streamsize __copy_streambufs(basic_ios&, basic_streambuf*, basic_streambuf*); -#ifdef _GLIBCPP_USE_WCHAR_T +#if defined(_GLIBCPP_USE_WCHAR_T) || defined(_GLIBCPP_USE_TYPE_WCHAR_T) template streamsize __copy_streambufs(basic_ios&, basic_streambuf*, 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 -#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 -- cgit v1.2.3