Brendan Shanks : include: Implement C_ASSERT() using the C11 _Static_assert() if available.
Module: wine Branch: master Commit: 820a9d0d6ca3e406c7adb522773feb50d374ae1a URL: https://gitlab.winehq.org/wine/wine/-/commit/820a9d0d6ca3e406c7adb522773feb5... Author: Brendan Shanks <bshanks(a)codeweavers.com> Date: Mon May 8 12:58:07 2023 -0700 include: Implement C_ASSERT() using the C11 _Static_assert() if available. --- include/winnt.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/winnt.h b/include/winnt.h index 01a14de972b..64408126cba 100644 --- a/include/winnt.h +++ b/include/winnt.h @@ -417,7 +417,11 @@ extern "C" { /* Compile time assertion */ +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) +#define C_ASSERT(e) _Static_assert(e, #e) +#else #define C_ASSERT(e) extern void __C_ASSERT__(int [(e)?1:-1]) +#endif /* Eliminate Microsoft C/C++ compiler warning 4715 */ #if defined(_MSC_VER) && (_MSC_VER > 1200)
participants (1)
-
Alexandre Julliard