summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include
diff options
context:
space:
mode:
authorbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-26 21:10:59 +0000
committerbkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-26 21:10:59 +0000
commited028e173459461350f90fd9a430ca2323228bb5 (patch)
tree8a9ff1231f676eb1b8f844fa75ddbd482309c0c5 /libstdc++-v3/include
parent5e941d36484f44b6d1a9818a7d43d421d5aae015 (diff)
downloadgcc-ed028e173459461350f90fd9a430ca2323228bb5.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103535 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r--libstdc++-v3/include/debug/debug.h30
-rw-r--r--libstdc++-v3/include/debug/macros.h10
2 files changed, 27 insertions, 13 deletions
diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h
index 9865520cbc6..c2910968176 100644
--- a/libstdc++-v3/include/debug/debug.h
+++ b/libstdc++-v3/include/debug/debug.h
@@ -40,11 +40,35 @@
*/
#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
diff --git a/libstdc++-v3/include/debug/macros.h b/libstdc++-v3/include/debug/macros.h
index 411e36efc41..9b279cbf36a 100644
--- a/libstdc++-v3/include/debug/macros.h
+++ b/libstdc++-v3/include/debug/macros.h
@@ -40,16 +40,6 @@
* 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)) \