This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, 4/4] Enable libstdc++ as a DLL on windows platforms.


  This is the final patch in the series, and the largest, but at the same time
the most routine and mechanical.  It marks up the libstdc++ sources with macro
annotations that denote which classes, templates, and global data items need
to be explicitly imported by user applications.

libstdc++-v3/ChangeLog:

	* include/bits/c++config (_GLIBCXX_IMPORT): Add empty definition
	for non-dllimport targets.
	* include/std/iostream (cin): Annotate with _GLIBCXX_IMPORT.
	(cout, cerr, clog): Likewise.
	* include/std/stdexcept (class logic_error, domain_error,
	invalid_argument, length_error, out_of_range, runtime_error,
	range_error, underflow_error): Likewise.
	* include/ext/concurrence.h (class __concurrence_lock_error,
	__concurrence_unlock_error): Likewise.
	* include/bits/locale_classes.tcc (template class collate<char>,
	collate_byname<char>, collate<wchar_t>,
	collate_byname<wchar_t>): Likewise.
	* include/bits/locale_facets.tcc (template class numpunct<char>,
	numpunct_byname<char>, num_get<char>, num_put<char>,
	ctype_byname<char>, numpunct<wchar_t>, numpunct_byname<wchar_t>,
	num_get<wchar_t>, num_put<wchar_t>, ctype_byname<wchar_t>): Likewise.
	* include/bits/locale_classes.h (class locale, facet, id, _Impl,
	locale::facet, locale::id, locale::_Impl): Likewise.
	* include/bits/locale_facets.h (template class ctype<char>,
	ctype<wchar_t>): Likewise.
	* include/bits/basic_ios.tcc (template class basic_ios<char>,
	basic_ios<wchar_t>): Likewise.
	* include/bits/ios_base.h (class ios_base, failure, Init): Likewise.
	* include/bits/istream.tcc (template class basic_istream<char>,
	basic_iostream<char>, basic_istream<wchar_t>,
	basic_iostream<wchar_t>): Likewise.
	* include/bits/codecvt.h (template class codecvt_byname<char, char,
	mbstate_t>, codecvt_byname<wchar_t, char, mbstate_t>): Likewise.
	* include/bits/ostream.tcc (template class basic_ostream<char>,
	basic_ostream<wchar_t>): Likewise.
	* include/bits/sstream.tcc (template class basic_stringbuf<char>,
	basic_istringstream<char>, basic_ostringstream<char>,
	basic_stringstream<char>, basic_stringbuf<wchar_t>,
	basic_istringstream<wchar_t>, basic_ostringstream<wchar_t>,
	basic_stringstream<wchar_t>): Likewise.
	* include/bits/basic_string.tcc (template class basic_string<char>,
	basic_string<wchar_t>, related overloaded operator<<, operator>>,
	getline): Likewise.
	* include/bits/locale_facets_nonio.tcc (template class
	moneypunct<char, false>, moneypunct<char, true>,
	moneypunct_byname<char, false>, moneypunct_byname<char, true>,
	money_get<char>, money_put<char>, __timepunct<char>, time_put<char>,
	time_put_byname<char>, time_get<char>, time_get_byname<char>,
	messages<char>, messages_byname<char>, moneypunct<wchar_t, false>,
	moneypunct<wchar_t, true>, moneypunct_byname<wchar_t, false>,
	moneypunct_byname<wchar_t, true>, money_get<wchar_t>,
	money_put<wchar_t>, __timepunct<wchar_t>, time_put<wchar_t>,
	time_put_byname<wchar_t>, time_get<wchar_t>, time_get_byname<wchar_t>,
	messages<wchar_t>, messages_byname<wchar_t>): Likewise.
	* include/bits/streambuf.tcc (template class basic_streambuf<char>,
	basic_streambuf<wchar_t>): Likewise.
	* include/bits/fstream.tcc (template class basic_filebuf<char>,
	basic_ifstream<char>, basic_ofstream<char>, basic_fstream<char>,
	basic_filebuf<wchar_t>, basic_ifstream<wchar_t>,
	basic_ofstream<wchar_t>, basic_fstream<wchar_t>): Likewise.
	* include/backward/strstream (class strstreambuf, istrstream,
	ostrstream, strstream): Likewise.
	* libsupc++/typeinfo (class type_info, bad_cast, bad_typeid): Likewise.
	* libsupc++/exception (class exception, bad_exception): Likewise.
	* libsupc++/new (class bad_alloc): Likewise.

  Ok?

    cheers,
      DaveK

