From 94afef7bacbf538cbbd301d7c417623fbd0a77e4 Mon Sep 17 00:00:00 2001 From: Benjamin Kosnik Date: Fri, 27 May 2005 16:09:15 +0000 Subject: [PATCH] c++config: Remove extern template use when in debug mode, disable for non-weak systems. 2005-05-27 Benjamin Kosnik * include/bits/c++config: Remove extern template use when in debug mode, disable for non-weak systems. From-SVN: r100261 --- libstdc++-v3/ChangeLog | 5 +++ libstdc++-v3/include/bits/c++config | 57 ++++++++++++++++------------- 2 files changed, 36 insertions(+), 26 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 82603021734..5f9ccce4414 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,8 @@ +2005-05-27 Benjamin Kosnik + + * include/bits/c++config: Remove extern template use when in debug + mode, disable for non-weak systems. + 2005-05-27 Benjamin Kosnik PR libstdc++/20534 diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config index 526ab8c7355..16c3194ba67 100644 --- a/libstdc++-v3/include/bits/c++config +++ b/libstdc++-v3/include/bits/c++config @@ -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 @@ -34,6 +34,36 @@ // Pick up any OS-specific definitions. #include +// Debug mode support. Debug mode basic_string is not allowed to be +// associated with std, because of locale and exception link +// dependence. +namespace __gnu_debug_def { } + +namespace __gnu_debug +{ + using namespace __gnu_debug_def; +} + +#ifdef _GLIBCXX_DEBUG +# if __GXX_WEAK__ +# define _GLIBCXX_STD __gnu_norm +# define _GLIBCXX_EXTERN_TEMPLATE 0 + +namespace __gnu_norm +{ + using namespace std; +} +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 @@ -55,31 +85,6 @@ # 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. -namespace __gnu_debug_def { } - -namespace __gnu_debug -{ - using namespace __gnu_debug_def; -} - -#ifdef _GLIBCXX_DEBUG -# define _GLIBCXX_STD __gnu_norm -namespace __gnu_norm -{ - using namespace std; -} -namespace std -{ - using namespace __gnu_debug_def __attribute__ ((strong)); -} -#else -# define _GLIBCXX_STD std -#endif - - // The remainder of the prewritten config is automatic; all the // user hooks are listed above.