From 37734e1260b42bc6a573171e49ac34ef36aa5d76 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Tue, 9 Jun 2020 00:34:09 -0700 Subject: [PATCH] ircd::portable: Remove fenced assert for GCC due to error when used in constexprs. --- include/ircd/portable.h | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/ircd/portable.h b/include/ircd/portable.h index 88c57288a..46cb7f09f 100644 --- a/include/ircd/portable.h +++ b/include/ircd/portable.h @@ -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(expr))) \ - { \ - asm volatile ("lfence"); \ - __assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \ - } \ - }) + #ifdef __clang__ + #define assert(expr) \ + ({ \ + if(unlikely(!static_cast(expr))) \ + { \ + asm volatile ("lfence"); \ + __assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \ + } \ + }) + #else + #define assert(expr) \ + ({ \ + if(unlikely(!static_cast(expr))) \ + __assert_fail(#expr, __FILE__, __LINE__, __FUNCTION__); \ + }) + #endif #endif //