diff options
author | Haru <haru@dotalux.com> | 2016-11-01 19:36:15 +0100 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-12-03 15:38:54 +0100 |
commit | 9ac2545d66e630cce6a718a7c6f374fbecb00e96 (patch) | |
tree | f072dd57252447eee4d7d49a25692a0cd80350c1 /src/char/mapif.c | |
parent | 17420ee563282ba1791a77c55ede9d8f5f504ae5 (diff) | |
download | hercules-9ac2545d66e630cce6a718a7c6f374fbecb00e96.tar.gz hercules-9ac2545d66e630cce6a718a7c6f374fbecb00e96.tar.bz2 hercules-9ac2545d66e630cce6a718a7c6f374fbecb00e96.tar.xz hercules-9ac2545d66e630cce6a718a7c6f374fbecb00e96.zip |
Add support for static assertions (on compilers that support them)
This introduces the macro `STATIC_ASSERT(ex, msg)`, that works like its
C11 counterpart `_Static_assert(ex, msg)`, on compilers that support it.
Support is provided, depending on the compiler:
- When in C11 mode, use the native `_Static_assert`
- If the compiler advertises having the `c_static_assert` feature, use
`_Static_assert` (according to the clang documentation).
- If the compiler is GCC >= 4.7 (tested to be compatible), use
`_Static_assert` (nonstandard extension, C11 feature available in C99).
- If the compiler is MSVC (all the currently supported versions have
been tested to be compatible), then use `static_assert` (nonstandard
extension, C++ feature)
- Otherwise, define it as a no-op macro.
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/mapif.c')
0 files changed, 0 insertions, 0 deletions