OSDN Git Service

2005-05-27 Benjamin Kosnik <bkoz@redhat.com>
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 May 2005 16:09:15 +0000 (16:09 +0000)
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 27 May 2005 16:09:15 +0000 (16:09 +0000)
* include/bits/c++config: Remove extern template use when in debug
mode, disable for non-weak systems.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@100261 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/c++config

index 8260302..5f9ccce 100644 (file)
@@ -1,5 +1,10 @@
 2005-05-27  Benjamin Kosnik  <bkoz@redhat.com>
 
+       * include/bits/c++config: Remove extern template use when in debug
+       mode, disable for non-weak systems.
+       
+2005-05-27  Benjamin Kosnik  <bkoz@redhat.com>
+
        PR libstdc++/20534 
        * include/debug/debug.h: Forwarding header, that pulls in details
        only if in debug mode.
index 526ab8c..16c3194 100644 (file)
@@ -1,6 +1,6 @@
 // Predefined symbols and macros -*- C++ -*-
 
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 // Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // Pick up any OS-specific definitions.
 #include <bits/os_defines.h>
 
-// Allow use of "export template." This is currently not a feature
-// that g++ supports.
-// #define _GLIBCXX_EXPORT_TEMPLATE 1
-
-// Allow use of the GNU syntax extension, "extern template." This
-// extension is fully documented in the g++ manual, but in a nutshell,
-// it inhibits all implicit instantiations and is used throughout the
-// library to avoid multiple weak definitions for required types that
-// are already explicitly instantiated in the library binary. This
-// substantially reduces the binary size of resulting executables.
-#ifndef _GLIBCXX_EXTERN_TEMPLATE
-# define _GLIBCXX_EXTERN_TEMPLATE 1
-#endif
-
-// Certain function definitions that are meant to be overridable from
-// user code are decorated with this macro.  For some targets, this
-// macro causes these definitions to be weak.
-#ifndef _GLIBCXX_WEAK_DEFINITION
-# define _GLIBCXX_WEAK_DEFINITION
-#endif
-
 // Debug mode support. Debug mode basic_string is not allowed to be
 // associated with std, because of locale and exception link
 // dependence.
@@ -66,7 +45,10 @@ namespace __gnu_debug
 }
 
 #ifdef _GLIBCXX_DEBUG
-# define _GLIBCXX_STD __gnu_norm
+# if __GXX_WEAK__
+#  define _GLIBCXX_STD __gnu_norm
+#  define _GLIBCXX_EXTERN_TEMPLATE 0
+
 namespace __gnu_norm 
 { 
   using namespace std; 
@@ -75,10 +57,33 @@ namespace std
 {
   using namespace __gnu_debug_def __attribute__ ((strong));
 }
+# else
+#  warning debug mode disabled due to lack of weak symbol support
+# endif
 #else
 # define _GLIBCXX_STD std
 #endif
 
+// Allow use of "export template." This is currently not a feature
+// that g++ supports.
+// #define _GLIBCXX_EXPORT_TEMPLATE 1
+
+// Allow use of the GNU syntax extension, "extern template." This
+// extension is fully documented in the g++ manual, but in a nutshell,
+// it inhibits all implicit instantiations and is used throughout the
+// library to avoid multiple weak definitions for required types that
+// are already explicitly instantiated in the library binary. This
+// substantially reduces the binary size of resulting executables.
+#ifndef _GLIBCXX_EXTERN_TEMPLATE
+# define _GLIBCXX_EXTERN_TEMPLATE 1
+#endif
+
+// Certain function definitions that are meant to be overridable from
+// user code are decorated with this macro.  For some targets, this
+// macro causes these definitions to be weak.
+#ifndef _GLIBCXX_WEAK_DEFINITION
+# define _GLIBCXX_WEAK_DEFINITION
+#endif
 
 // The remainder of the prewritten config is automatic; all the
 // user hooks are listed above.