mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-20 06:08:21 +08:00
mdbx: add STATIC_ASSERT.
This commit is contained in:
parent
96b9af0b4d
commit
7ef7e70012
10
src/defs.h
10
src/defs.h
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user