From 6ca0f144fa7989cb77ad7d2c2c7b43c22e2eab71 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Sun, 30 Aug 2020 15:11:36 +0300 Subject: [PATCH] mdbx: workaround for MSVC 19.27 static_assert() bug. Change-Id: Ia143795a57e800bc39e126cd90f34a6abde81ca3 --- src/defs.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/defs.h b/src/defs.h index 5c122829..21b69ead 100644 --- a/src/defs.h +++ b/src/defs.h @@ -358,14 +358,16 @@ #define FIXME "FIXME: " __FILE__ ", " STRINGIFY(__LINE__) #ifndef STATIC_ASSERT_MSG -# if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ - || __has_feature(c_static_assert) -# define STATIC_ASSERT_MSG(expr, msg) _Static_assert(expr, msg) -# elif defined(static_assert) +# if defined(static_assert) # define STATIC_ASSERT_MSG(expr, msg) static_assert(expr, msg) +# elif defined(_STATIC_ASSERT) +# define STATIC_ASSERT_MSG(expr, msg) _STATIC_ASSERT(expr) # elif defined(_MSC_VER) # include # define STATIC_ASSERT_MSG(expr, msg) _STATIC_ASSERT(expr) +# elif (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \ + || __has_feature(c_static_assert) +# define STATIC_ASSERT_MSG(expr, msg) _Static_assert(expr, msg) # else # define STATIC_ASSERT_MSG(expr, msg) switch (0) {case 0:case (expr):;} # endif