re PR libstdc++/8318 (Not all wide character based prototypes are included within...
authorBenjamin Kosnik <bkoz@redhat.com>
Fri, 1 Nov 2002 17:30:36 +0000 (17:30 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 1 Nov 2002 17:30:36 +0000 (17:30 +0000)
2002-11-01  Benjamin Kosnik  <bkoz@redhat.com>

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
libstdc++-v3/include/bits/basic_ios.tcc
libstdc++-v3/include/bits/basic_string.tcc
libstdc++-v3/include/bits/fstream.tcc
libstdc++-v3/include/bits/locale_facets.tcc
libstdc++-v3/include/bits/sstream.tcc
libstdc++-v3/include/bits/streambuf.tcc
libstdc++-v3/include/bits/stringfwd.h
libstdc++-v3/include/std/std_iomanip.h
libstdc++-v3/include/std/std_iosfwd.h
libstdc++-v3/include/std/std_iostream.h

index 734aa7f11ef62c37a4a2c72d4a1257c38a270c96..b3b5fb72f0a5d5d7bf445449b17d192978870ab8 100644 (file)
@@ -1,3 +1,17 @@
+2002-11-01  Benjamin Kosnik  <bkoz@redhat.com>
+
+       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  <john.carter@tait.co.nz>
 
        PR libstdc++/7961
index a38a95b58a0ff43834ad0635ca44bb6298a155ef..7ee8015e29f65bdb9f0246497231e498961bf61e 100644 (file)
@@ -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<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
   extern template class basic_ios<wchar_t>;
+#endif
 } // namespace std
 
 #endif 
index 198f190eae891e754cae476846e995b1cd5caeff..4a22d8967929e51cc99e44c507885962acd279cf 100644 (file)
@@ -959,6 +959,7 @@ namespace std
     basic_istream<char>& 
     getline(basic_istream<char>&, string&);
 
+#ifdef _GLIBCPP_USE_WCHAR_T
   extern template class basic_string<wchar_t>;
   extern template 
     basic_istream<wchar_t>& 
@@ -972,6 +973,7 @@ namespace std
   extern template 
     basic_istream<wchar_t>& 
     getline(basic_istream<wchar_t>&, wstring&);
+#endif
 } // namespace std
 
 #endif
index 18dbaf1caae8b6915e88feebfce289f4e0ed6c7a..66cb9a1b179fbca2a7e072e88f5196a345717aa9 100644 (file)
@@ -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<char>;
-  extern template class basic_filebuf<wchar_t>;
   extern template class basic_ifstream<char>;
-  extern template class basic_ifstream<wchar_t>;
   extern template class basic_ofstream<char>;
-  extern template class basic_ofstream<wchar_t>;
   extern template class basic_fstream<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+  extern template class basic_filebuf<wchar_t>;
+  extern template class basic_ifstream<wchar_t>;
+  extern template class basic_ofstream<wchar_t>;
   extern template class basic_fstream<wchar_t>;
+#endif
 } // namespace std
 
 #endif 
index f21054e29663ffced849197e36d61c1952b375c1..ce6f3d7d5ffa0a34763ea1c0cfbf2e694d9bfb50 100644 (file)
@@ -2140,42 +2140,21 @@ namespace std
   extern template class moneypunct_byname<char, true>;
   extern template class money_get<char>;
   extern template class money_put<char>;
-  extern template class moneypunct<wchar_t, false>;
-  extern template class moneypunct<wchar_t, true>;
-  extern template class moneypunct_byname<wchar_t, false>;
-  extern template class moneypunct_byname<wchar_t, true>;
-  extern template class money_get<wchar_t>;
-  extern template class money_put<wchar_t>;
   extern template class numpunct<char>;
   extern template class numpunct_byname<char>;
   extern template class num_get<char>;
   extern template class num_put<char>; 
-  extern template class numpunct<wchar_t>;
-  extern template class numpunct_byname<wchar_t>;
-  extern template class num_get<wchar_t>;
-  extern template class num_put<wchar_t>;
   extern template class __timepunct<char>;
   extern template class time_put<char>;
   extern template class time_put_byname<char>;
   extern template class time_get<char>;
   extern template class time_get_byname<char>;
-  extern template class __timepunct<wchar_t>;
-  extern template class time_put<wchar_t>;
-  extern template class time_put_byname<wchar_t>;
-  extern template class time_get<wchar_t>;
-  extern template class time_get_byname<wchar_t>;
   extern template class messages<char>;
   extern template class messages_byname<char>;
-  extern template class messages<wchar_t>;
-  extern template class messages_byname<wchar_t>;
   extern template class ctype_byname<char>;
