mdbx: add STATIC_ASSERT.

This commit is contained in:
Leo Yuriev 2017-05-24 18:42:13 +03:00
parent 96b9af0b4d
commit 7ef7e70012

View File

@ -368,5 +368,15 @@
#define FIXME "FIXME: " __FILE__ ", " STRINGIFY(__LINE__)
#ifndef STATIC_ASSERT
# if __STDC_VERSION__ >= 201112L
# define STATIC_ASSERT(expr, msg) _Static_assert(expr, msg)
# elif defined(static_assert)
# define STATIC_ASSERT(expr, msg) static_assert(expr, msg)
# else
# define STATIC_ASSERT(expr, msg) switch (0) {case 0:case (expr):;}
# endif
#endif /* STATIC_ASSERT */
/* *INDENT-ON* */
/* clang-format on */