libstdc++-v3/ChangeLog:

	* include/bits/c++config (_GLIBCXX_IMPORT): Add empty definition
	for non-dllimport targets.
	* include/std/iostream (cin): Annotate with _GLIBCXX_IMPORT.
	(cout, cerr, clog): Likewise.
	* include/std/stdexcept (class logic_error, domain_error,
	invalid_argument, length_error, out_of_range, runtime_error,
	range_error, underflow_error): Likewise.
	* include/ext/concurrence.h (class __concurrence_lock_error,
	__concurrence_unlock_error): Likewise.
	* include/bits/locale_classes.tcc (template class collate<char>,
	collate_byname<char>, collate<wchar_t>,
	collate_byname<wchar_t>): Likewise.
	* include/bits/locale_facets.tcc (template class numpunct<char>,
	numpunct_byname<char>, num_get<char>, num_put<char>,
	ctype_byname<char>, numpunct<wchar_t>, numpunct_byname<wchar_t>,
	num_get<wchar_t>, num_put<wchar_t>, ctype_byname<wchar_t>): Likewise.
	* include/bits/locale_classes.h (class locale, facet, id, _Impl,
	locale::facet, locale::id, locale::_Impl): Likewise.
	* include/bits/locale_facets.h (template class ctype<char>,
	ctype<wchar_t>): Likewise.
	* include/bits/basic_ios.tcc (template class basic_ios<char>,
	basic_ios<wchar_t>): Likewise.
	* include/bits/ios_base.h (class ios_base, failure, Init): Likewise.
	* include/bits/istream.tcc (template class basic_istream<char>,
	basic_iostream<char>, basic_istream<wchar_t>,
	basic_iostream<wchar_t>): Likewise.
	* include/bits/codecvt.h (template class codecvt_byname<char, char,
	mbstate_t>, codecvt_byname<wchar_t, char, mbstate_t>): Likewise.
	* include/bits/ostream.tcc (template class basic_ostream<char>,
	basic_ostream<wchar_t>): Likewise.
	* include/bits/sstream.tcc (template class basic_stringbuf<char>,
	basic_istringstream<char>, basic_ostringstream<char>,
	basic_stringstream<char>, basic_stringbuf<wchar_t>,
	basic_istringstream<wchar_t>, basic_ostringstream<wchar_t>,
	basic_stringstream<wchar_t>): Likewise.
	* include/bits/basic_string.tcc (template class basic_string<char>,
	basic_string<wchar_t>, related overloaded operator<<, operator>>,
	getline): Likewise.
	* include/bits/locale_facets_nonio.tcc (template class
	moneypunct<char, false>, moneypunct<char, true>,
	moneypunct_byname<char, false>, moneypunct_byname<char, true>,
	money_get<char>, money_put<char>, __timepunct<char>, time_put<char>,
	time_put_byname<char>, time_get<char>, time_get_byname<char>,
	messages<char>, messages_byname<char>, moneypunct<wchar_t, false>,
	moneypunct<wchar_t, true>, moneypunct_byname<wchar_t, false>,
	moneypunct_byname<wchar_t, true>, money_get<wchar_t>,
	money_put<wchar_t>, __timepunct<wchar_t>, time_put<wchar_t>,
	time_put_byname<wchar_t>, time_get<wchar_t>, time_get_byname<wchar_t>,
	messages<wchar_t>, messages_byname<wchar_t>): Likewise.
	* include/bits/streambuf.tcc (template class basic_streambuf<char>,
	basic_streambuf<wchar_t>): Likewise.
	* include/bits/fstream.tcc (template class basic_filebuf<char>,
	basic_ifstream<char>, basic_ofstream<char>, basic_fstream<char>,
	basic_filebuf<wchar_t>, basic_ifstream<wchar_t>,
	basic_ofstream<wchar_t>, basic_fstream<wchar_t>): Likewise.
	* include/backward/strstream (class strstreambuf, istrstream,
	ostrstream, strstream): Likewise.
	* libsupc++/typeinfo (class type_info, bad_cast, bad_typeid): Likewise.
	* libsupc++/exception (class exception, bad_exception): Likewise.
	* libsupc++/new (class bad_alloc): Likewise.