-  extern template class ctype_byname<wchar_t>;
   extern template class codecvt_byname<char, char, mbstate_t>;
-  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
   extern template class collate<char>;
   extern template class collate_byname<char>;
-  extern template class collate<wchar_t>;
-  extern template class collate_byname<wchar_t>;
 
   extern template
     const codecvt<char, char, mbstate_t>& 
@@ -2229,59 +2208,6 @@ namespace std
     const messages<char>& 
     use_facet<messages<char> >(const locale&);
 
-  extern template
-    const codecvt<wchar_t, char, mbstate_t>& 
-    use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
-
-  extern template
-    const collate<wchar_t>& 
-    use_facet<collate<wchar_t> >(const locale&);
-
-  extern template
-    const numpunct<wchar_t>& 
-    use_facet<numpunct<wchar_t> >(const locale&);
-
-  extern template 
-    const num_put<wchar_t>& 
-    use_facet<num_put<wchar_t> >(const locale&);
-
-  extern template 
-    const num_get<wchar_t>& 
-    use_facet<num_get<wchar_t> >(const locale&);
-
-  extern template
-    const moneypunct<wchar_t, true>& 
-    use_facet<moneypunct<wchar_t, true> >(const locale&);
-
-  extern template
-    const moneypunct<wchar_t, false>& 
-    use_facet<moneypunct<wchar_t, false> >(const locale&);
-  extern template 
-    const money_put<wchar_t>& 
-    use_facet<money_put<wchar_t> >(const locale&);
-
-  extern template 
-    const money_get<wchar_t>& 
-    use_facet<money_get<wchar_t> >(const locale&);
-
-  extern template
-    const __timepunct<wchar_t>& 
-    use_facet<__timepunct<wchar_t> >(const locale&);
-
-  extern template 
-    const time_put<wchar_t>& 
-    use_facet<time_put<wchar_t> >(const locale&);
-
-  extern template 
-    const time_get<wchar_t>& 
-    use_facet<time_get<wchar_t> >(const locale&);
-
-  extern template 
-    const messages<wchar_t>& 
-    use_facet<messages<wchar_t> >(const locale&);
-
-
   extern template 
     bool
     has_facet<ctype<char> >(const locale&);
@@ -2334,6 +2260,81 @@ namespace std
     bool
     has_facet<messages<char> >(const locale&);
 
+#ifdef _GLIBCPP_USE_WCHAR_T
+  extern template class moneypunct<wchar_t, false>;
+  extern template class moneypunct<wchar_t, true>;
+  extern template class moneypunct_byname<wchar_t, false>;
+  extern template class moneypunct_byname<wchar_t, true>;
+  extern template class money_get<wchar_t>;
+  extern template class money_put<wchar_t>;
+  extern template class numpunct<wchar_t>;
+  extern template class numpunct_byname<wchar_t>;
+  extern template class num_get<wchar_t>;
+  extern template class num_put<wchar_t>;
+  extern template class __timepunct<wchar_t>;
+  extern template class time_put<wchar_t>;
+  extern template class time_put_byname<wchar_t>;
+  extern template class time_get<wchar_t>;
+  extern template class time_get_byname<wchar_t>;
+  extern template class messages<wchar_t>;
+  extern template class messages_byname<wchar_t>;
+  extern template class ctype_byname<wchar_t>;
+  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+  extern template class collate<wchar_t>;
+  extern template class collate_byname<wchar_t>;
+
+  extern template
+    const codecvt<wchar_t, char, mbstate_t>& 
+    use_facet<codecvt<wchar_t, char, mbstate_t> >(locale const&);
+
+  extern template
+    const collate<wchar_t>& 
+    use_facet<collate<wchar_t> >(const locale&);
+
+  extern template
+    const numpunct<wchar_t>& 
+    use_facet<numpunct<wchar_t> >(const locale&);
+
+  extern template 
+    const num_put<wchar_t>& 
+    use_facet<num_put<wchar_t> >(const locale&);
+
+  extern template 
+    const num_get<wchar_t>& 
+    use_facet<num_get<wchar_t> >(const locale&);
+
+  extern template
+    const moneypunct<wchar_t, true>& 
+    use_facet<moneypunct<wchar_t, true> >(const locale&);
+
+  extern template
+    const moneypunct<wchar_t, false>& 
+    use_facet<moneypunct<wchar_t, false> >(const locale&);
+  extern template 
+    const money_put<wchar_t>& 
+    use_facet<money_put<wchar_t> >(const locale&);
+
+  extern template 
+    const money_get<wchar_t>& 
+    use_facet<money_get<wchar_t> >(const locale&);
+
+  extern template
+    const __timepunct<wchar_t>& 
+    use_facet<__timepunct<wchar_t> >(const locale&);
+
+  extern template 
+    const time_put<wchar_t>& 
+    use_facet<time_put<wchar_t> >(const locale&);
+
+  extern template 
+    const time_get<wchar_t>& 
+    use_facet<time_get<wchar_t> >(const locale&);
+
+  extern template 
+    const messages<wchar_t>& 
+    use_facet<messages<wchar_t> >(const locale&);
+
  extern template 
     bool
     has_facet<ctype<wchar_t> >(const locale&);
