0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-16 15:00:51 +01:00

ircd::portable: Remove fenced assert for GCC due to error when used in constexprs.

This commit is contained in:
Jason Volk 2020-06-09 00:34:09 -07:00
parent 2f1523ffb2
commit 37734e1260

View file

@ -68,14 +68,22 @@ namespace ircd
///TODO: XXX hoist lfence out of unlikely target block
#if defined(RB_ASSERT) && defined(RB_ASSERT_INTRINSIC) && !defined(NDEBUG) && defined(__SSE2__)
#undef assert
#define assert(expr) \
({ \
if(unlikely(!static_cast<bool>(expr))) \
{ \
asm volatile ("lfence"); \
__assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \
} \
})
#ifdef __clang__
#define assert(expr) \
({ \
if(unlikely(!static_cast<bool>(expr))) \
{ \
asm volatile ("lfence"); \
__assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \
} \
})
#else
#define assert(expr) \
({ \
if(unlikely(!static_cast<bool>(expr))) \
__assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \
})
#endif
#endif
//