0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-28 11:48:54 +02:00

ircd::assert: Deconflict extern keyword duality for clang.

This commit is contained in:
Jason Volk 2020-02-01 17:20:50 -08:00
parent dc8193a523
commit e241ab9e51

View file

@ -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.
///