@@ -2385,6 +2386,7 @@ namespace std
   extern template 
     bool
     has_facet<messages<wchar_t> >(const locale&);
+#endif
 } // namespace std
 
 #endif
index 99eb6af125f576a3fc26ce93641ee9383cbb0a3f..606705c02e91617e68d4e056a3d2e2393188e3bc 100644 (file)
@@ -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<char>;
-  extern template class basic_stringbuf<wchar_t>;
   extern template class basic_istringstream<char>;
-  extern template class basic_istringstream<wchar_t>;
   extern template class basic_ostringstream<char>;
-  extern template class basic_ostringstream<wchar_t>;
   extern template class basic_stringstream<char>;
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+  extern template class basic_stringbuf<wchar_t>;
+  extern template class basic_istringstream<wchar_t>;
+  extern template class basic_ostringstream<wchar_t>;
   extern template class basic_stringstream<wchar_t>;
+#endif
 } // namespace std
 
 #endif
index 2101f10b2ef2dd761cbf86f71b8e2eea1ee18c84..c8084ee68ada3c6ea95e95d1fa908c589fb9a287 100644 (file)
@@ -249,11 +249,13 @@ namespace std
     __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
                      basic_streambuf<char>*); 
 
+#ifdef _GLIBCPP_USE_WCHAR_T
   extern template class basic_streambuf<wchar_t>;
   extern template
     streamsize
     __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
                      basic_streambuf<wchar_t>*); 
+#endif
 } // namespace std
 
 #endif 
index 07b1009a4b2b7a99c291337ce5de9bb4cc7be9ff..db40befdab6acae8aad56311c4714557c83a89fd 100644 (file)
 
 namespace std
 {
-  template<class _CharT>
-    struct char_traits;
-  
-  template<> struct char_traits<char>;
-#ifdef _GLIBCPP_USE_WCHAR_T
-  template<> struct char_traits<wchar_t>;
-#endif
-
   template<typename _Alloc> 
     class allocator;
 
+  template<class _CharT>
+    struct char_traits;
+
   template<typename _CharT, typename _Traits = char_traits<_CharT>, 
            typename _Alloc = allocator<_CharT> >
     class basic_string;
+  
+  template<> struct char_traits<char>;
 
-  /// 99%% of %string users only ever [need to] see the typedef.
   typedef basic_string<char>    string;
-  /// 99%% of %wstring users only ever [need to] see the typedef.
+
+#ifdef _GLIBCPP_USE_WCHAR_T
+  template<> struct char_traits<wchar_t>;
+
   typedef basic_string<wchar_t> wstring;
+#endif
 } // namespace std
 
 #endif // _CPP_BITS_STRINGFWD_H
index e046c82f8fa156bcd2b01f86bd3299b7898a2e27..23237ce210d6b28b6cb9aebb74dfa5d451e917d4 100644 (file)
@@ -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<wchar_t>);
-  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<char>);
   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<wchar_t>);
+  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<wchar_t>);
   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 
index f76ca7cad706bd7ce33c8451437cb8c49ec2f136..797f4936dc8a789ed3e8e0120116721b78f81451 100644 (file)
@@ -116,6 +116,7 @@ namespace std
   typedef basic_ofstream<char>                 ofstream;
   typedef basic_fstream<char>          fstream;
 
+#ifdef _GLIBCPP_USE_WCHAR_T
   typedef basic_ios<wchar_t>           wios;
   typedef basic_streambuf<wchar_t>     wstreambuf;
   typedef basic_istream<wchar_t>       wistream;
@@ -129,6 +130,7 @@ namespace std
   typedef basic_ifstream<wchar_t>      wifstream;
   typedef basic_ofstream<wchar_t>      wofstream;
   typedef basic_fstream<wchar_t>       wfstream;
+#endif
 } // namespace std
 
 #endif
index 5b3da9c0d8bc9aacdd0805819026cc90956cdb90..d0736b835132bd663b3d2d23abdec19acde7a397 100644 (file)
@@ -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;