mirror of
https://github.com/matrix-construct/construct
synced 2025-01-13 08:23:56 +01:00
ircd::assert: Deconflict extern keyword duality for clang.
This commit is contained in:
parent
dc8193a523
commit
e241ab9e51
1 changed files with 19 additions and 16 deletions
|
@ -39,22 +39,6 @@ namespace ircd
|
|||
void print_assertion(const char *const &, const char *const &, const unsigned &, const char *const &) noexcept;
|
||||
}
|
||||
|
||||
/// Override the standard assert behavior, if enabled, to trap into the
|
||||
/// debugger as close as possible to the offending site.
|
||||
///
|
||||
#if defined(IRCD_ASSERT_OVERRIDE) && defined(RB_ASSERT_INTRINSIC)
|
||||
extern "C" inline void
|
||||
__attribute__((flatten, always_inline, gnu_inline, artificial))
|
||||
__assert_fail(const char *__assertion,
|
||||
const char *__file,
|
||||
unsigned int __line,
|
||||
const char *__function)
|
||||
{
|
||||
ircd::print_assertion(__assertion, __file, __line, __function);
|
||||
ircd::debugtrap();
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Override the standard assert behavior to take one of several different
|
||||
/// actions as defined in our internal assert.cc unit. When trapping assert
|
||||
/// is disabled this path will be used instead.
|
||||
|
@ -68,6 +52,25 @@ __assert_fail(const char *__assertion,
|
|||
const char *__function);
|
||||
#endif
|
||||
|
||||
/// Override the standard assert behavior, if enabled, to trap into the
|
||||
/// debugger as close as possible to the offending site.
|
||||
///
|
||||
#if defined(IRCD_ASSERT_OVERRIDE) && defined(RB_ASSERT_INTRINSIC)
|
||||
extern "C" // for clang
|
||||
{
|
||||
extern inline void
|
||||
__attribute__((flatten, always_inline, gnu_inline, artificial))
|
||||
__assert_fail(const char *__assertion,
|
||||
const char *__file,
|
||||
unsigned int __line,
|
||||
const char *__function)
|
||||
{
|
||||
ircd::print_assertion(__assertion, __file, __line, __function);
|
||||
ircd::debugtrap();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/// Intrinsic to halt execution for examination by a tracing debugger without
|
||||
/// aborting the program.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue