From 5112ae3a8f702def5e49b7944e069e9b0b0444b6 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 1 Nov 2002 17:30:36 +0000 Subject: [PATCH] re PR libstdc++/8318 (Not all wide character based prototypes are included within #ifdef _GLIBCPP_USE_WCHAR_T) 2002-11-01 Benjamin Kosnik PR libstdc++/8318 * include/std/std_iostream.h: Tweak. * include/std/std_iosfwd.h: Add _GLIBCPP_USE_WCHAR_T. * include/std/std_iomanip.h: Same. * include/bits/stringfwd.h: Same. * include/bits/basic_string.tcc: Same. * include/bits/sstream.tcc: Same. * include/bits/fstream.tcc: Same. * include/bits/basic_ios.tcc: Same. * include/bits/streambuf.tcc: Same. * include/bits/locale_facets.tcc: Same. From-SVN: r58720 --- libstdc++-v3/ChangeLog | 14 +++ libstdc++-v3/include/bits/basic_ios.tcc | 3 + libstdc++-v3/include/bits/basic_string.tcc | 2 + libstdc++-v3/include/bits/fstream.tcc | 9 +- libstdc++-v3/include/bits/locale_facets.tcc | 150 ++++++++++++++-------------- libstdc++-v3/include/bits/sstream.tcc | 9 +- libstdc++-v3/include/bits/streambuf.tcc | 2 + libstdc++-v3/include/bits/stringfwd.h | 20 ++-- libstdc++-v3/include/std/std_iomanip.h | 16 +-- libstdc++-v3/include/std/std_iosfwd.h | 2 + libstdc++-v3/include/std/std_iostream.h | 1 + 11 files changed, 131 insertions(+), 97 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 734aa7f..b3b5fb7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,17 @@ +2002-11-01 Benjamin Kosnik + + PR libstdc++/8318 + * include/std/std_iostream.h: Tweak. + * include/std/std_iosfwd.h: Add _GLIBCPP_USE_WCHAR_T. + * include/std/std_iomanip.h: Same. + * include/bits/stringfwd.h: Same. + * include/bits/basic_string.tcc: Same. + * include/bits/sstream.tcc: Same. + * include/bits/fstream.tcc: Same. + * include/bits/basic_ios.tcc: Same. + * include/bits/streambuf.tcc: Same. + * include/bits/locale_facets.tcc: Same. + 2002-11-01 John Carter PR libstdc++/7961 diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc index a38a95b..7ee8015 100644 --- a/libstdc++-v3/include/bits/basic_ios.tcc +++ b/libstdc++-v3/include/bits/basic_ios.tcc @@ -187,7 +187,10 @@ namespace std // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. extern template class basic_ios; + +#ifdef _GLIBCPP_USE_WCHAR_T extern template class basic_ios; +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc index 198f190..4a22d89 100644 --- a/libstdc++-v3/include/bits/basic_string.tcc +++ b/libstdc++-v3/include/bits/basic_string.tcc @@ -959,6 +959,7 @@ namespace std basic_istream& getline(basic_istream&, string&); +#ifdef _GLIBCPP_USE_WCHAR_T extern template class basic_string; extern template basic_istream& @@ -972,6 +973,7 @@ namespace std extern template basic_istream& getline(basic_istream&, wstring&); +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc index 18dbaf1..66cb9a1 100644 --- a/libstdc++-v3/include/bits/fstream.tcc +++ b/libstdc++-v3/include/bits/fstream.tcc @@ -477,13 +477,16 @@ namespace std // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. extern template class basic_filebuf; - extern template class basic_filebuf; extern template class basic_ifstream; - extern template class basic_ifstream; extern template class basic_ofstream; - extern template class basic_ofstream; extern template class basic_fstream; + +#ifdef _GLIBCPP_USE_WCHAR_T + extern template class basic_filebuf; + extern template class basic_ifstream; + extern template class basic_ofstream; extern template class basic_fstream; +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc index f21054e..ce6f3d7 100644 --- a/libstdc++-v3/include/bits/locale_facets.tcc +++ b/libstdc++-v3/include/bits/locale_facets.tcc @@ -2140,42 +2140,21 @@ namespace std extern template class moneypunct_byname; extern template class money_get; extern template class money_put; - extern template class moneypunct; - extern template class moneypunct; - extern template class moneypunct_byname; - extern template class moneypunct_byname; - extern template class money_get; - extern template class money_put; extern template class numpunct; extern template class numpunct_byname; extern template class num_get; extern template class num_put; - extern template class numpunct; - extern template class numpunct_byname; - extern template class num_get; - extern template class num_put; extern template class __timepunct; extern template class time_put; extern template class time_put_byname; extern template class time_get; extern template class time_get_byname; - extern template class __timepunct; - extern template class time_put; - extern template class time_put_byname; - extern template class time_get; - extern template class time_get_byname; extern template class messages; extern template class messages_byname; - extern template class messages; - extern template class messages_byname; extern template class ctype_byname; - extern template class ctype_byname; extern template class codecvt_byname; - extern template class codecvt_byname; extern template class collate; extern template class collate_byname; - extern template class collate; - extern template class collate_byname; extern template const codecvt& @@ -2229,59 +2208,6 @@ namespace std const messages& use_facet >(const locale&); - extern template - const codecvt& - use_facet >(locale const&); - - extern template - const collate& - use_facet >(const locale&); - - extern template - const numpunct& - use_facet >(const locale&); - - extern template - const num_put& - use_facet >(const locale&); - - extern template - const num_get& - use_facet >(const locale&); - - extern template - const moneypunct& - use_facet >(const locale&); - - extern template - const moneypunct& - use_facet >(const locale&); - - extern template - const money_put& - use_facet >(const locale&); - - extern template - const money_get& - use_facet >(const locale&); - - extern template - const __timepunct& - use_facet<__timepunct >(const locale&); - - extern template - const time_put& - use_facet >(const locale&); - - extern template - const time_get& - use_facet >(const locale&); - - extern template - const messages& - use_facet >(const locale&); - - extern template bool has_facet >(const locale&); @@ -2334,6 +2260,81 @@ namespace std bool has_facet >(const locale&); +#ifdef _GLIBCPP_USE_WCHAR_T + extern template class moneypunct; + extern template class moneypunct; + extern template class moneypunct_byname; + extern template class moneypunct_byname; + extern template class money_get; + extern template class money_put; + extern template class numpunct; + extern template class numpunct_byname; + extern template class num_get; + extern template class num_put; + extern template class __timepunct; + extern template class time_put; + extern template class time_put_byname; + extern template class time_get; + extern template class time_get_byname; + extern template class messages; + extern template class messages_byname; + extern template class ctype_byname; + extern template class codecvt_byname; + extern template class collate; + extern template class collate_byname; + + extern template + const codecvt& + use_facet >(locale const&); + + extern template + const collate& + use_facet >(const locale&); + + extern template + const numpunct& + use_facet >(const locale&); + + extern template + const num_put& + use_facet >(const locale&); + + extern template + const num_get& + use_facet >(const locale&); + + extern template + const moneypunct& + use_facet >(const locale&); + + extern template + const moneypunct& + use_facet >(const locale&); + + extern template + const money_put& + use_facet >(const locale&); + + extern template + const money_get& + use_facet >(const locale&); + + extern template + const __timepunct& + use_facet<__timepunct >(const locale&); + + extern template + const time_put& + use_facet >(const locale&); + + extern template + const time_get& + use_facet >(const locale&); + + extern template + const messages& + use_facet >(const locale&); + extern template bool has_facet >(const locale&); @@ -2385,6 +2386,7 @@ namespace std extern template bool has_facet >(const locale&); +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc index 99eb6af..606705c 100644 --- a/libstdc++-v3/include/bits/sstream.tcc +++ b/libstdc++-v3/include/bits/sstream.tcc @@ -226,13 +226,16 @@ namespace std // which are defined via explicit instantiations elsewhere. // NB: This syntax is a GNU extension. extern template class basic_stringbuf; - extern template class basic_stringbuf; extern template class basic_istringstream; - extern template class basic_istringstream; extern template class basic_ostringstream; - extern template class basic_ostringstream; extern template class basic_stringstream; + +#ifdef _GLIBCPP_USE_WCHAR_T + extern template class basic_stringbuf; + extern template class basic_istringstream; + extern template class basic_ostringstream; extern template class basic_stringstream; +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc index 2101f10..c8084ee 100644 --- a/libstdc++-v3/include/bits/streambuf.tcc +++ b/libstdc++-v3/include/bits/streambuf.tcc @@ -249,11 +249,13 @@ namespace std __copy_streambufs(basic_ios&, basic_streambuf*, basic_streambuf*); +#ifdef _GLIBCPP_USE_WCHAR_T extern template class basic_streambuf; extern template streamsize __copy_streambufs(basic_ios&, basic_streambuf*, basic_streambuf*); +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/bits/stringfwd.h b/libstdc++-v3/include/bits/stringfwd.h index 07b1009..db40bef 100644 --- a/libstdc++-v3/include/bits/stringfwd.h +++ b/libstdc++-v3/include/bits/stringfwd.h @@ -45,25 +45,25 @@ namespace std { - template - struct char_traits; - - template<> struct char_traits; -#ifdef _GLIBCPP_USE_WCHAR_T - template<> struct char_traits; -#endif - template class allocator; + template + struct char_traits; + template, typename _Alloc = allocator<_CharT> > class basic_string; + + template<> struct char_traits; - /// 99%% of %string users only ever [need to] see the typedef. typedef basic_string string; - /// 99%% of %wstring users only ever [need to] see the typedef. + +#ifdef _GLIBCPP_USE_WCHAR_T + template<> struct char_traits; + typedef basic_string wstring; +#endif } // namespace std #endif // _CPP_BITS_STRINGFWD_H diff --git a/libstdc++-v3/include/std/std_iomanip.h b/libstdc++-v3/include/std/std_iomanip.h index e046c82..23237ce 100644 --- a/libstdc++-v3/include/std/std_iomanip.h +++ b/libstdc++-v3/include/std/std_iomanip.h @@ -225,25 +225,27 @@ namespace std extern template ostream& operator<<(ostream&, _Setbase); extern template ostream& operator<<(ostream&, _Setprecision); extern template ostream& operator<<(ostream&, _Setw); - extern template wostream& operator<<(wostream&, _Setfill); - extern template wostream& operator<<(wostream&, _Setiosflags); - extern template wostream& operator<<(wostream&, _Resetiosflags); - extern template wostream& operator<<(wostream&, _Setbase); - extern template wostream& operator<<(wostream&, _Setprecision); - extern template wostream& operator<<(wostream&, _Setw); - extern template istream& operator>>(istream&, _Setfill); extern template istream& operator>>(istream&, _Setiosflags); extern template istream& operator>>(istream&, _Resetiosflags); extern template istream& operator>>(istream&, _Setbase); extern template istream& operator>>(istream&, _Setprecision); extern template istream& operator>>(istream&, _Setw); + +#ifdef _GLIBCPP_USE_WCHAR_T + extern template wostream& operator<<(wostream&, _Setfill); + extern template wostream& operator<<(wostream&, _Setiosflags); + extern template wostream& operator<<(wostream&, _Resetiosflags); + extern template wostream& operator<<(wostream&, _Setbase); + extern template wostream& operator<<(wostream&, _Setprecision); + extern template wostream& operator<<(wostream&, _Setw); extern template wistream& operator>>(wistream&, _Setfill); extern template wistream& operator>>(wistream&, _Setiosflags); extern template wistream& operator>>(wistream&, _Resetiosflags); extern template wistream& operator>>(wistream&, _Setbase); extern template wistream& operator>>(wistream&, _Setprecision); extern template wistream& operator>>(wistream&, _Setw); +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/std/std_iosfwd.h b/libstdc++-v3/include/std/std_iosfwd.h index f76ca7c..797f493 100644 --- a/libstdc++-v3/include/std/std_iosfwd.h +++ b/libstdc++-v3/include/std/std_iosfwd.h @@ -116,6 +116,7 @@ namespace std typedef basic_ofstream ofstream; typedef basic_fstream fstream; +#ifdef _GLIBCPP_USE_WCHAR_T typedef basic_ios wios; typedef basic_streambuf wstreambuf; typedef basic_istream wistream; @@ -129,6 +130,7 @@ namespace std typedef basic_ifstream wifstream; typedef basic_ofstream wofstream; typedef basic_fstream wfstream; +#endif } // namespace std #endif diff --git a/libstdc++-v3/include/std/std_iostream.h b/libstdc++-v3/include/std/std_iostream.h index 5b3da9c..d0736b8 100644 --- a/libstdc++-v3/include/std/std_iostream.h +++ b/libstdc++-v3/include/std/std_iostream.h @@ -51,6 +51,7 @@ namespace std extern ostream cout; extern ostream cerr; extern ostream clog; + #ifdef _GLIBCPP_USE_WCHAR_T extern wistream wcin; extern wostream wcout; -- 2.7.4