mdbx: workaround for MSVC 19.27 static_assert() bug.

Change-Id: Ia143795a57e800bc39e126cd90f34a6abde81ca3
This commit is contained in:
Leonid Yuriev 2020-08-30 15:11:36 +03:00
parent bf31cca375
commit 362df3a031

View File

@ -355,14 +355,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 <crtdbg.h>
# 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