]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR libstdc++/20534 (contd)
authorBenjamin Kosnik <bkoz@redhat.com>
Fri, 26 Aug 2005 21:10:59 +0000 (21:10 +0000)
committerBenjamin Kosnik <bkoz@gcc.gnu.org>
Fri, 26 Aug 2005 21:10:59 +0000 (21:10 +0000)
2005-08-26  Benjamin Kosnik  <bkoz@redhat.com>

PR libstdc++/20534 (contd)
* src/debug.cc (__gnu_debug): Remove __fancy_abort definition.
Remove cstdio and cstdlib includes.
* include/debug/debug.h: Define inline here. Remove
_GLIBCXX_DEBUG_ABORT.
* include/debug/macros.h: Remove __fancy_abort declaration,
_GLIBXX_DEBUG_ABORT definition.
* config/linker-map.gnu: Remove export.

From-SVN: r103535

libstdc++-v3/ChangeLog
libstdc++-v3/config/linker-map.gnu
libstdc++-v3/include/debug/debug.h
libstdc++-v3/include/debug/macros.h
libstdc++-v3/src/debug.cc

index d8ee627d8d335dd5a9b5e5938fcb5d260dd24af3..76c62a1c471c68d2ec5a24c522c5f4ae18cbf60e 100644 (file)
@@ -1,3 +1,14 @@
+2005-08-26  Benjamin Kosnik  <bkoz@redhat.com>
+
+       PR libstdc++/20534 (contd)
+       * src/debug.cc (__gnu_debug): Remove __fancy_abort definition.
+       Remove cstdio and cstdlib includes.
+       * include/debug/debug.h: Define inline here. Remove
+       _GLIBCXX_DEBUG_ABORT.
+       * include/debug/macros.h: Remove __fancy_abort declaration,
+       _GLIBXX_DEBUG_ABORT definition.
+       * config/linker-map.gnu: Remove export.
+       
 2005-08-26  Benjamin Kosnik  <bkoz@redhat.com>
 
        * scripts/check_compile (UNIQUE_ID): New. Use to name output files.
index 1ba34f07ba190caebb0922f2d0f32bc01aed97ea..3099bfb68171d36625183dc08a111a6fa23f07a7 100644 (file)
@@ -566,7 +566,6 @@ GLIBCXX_3.4.6 {
     _ZNSt8ios_base17_M_call_callbacksENS_5eventE;
     _ZNSt8ios_base20_M_dispose_callbacksEv;
     _ZNSt6locale5facet13_S_get_c_nameEv;
-    _ZN11__gnu_debug13__fancy_abortEPKciS1_S1_;
 
     _ZNSt15basic_stringbufI[cw]St11char_traitsI[cw]ESaI[cw]EE9showmanycEv;
 
index 9865520cbc66fbb20beeb10af69c07902d4a084a..c29109681764817cab8a0f3408fe60898fdc7b2c 100644 (file)
 */
 
 #ifdef _GLIBCXX_DEBUG
-#  include <debug/macros.h>
-#  define _GLIBCXX_DEBUG_ASSERT(_Condition) _GLIBCXX_DEBUG_ABORT(_Condition)
+
+# include <debug/macros.h>
+# include <cstdlib>
+# include <cstdio>
+
+// Avoid the use of assert, because we're trying to keep the <cassert>
+// include out of the mix.
+namespace __gnu_debug
+{ 
+  inline void
+  __replacement_assert(const char* __file, int __line, const char* __function,
+                      const char* __condition)
+  {
+    std::printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
+               __function, __condition);
+    std::abort();
+  }
+}
+
+#define _GLIBCXX_DEBUG_ASSERT(_Condition)                               \
+  do {                                                                  \
+    if (! (_Condition))                                                 \
+      ::__gnu_debug::__replacement_assert(__FILE__, __LINE__,           \
+                                  __PRETTY_FUNCTION__,                 \
+                                  #_Condition);                        \
+  } while (false)
 
 #  ifdef _GLIBCXX_DEBUG_PEDANTIC
-#    define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ABORT(_Condition)
+#    define _GLIBCXX_DEBUG_PEDASSERT(_Condition) _GLIBCXX_DEBUG_ASSERT(_Condition)
 #  else
 #    define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
 #  endif
index 411e36efc414bcff8071cd0c52a9b63177a183e1..9b279cbf36a3f71025df741aef35f8d1589fa06b 100644 (file)
  * the user error and where the error is reported.
  *
  */
-namespace __gnu_debug
-{ void __fancy_abort(const char*, int, const char*, const char*); }
-#define _GLIBCXX_DEBUG_ABORT(_Condition)                                \
-  do {                                                                  \
-    if (! (_Condition))                                                 \
-      ::__gnu_debug::__fancy_abort(__FILE__, __LINE__,                  \
-                                  __PRETTY_FUNCTION__,                 \
-                                  #_Condition);                        \
-  } while (false)
-
 #define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage)                        \
   do {                                                                 \
     if (! (_Condition))                                                        \
index a86367aa504aa51a9d78a05f934bb2a1f244003a..af927e152fb5b74d42e3b976983af6f1c5e7308f 100644 (file)
 #include <debug/safe_sequence.h>
 #include <debug/safe_iterator.h>
 #include <algorithm>
-#include <cstdlib>
 #include <cassert>
 #include <cstring>
-#include <cstdio>
 #include <cctype>
 #include <bits/concurrence.h>
 
@@ -48,15 +46,6 @@ namespace __gnu_internal
 
 namespace __gnu_debug
 {
-  void
-  __fancy_abort(const char* __file, int __line, const char* __function,
-               const char* __condition)
-  {
-    printf("%s:%d: %s: Assertion '%s' failed.\n", __file, __line,
-          __function, __condition);
-    abort();
-  }
-
   const char* _S_debug_messages[] = 
   {
     "function requires a valid iterator range [%1.name;, %2.name;)",