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:
parent
2f1523ffb2
commit
37734e1260
1 changed files with 16 additions and 8 deletions
|
@ -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
|
||||
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue