aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2003-05-29 21:22:45 +0000
committerAndrew Cagney <cagney@redhat.com>2003-05-29 21:22:45 +0000
commit93ec1121ede50148a35445689eab133f4381841a (patch)
treefae301d2ee8b789ccbf22a144153c95ae80031f8
parent98f08d3d9b69b344bb8b0cd2a4bda1cf4d966e20 (diff)
downloadgdb-93ec1121ede50148a35445689eab133f4381841a.zip
gdb-93ec1121ede50148a35445689eab133f4381841a.tar.gz
gdb-93ec1121ede50148a35445689eab133f4381841a.tar.bz2
2003-05-29 Andrew Cagney <cagney@redhat.com>
* gdb_assert.h (gdb_assert_fail): Provide different definitions dependant on the availability of ASSERT_FUNCTION. (ASSERT_FUNCTION): Do not define when there is no function name.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/gdb_assert.h11
2 files changed, 13 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 01e45f3..0a810e9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2003-05-29 Andrew Cagney <cagney@redhat.com>
+
+ * gdb_assert.h (gdb_assert_fail): Provide different definitions
+ dependant on the availability of ASSERT_FUNCTION.
+ (ASSERT_FUNCTION): Do not define when there is no function name.
+
2003-05-29 Kevin Buettner <kevinb@redhat.com>
From Jimi X <jimix@watson.ibm.com>:
diff --git a/gdb/gdb_assert.h b/gdb/gdb_assert.h
index 4f0bcdc..9cad74c 100644
--- a/gdb/gdb_assert.h
+++ b/gdb/gdb_assert.h
@@ -40,16 +40,19 @@
#else
#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
#define ASSERT_FUNCTION __func__
-#else
-#define ASSERT_FUNCTION ((const char *) 0)
#endif
#endif
/* This prints an "Assertion failed" message, aksing the user if they
want to continue, dump core, or just exit. */
+#if defined (ASSERT_FUNCTION)
+#define gdb_assert_fail(assertion, file, line, function) \
+ internal_error (file, line, "%s: Assertion `%s' failed.", \
+ function, assertion)
+#else
#define gdb_assert_fail(assertion, file, line, function) \
- internal_error (file, line, "%s%sAssertion `%s' failed.", \
- function ? function : "", function ? ": " : "", \
+ internal_error (file, line, "Assertion `%s' failed.", \
assertion)
+#endif
#endif /* gdb_assert.h */