/* A copy of mach_host_self (). */
extern mach_port_t darwin_host_self;
-/* FUNCTION_NAME is defined in common-utils.h (or not). */
-#ifdef FUNCTION_NAME
#define MACH_CHECK_ERROR(ret) \
- mach_check_error (ret, __FILE__, __LINE__, FUNCTION_NAME)
-#else
-#define MACH_CHECK_ERROR(ret) \
- mach_check_error (ret, __FILE__, __LINE__, "??")
-#endif
+ mach_check_error (ret, __FILE__, __LINE__, __func__)
extern void mach_check_error (kern_return_t ret, const char *file,
unsigned int line, const char *func);
#include <vector>
#include "gdbsupport/byte-vector.h"
#include "gdbsupport/gdb_unique_ptr.h"
-
#include "poison.h"
-
-/* If possible, define FUNCTION_NAME, a macro containing the name of
- the function being defined. Since this macro may not always be
- defined, all uses must be protected by appropriate macro definition
- checks (Eg: "#ifdef FUNCTION_NAME").
-
- Version 2.4 and later of GCC define a magical variable `__PRETTY_FUNCTION__'
- which contains the name of the function currently being defined.
- This is broken in G++ before version 2.6.
- C9x has a similar variable called __func__, but prefer the GCC one since
- it demangles C++ function names. */
-#if (GCC_VERSION >= 2004)
-#define FUNCTION_NAME __PRETTY_FUNCTION__
-#else
-#if defined __STDC_VERSION__ && __STDC_VERSION__ >= 199901L
-#define FUNCTION_NAME __func__ /* ARI: func */
-#endif
-#endif
-
#include "gdb_string_view.h"
/* xmalloc(), xrealloc() and xcalloc() have already been declared in
#define gdb_assert(expr) \
((void) ((expr) ? 0 : \
- (gdb_assert_fail (#expr, __FILE__, __LINE__, FUNCTION_NAME), 0)))
+ (gdb_assert_fail (#expr, __FILE__, __LINE__, __func__), 0)))
/* This prints an "Assertion failed" message, asking the user if they
want to continue, dump core, or just exit. */
-#if defined (FUNCTION_NAME)
#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, _("Assertion `%s' failed."), \
- assertion)
-#endif
/* The canonical form of gdb_assert (0).
MESSAGE is a string to include in the error message. */
-#if defined (FUNCTION_NAME)
-#define gdb_assert_not_reached(message) \
- internal_error (__FILE__, __LINE__, "%s: %s", FUNCTION_NAME, _(message))
-#else
#define gdb_assert_not_reached(message) \
- internal_error (__FILE__, __LINE__, _(message))
-#endif
+ internal_error (__FILE__, __LINE__, "%s: %s", __func__, _(message))
#endif /* COMMON_GDB_ASSERT_H */