mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-26 23:46:15 +01:00
gmacros.h: Use _Static_assert for clang
It appears that CLang supports _Static_assert() even when not in C11 mode, since at least CLang 3.1, so let's just use that for CLang builds. Fixes issue #2338.
This commit is contained in:
parent
97959cd7eb
commit
7b76995298
@ -754,7 +754,7 @@
|
||||
#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
|
||||
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
|
||||
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
|
||||
#if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
|
||||
#if !defined(__cplusplus) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L || defined(__clang__))
|
||||
#define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
|
||||
#elif (defined(__cplusplus) && __cplusplus >= 201103L) || \
|
||||
(defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \
|
||||
|
Loading…
Reference in New Issue
Block a user