Index: libstdc++-v3/include/std/iostream
===================================================================
--- libstdc++-v3/include/std/iostream	(revision 149338)
+++ libstdc++-v3/include/std/iostream	(working copy)
@@ -55,16 +55,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  termination.  For more information, see the HOWTO linked to above.
   */
   //@{
-  extern istream cin;		///< Linked to standard input
-  extern ostream cout;		///< Linked to standard output
-  extern ostream cerr;		///< Linked to standard error (unbuffered)
-  extern ostream clog;		///< Linked to standard error (buffered)
+  extern _GLIBCXX_IMPORT istream cin;		///< Linked to standard input
+  extern _GLIBCXX_IMPORT ostream cout;		///< Linked to standard output
+  extern _GLIBCXX_IMPORT ostream cerr;		///< Linked to standard error (unbuffered)
+  extern _GLIBCXX_IMPORT ostream clog;		///< Linked to standard error (buffered)
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern wistream wcin;		///< Linked to standard input
-  extern wostream wcout;	///< Linked to standard output
-  extern wostream wcerr;	///< Linked to standard error (unbuffered)
-  extern wostream wclog;	///< Linked to standard error (buffered)
+  extern _GLIBCXX_IMPORT wistream wcin;		///< Linked to standard input
+  extern _GLIBCXX_IMPORT wostream wcout;	///< Linked to standard output
+  extern _GLIBCXX_IMPORT wostream wcerr;	///< Linked to standard error (unbuffered)
+  extern _GLIBCXX_IMPORT wostream wclog;	///< Linked to standard error (buffered)
 #endif
   //@}
 
Index: libstdc++-v3/include/std/stdexcept
===================================================================
--- libstdc++-v3/include/std/stdexcept	(revision 149338)
+++ libstdc++-v3/include/std/stdexcept	(working copy)
@@ -50,7 +50,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  program runs (e.g., violations of class invariants).
    *  @brief One of two subclasses of exception.
    */
