Update M_ASSERT to separate requirement for predicate

This commit is contained in:
Patrick Pelissier committed 2023-03-18 09:15:11 +01:00
1 parent c8354aa6ed
commit d1094999f5
1 file changed
+4 -2
+4 -2
View File
@@ -80,9 +80,11 @@
# define M_ASSUME(x) M_ASSERT(x)
#elif defined(__GNUC__) \
&& (__GNUC__ * 100 + __GNUC_MINOR__) >= 408
/* We test that the argument can properly be converted into a constant expression */
# define M_ASSUME(x) \
(! __builtin_constant_p (!!(x) || !(x)) || (x) ? \
(void) 0 : __builtin_unreachable())
(M_STATIC_ASSERT( __builtin_constant_p (!!(x) || !(x)), \
M_LIB_NOT_A_CONSTANT, "Argument doesn't evaluate to a constant: " M_ASTR(x) ), \
(x) ? (void) 0 : __builtin_unreachable())
#elif defined(_MSC_VER)
# define M_ASSUME(x) __assume(x)
#else