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.
This commit is contained in:
Andrew Cagney 2003-05-29 21:22:45 +00:00
parent 98f08d3d9b
commit 93ec1121ed
2 changed files with 13 additions and 4 deletions

View File

@ -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>:

View File

@ -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%sAssertion `%s' failed.", \
function ? function : "", function ? ": " : "", \
internal_error (file, line, "%s: Assertion `%s' failed.", \
function, assertion)
#else
#define gdb_assert_fail(assertion, file, line, function) \
internal_error (file, line, "Assertion `%s' failed.", \
assertion)
#endif
#endif /* gdb_assert.h */