-  class logic_error : public exception 
+  class _GLIBCXX_IMPORT logic_error : public exception
   {
     string _M_msg;
 
@@ -70,14 +70,14 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /** Thrown by the library, or by you, to report domain errors (domain in
    *  the mathematical sense).  */
-  class domain_error : public logic_error 
+  class _GLIBCXX_IMPORT domain_error : public logic_error
   {
   public:
     explicit domain_error(const string& __arg);
   };
 
   /** Thrown to report invalid arguments to functions.  */
-  class invalid_argument : public logic_error 
+  class _GLIBCXX_IMPORT invalid_argument : public logic_error
   {
   public:
     explicit invalid_argument(const string& __arg);
@@ -85,7 +85,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /** Thrown when an object is constructed that would exceed its maximum
    *  permitted size (e.g., a basic_string instance).  */
-  class length_error : public logic_error 
+  class _GLIBCXX_IMPORT length_error : public logic_error
   {
   public:
     explicit length_error(const string& __arg);
@@ -93,7 +93,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   /** This represents an argument whose value is not within the expected
    *  range (e.g., boundary checks in basic_string).  */
-  class out_of_range : public logic_error 
+  class _GLIBCXX_IMPORT out_of_range : public logic_error
   {
   public:
     explicit out_of_range(const string& __arg);
@@ -104,7 +104,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  the program executes.
    *  @brief One of two subclasses of exception.
    */
-  class runtime_error : public exception 
+  class _GLIBCXX_IMPORT runtime_error : public exception
   {
     string _M_msg;
 
@@ -123,7 +123,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   };
 
   /** Thrown to indicate range errors in internal computations.  */
-  class range_error : public runtime_error 
+  class _GLIBCXX_IMPORT range_error : public runtime_error
   {
   public:
     explicit range_error(const string& __arg);
@@ -137,7 +137,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   };
 
   /** Thrown to indicate arithmetic underflow.  */
-  class underflow_error : public runtime_error 
+  class _GLIBCXX_IMPORT underflow_error : public runtime_error
   {
   public:
     explicit underflow_error(const string& __arg);
Index: libstdc++-v3/include/ext/concurrence.h
===================================================================
--- libstdc++-v3/include/ext/concurrence.h	(revision 149338)
+++ libstdc++-v3/include/ext/concurrence.h	(working copy)
@@ -60,7 +60,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
 
   // NB: As this is used in libsupc++, need to only depend on
   // exception. No stdexception classes, no use of std::string.
-  class __concurrence_lock_error : public std::exception
+  class _GLIBCXX_IMPORT __concurrence_lock_error : public std::exception
   {
   public:
     virtual char const*
@@ -68,7 +68,7 @@ _GLIBCXX_BEGIN_NAMESPACE(__gnu_cxx)
     { return "__gnu_cxx::__concurrence_lock_error"; }
   };
 
-  class __concurrence_unlock_error : public std::exception
+  class _GLIBCXX_IMPORT __concurrence_unlock_error : public std::exception
   {
   public:
     virtual char const*
Index: libstdc++-v3/include/bits/locale_classes.tcc
===================================================================
--- libstdc++-v3/include/bits/locale_classes.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/locale_classes.tcc	(working copy)
@@ -241,8 +241,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB: This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class collate<char>;
-  extern template class collate_byname<char>;
+  extern template class _GLIBCXX_IMPORT collate<char>;
+  extern template class _GLIBCXX_IMPORT collate_byname<char>;
 
   extern template
     const collate<char>&
@@ -253,8 +253,8 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     has_facet<collate<char> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class collate<wchar_t>;
-  extern template class collate_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT collate<wchar_t>;
+  extern template class _GLIBCXX_IMPORT collate_byname<wchar_t>;
 
   extern template
     const collate<wchar_t>&
Index: libstdc++-v3/include/bits/locale_facets.tcc
===================================================================
--- libstdc++-v3/include/bits/locale_facets.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/locale_facets.tcc	(working copy)
@@ -1261,11 +1261,11 @@ _GLIBCXX_END_LDBL_NAMESPACE
   // which are defined via explicit instantiations elsewhere.
   // NB: This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class numpunct<char>;
-  extern template class numpunct_byname<char>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE num_get<char>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE num_put<char>;
-  extern template class ctype_byname<char>;
+  extern template class _GLIBCXX_IMPORT numpunct<char>;
+  extern template class _GLIBCXX_IMPORT numpunct_byname<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_get<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_put<char>;
+  extern template class _GLIBCXX_IMPORT ctype_byname<char>;
 
   extern template
     const ctype<char>&
@@ -1300,11 +1300,11 @@ _GLIBCXX_END_LDBL_NAMESPACE
     has_facet<num_get<char> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class numpunct<wchar_t>;
-  extern template class numpunct_byname<wchar_t>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
-  extern template class ctype_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT numpunct<wchar_t>;
+  extern template class _GLIBCXX_IMPORT numpunct_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE num_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT ctype_byname<wchar_t>;
 
   extern template
     const ctype<wchar_t>&
Index: libstdc++-v3/include/bits/locale_classes.h
===================================================================
--- libstdc++-v3/include/bits/locale_classes.h	(revision 149338)
+++ libstdc++-v3/include/bits/locale_classes.h	(working copy)
@@ -58,7 +58,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  This library supports efficient construction and copying of locales
    *  through a reference counting implementation of the locale class.
   */
-  class locale
+  class _GLIBCXX_IMPORT locale
   {
   public:
     // Types:
@@ -66,9 +66,9 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     typedef int	category;
 
     // Forward decls and friends:
-    class facet;
-    class id;
-    class _Impl;
+    class _GLIBCXX_IMPORT facet;
+    class _GLIBCXX_IMPORT id;
+    class _GLIBCXX_IMPORT _Impl;
 
     friend class facet;
     friend class _Impl;
@@ -332,7 +332,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *
    *  Facets may not be copied or assigned.
   */
-  class locale::facet
+  class _GLIBCXX_IMPORT locale::facet
   {
   private:
     friend class locale;
@@ -426,7 +426,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  cannot be used in a locale.  The locale::id ensures that each class
    *  type gets a unique identifier.
   */
-  class locale::id
+  class _GLIBCXX_IMPORT locale::id
   {
   private:
     friend class locale;
@@ -465,7 +465,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
 
   // Implementation object for locale.
-  class locale::_Impl
+  class _GLIBCXX_IMPORT locale::_Impl
   {
   public:
     // Friends.
Index: libstdc++-v3/include/bits/locale_facets.h
===================================================================
--- libstdc++-v3/include/bits/locale_facets.h	(revision 149338)
+++ libstdc++-v3/include/bits/locale_facets.h	(working copy)
@@ -671,7 +671,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  optimizations as well.
   */
   template<>
-    class ctype<char> : public locale::facet, public ctype_base
+    class _GLIBCXX_IMPORT ctype<char> : public locale::facet, public ctype_base
     {
     public:
       // Types:
@@ -1172,7 +1172,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  __ctype_abstract_base<wchar_t>.
   */
   template<>
-    class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
+    class _GLIBCXX_IMPORT ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
     {
     public:
       // Types:
Index: libstdc++-v3/include/bits/basic_ios.tcc
===================================================================
--- libstdc++-v3/include/bits/basic_ios.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/basic_ios.tcc	(working copy)
@@ -175,10 +175,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_ios<char>;
+  extern template class _GLIBCXX_IMPORT basic_ios<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_ios<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ios<wchar_t>;
 #endif
 #endif
 
Index: libstdc++-v3/include/bits/ios_base.h
===================================================================
--- libstdc++-v3/include/bits/ios_base.h	(revision 149338)
+++ libstdc++-v3/include/bits/ios_base.h	(working copy)
@@ -204,7 +204,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
    *  people will only see @c ios_base when they need to specify the full
    *  name of the various I/O flags (e.g., the openmodes).
   */
-  class ios_base
+  class _GLIBCXX_IMPORT ios_base
   {
   public:
 
@@ -214,7 +214,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
      *
      *  27.4.2.1.1  Class ios_base::failure
      */
-    class failure : public exception
+    class _GLIBCXX_IMPORT failure : public exception
     {
     public:
       // _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -534,7 +534,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     // Used to initialize standard streams. In theory, g++ could use
     // -finit-priority to order this stuff correctly without going
     // through these machinations.
-    class Init
+    class _GLIBCXX_IMPORT Init
     {
       friend class ios_base;
     public:
Index: libstdc++-v3/include/bits/istream.tcc
===================================================================
--- libstdc++-v3/include/bits/istream.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/istream.tcc	(working copy)
@@ -968,7 +968,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_istream<char>;
+  extern template class _GLIBCXX_IMPORT basic_istream<char>;
   extern template istream& ws(istream&);
   extern template istream& operator>>(istream&, char&);
   extern template istream& operator>>(istream&, char*);
@@ -991,10 +991,10 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   extern template istream& istream::_M_extract(long double&);
   extern template istream& istream::_M_extract(void*&);
 
-  extern template class basic_iostream<char>;
+  extern template class _GLIBCXX_IMPORT basic_iostream<char>;
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_istream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_istream<wchar_t>;
   extern template wistream& ws(wistream&);
   extern template wistream& operator>>(wistream&, wchar_t&);
   extern template wistream& operator>>(wistream&, wchar_t*);
@@ -1013,7 +1013,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   extern template wistream& wistream::_M_extract(long double&);
   extern template wistream& wistream::_M_extract(void*&);
 
-  extern template class basic_iostream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_iostream<wchar_t>;
 #endif
 #endif
 
Index: libstdc++-v3/include/bits/codecvt.h
===================================================================
--- libstdc++-v3/include/bits/codecvt.h	(revision 149338)
+++ libstdc++-v3/include/bits/codecvt.h	(working copy)
@@ -469,7 +469,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB: This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class codecvt_byname<char, char, mbstate_t>;
+  extern template class _GLIBCXX_IMPORT codecvt_byname<char, char, mbstate_t>;
 
   extern template
     const codecvt<char, char, mbstate_t>&
@@ -480,7 +480,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
     has_facet<codecvt<char, char, mbstate_t> >(const locale&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class codecvt_byname<wchar_t, char, mbstate_t>;
+  extern template class _GLIBCXX_IMPORT codecvt_byname<wchar_t, char, mbstate_t>;
 
   extern template
     const codecvt<wchar_t, char, mbstate_t>&
Index: libstdc++-v3/include/bits/ostream.tcc
===================================================================
--- libstdc++-v3/include/bits/ostream.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/ostream.tcc	(working copy)
@@ -357,7 +357,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_ostream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ostream<char>;
   extern template ostream& endl(ostream&);
   extern template ostream& ends(ostream&);
   extern template ostream& flush(ostream&);
@@ -380,7 +380,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   extern template ostream& ostream::_M_insert(const void*);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_ostream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ostream<wchar_t>;
   extern template wostream& endl(wostream&);
   extern template wostream& ends(wostream&);
   extern template wostream& flush(wostream&);
Index: libstdc++-v3/include/bits/sstream.tcc
===================================================================
--- libstdc++-v3/include/bits/sstream.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/sstream.tcc	(working copy)
@@ -255,16 +255,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_stringbuf<char>;
-  extern template class basic_istringstream<char>;
-  extern template class basic_ostringstream<char>;
-  extern template class basic_stringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_stringbuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_istringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ostringstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_stringstream<char>;
 
 #ifdef _GLIBCXX_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>;
+  extern template class _GLIBCXX_IMPORT basic_stringbuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_istringstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ostringstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_stringstream<wchar_t>;
 #endif
 #endif
 
Index: libstdc++-v3/include/bits/c++config
===================================================================
--- libstdc++-v3/include/bits/c++config	(revision 149338)
+++ libstdc++-v3/include/bits/c++config	(working copy)
@@ -334,4 +334,8 @@ _GLIBCXX_END_NAMESPACE
 # endif
 #endif
 
+#ifndef _GLIBCXX_IMPORT
+#define _GLIBCXX_IMPORT
+#endif
+
 // End of prewritten config; the discovered settings follow.
Index: libstdc++-v3/include/bits/basic_string.tcc
===================================================================
--- libstdc++-v3/include/bits/basic_string.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/basic_string.tcc	(working copy)
@@ -1130,32 +1130,32 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB: This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE > 0
-  extern template class basic_string<char>;
-  extern template
+  extern template class _GLIBCXX_IMPORT basic_string<char>;
+  extern template _GLIBCXX_IMPORT
     basic_istream<char>&
     operator>>(basic_istream<char>&, string&);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_ostream<char>&
     operator<<(basic_ostream<char>&, const string&);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_istream<char>&
     getline(basic_istream<char>&, string&, char);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_istream<char>&
     getline(basic_istream<char>&, string&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_string<wchar_t>;
-  extern template
+  extern template class _GLIBCXX_IMPORT basic_string<wchar_t>;
+  extern template _GLIBCXX_IMPORT
     basic_istream<wchar_t>&
     operator>>(basic_istream<wchar_t>&, wstring&);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_ostream<wchar_t>&
     operator<<(basic_ostream<wchar_t>&, const wstring&);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_istream<wchar_t>&
     getline(basic_istream<wchar_t>&, wstring&, wchar_t);
-  extern template
+  extern template _GLIBCXX_IMPORT
     basic_istream<wchar_t>&
     getline(basic_istream<wchar_t>&, wstring&);
 #endif
Index: libstdc++-v3/include/bits/locale_facets_nonio.tcc
===================================================================
--- libstdc++-v3/include/bits/locale_facets_nonio.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/locale_facets_nonio.tcc	(working copy)
@@ -1174,19 +1174,19 @@ _GLIBCXX_END_LDBL_NAMESPACE
   // which are defined via explicit instantiations elsewhere.
   // NB: This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class moneypunct<char, false>;
-  extern template class moneypunct<char, true>;
-  extern template class moneypunct_byname<char, false>;
-  extern template class moneypunct_byname<char, true>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE money_get<char>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE money_put<char>;
-  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 messages<char>;
-  extern template class messages_byname<char>;
+  extern template class _GLIBCXX_IMPORT moneypunct<char, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct<char, true>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<char, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<char, true>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_get<char>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_put<char>;
+  extern template class _GLIBCXX_IMPORT __timepunct<char>;
+  extern template class _GLIBCXX_IMPORT time_put<char>;
+  extern template class _GLIBCXX_IMPORT time_put_byname<char>;
+  extern template class _GLIBCXX_IMPORT time_get<char>;
+  extern template class _GLIBCXX_IMPORT time_get_byname<char>;
+  extern template class _GLIBCXX_IMPORT messages<char>;
+  extern template class _GLIBCXX_IMPORT messages_byname<char>;
 
   extern template
     const moneypunct<char, true>&
@@ -1249,19 +1249,19 @@ _GLIBCXX_END_LDBL_NAMESPACE
     has_facet<messages<char> >(const locale&);
 
 #ifdef _GLIBCXX_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 _GLIBCXX_LDBL_NAMESPACE money_get<wchar_t>;
-  extern template class _GLIBCXX_LDBL_NAMESPACE money_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 _GLIBCXX_IMPORT moneypunct<wchar_t, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct<wchar_t, true>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<wchar_t, false>;
+  extern template class _GLIBCXX_IMPORT moneypunct_byname<wchar_t, true>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT _GLIBCXX_LDBL_NAMESPACE money_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT __timepunct<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_put<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_put_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_get<wchar_t>;
+  extern template class _GLIBCXX_IMPORT time_get_byname<wchar_t>;
+  extern template class _GLIBCXX_IMPORT messages<wchar_t>;
+  extern template class _GLIBCXX_IMPORT messages_byname<wchar_t>;
 
   extern template
     const moneypunct<wchar_t, true>&
Index: libstdc++-v3/include/bits/streambuf.tcc
===================================================================
--- libstdc++-v3/include/bits/streambuf.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/streambuf.tcc	(working copy)
@@ -146,7 +146,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_streambuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_streambuf<char>;
   extern template
     streamsize
     __copy_streambufs(basic_streambuf<char>*,
@@ -157,7 +157,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 			  basic_streambuf<char>*, bool&);
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-  extern template class basic_streambuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_streambuf<wchar_t>;
   extern template
     streamsize
     __copy_streambufs(basic_streambuf<wchar_t>*,
Index: libstdc++-v3/include/bits/fstream.tcc
===================================================================
--- libstdc++-v3/include/bits/fstream.tcc	(revision 149338)
+++ libstdc++-v3/include/bits/fstream.tcc	(working copy)
@@ -908,16 +908,16 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   // which are defined via explicit instantiations elsewhere.
   // NB:  This syntax is a GNU extension.
 #if _GLIBCXX_EXTERN_TEMPLATE
-  extern template class basic_filebuf<char>;
-  extern template class basic_ifstream<char>;
-  extern template class basic_ofstream<char>;
-  extern template class basic_fstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_filebuf<char>;
+  extern template class _GLIBCXX_IMPORT basic_ifstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_ofstream<char>;
+  extern template class _GLIBCXX_IMPORT basic_fstream<char>;
 
 #ifdef _GLIBCXX_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>;
+  extern template class _GLIBCXX_IMPORT basic_filebuf<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ifstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_ofstream<wchar_t>;
+  extern template class _GLIBCXX_IMPORT basic_fstream<wchar_t>;
 #endif
 #endif
 
Index: libstdc++-v3/include/backward/strstream
===================================================================
--- libstdc++-v3/include/backward/strstream	(revision 149338)
+++ libstdc++-v3/include/backward/strstream	(working copy)
@@ -54,7 +54,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
 
   // Class strstreambuf, a streambuf class that manages an array of char.
   // Note that this class is not a template.
-  class strstreambuf : public basic_streambuf<char, char_traits<char> >
+  class _GLIBCXX_IMPORT strstreambuf : public basic_streambuf<char, char_traits<char> >
   {
   public:
     // Types.
@@ -116,7 +116,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   };
 
   // Class istrstream, an istream that manages a strstreambuf.
-  class istrstream : public basic_istream<char>
+  class _GLIBCXX_IMPORT istrstream : public basic_istream<char>
   {
   public:
     explicit istrstream(char*);
@@ -133,7 +133,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   };
 
   // Class ostrstream
-  class ostrstream : public basic_ostream<char>
+  class _GLIBCXX_IMPORT ostrstream : public basic_ostream<char>
   {
   public:
     ostrstream();
@@ -150,7 +150,7 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
   };
 
   // Class strstream
-  class strstream : public basic_iostream<char>
+  class _GLIBCXX_IMPORT strstream : public basic_iostream<char>
   {
   public:
     typedef char                        char_type;
Index: libstdc++-v3/libsupc++/typeinfo
===================================================================
--- libstdc++-v3/libsupc++/typeinfo	(revision 149338)
+++ libstdc++-v3/libsupc++/typeinfo	(working copy)
@@ -85,7 +85,7 @@ namespace std
    *  The @c type_info class describes type information generated by
    *  an implementation.
   */
-  class type_info 
+  class _GLIBCXX_IMPORT type_info 
   {
   public:
     /** Destructor first. Being the first non-inline virtual function, this
@@ -159,7 +159,7 @@ namespace std
    *
    *  If you attempt an invalid @c dynamic_cast expression, an instance of
    *  this class (or something derived from this class) is thrown.  */
-  class bad_cast : public exception 
+  class _GLIBCXX_IMPORT bad_cast : public exception
   {
   public:
     bad_cast() throw() { }
@@ -176,7 +176,7 @@ namespace std
    *  @brief Thrown when a NULL pointer in a @c typeid expression is used.
    *  @ingroup exceptions
    */
-  class bad_typeid : public exception 
+  class _GLIBCXX_IMPORT bad_typeid : public exception 
   {
   public:
     bad_typeid () throw() { }
Index: libstdc++-v3/libsupc++/exception
===================================================================
--- libstdc++-v3/libsupc++/exception	(revision 149338)
+++ libstdc++-v3/libsupc++/exception	(working copy)
@@ -56,7 +56,7 @@ namespace std
    *  your own %exception classes, or use a different hierarchy, or to
    *  throw non-class data (e.g., fundamental types).
    */
-  class exception 
+  class _GLIBCXX_IMPORT exception
   {
   public:
     exception() throw() { }
@@ -69,7 +69,7 @@ namespace std
 
   /** If an %exception is thrown which is not listed in a function's
    *  %exception specification, one of these may be thrown.  */
-  class bad_exception : public exception 
+  class _GLIBCXX_IMPORT bad_exception : public exception
   {
   public:
     bad_exception() throw() { }
Index: libstdc++-v3/libsupc++/new
===================================================================
--- libstdc++-v3/libsupc++/new	(revision 149338)
+++ libstdc++-v3/libsupc++/new	(working copy)
@@ -51,7 +51,7 @@ namespace std
    *
    *  @c bad_alloc (or classes derived from it) is used to report allocation
    *  errors from the throwing forms of @c new.  */
-  class bad_alloc : public exception 
+  class _GLIBCXX_IMPORT bad_alloc : public exception
   {
   public:
     bad_alloc() throw() { }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]