2003-05-29 Andrew Cagney <cagney@redhat.com>
authorAndrew Cagney <cagney@redhat.com>
Thu, 29 May 2003 21:22:45 +0000 (21:22 +0000)
committerAndrew Cagney <cagney@redhat.com>
Thu, 29 May 2003 21:22:45 +0000 (21:22 +0000)
* 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.

gdb/ChangeLog
gdb/gdb_assert.h

index 01e45f333661a2725cfd22c3eb8da96389c22736..0a810e96e1d0a30c52469e8e592539d61a4a1778 100644 (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>:
index 4f0bcdc94978550e983454b34a048e41777cb6e1..9cad74c9cbc81ff7736792d59fffe93fc6f5c04f 100644 (file)
 #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 */