mirror of
https://github.com/isar/libmdbx.git
synced 2025-04-09 17:47:45 +08:00
mdbx: workaround for MSVC 19.27 static_assert() bug.
Change-Id: Ia143795a57e800bc39e126cd90f34a6abde81ca3
This commit is contained in:
parent
eca3904dfa
commit
6ca0f144fa
10
src/defs.h
10
src/defs.h
@ -358,14 +358,16 @@
|
|||||||
#define FIXME "FIXME: " __FILE__ ", " STRINGIFY(__LINE__)
|
#define FIXME "FIXME: " __FILE__ ", " STRINGIFY(__LINE__)
|
||||||
|
|
||||||
#ifndef STATIC_ASSERT_MSG
|
#ifndef STATIC_ASSERT_MSG
|
||||||
# if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) \
|
# if defined(static_assert)
|
||||||
|| __has_feature(c_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, msg)
|
# 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)
|
# elif defined(_MSC_VER)
|
||||||
# include <crtdbg.h>
|
# include <crtdbg.h>
|
||||||
# define STATIC_ASSERT_MSG(expr, msg) _STATIC_ASSERT(expr)
|
# 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
|
# else
|
||||||
# define STATIC_ASSERT_MSG(expr, msg) switch (0) {case 0:case (expr):;}
|
# define STATIC_ASSERT_MSG(expr, msg) switch (0) {case 0:case (expr):;}
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user