Skip to content
Snippets Groups Projects
Commit 54622fb1 authored by Ben Gamari's avatar Ben Gamari
Browse files

rts: Use C11-compliant static assertion syntax

Previously we used `static_assert` which is only available in C23. By
contrast, C11 only provides `_Static_assert`.

Fixes #22777
parent fc02f3bb
No related merge requests found
......@@ -167,7 +167,10 @@ void _warnFail(const char *filename, unsigned int linenum);
#endif /* DEBUG */
#if __STDC_VERSION__ >= 201112L
#define GHC_STATIC_ASSERT(x, msg) static_assert((x), msg)
// `_Static_assert` is provided by C11 but is deprecated and replaced by
// `static_assert` in C23. Perhaps some day we should instead use the latter.
// See #22777.
#define GHC_STATIC_ASSERT(x, msg) _Static_assert((x), msg)
#else
#define GHC_STATIC_ASSERT(x, msg)
#endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment