Merge branch 'backport-1420-gmacros-cpp-glib-2-64' into 'glib-2-64'

Backport !1420 “gmacros.h: avoid using _Static_assert in C++17 mode” to glib-2-64

See merge request GNOME/glib!1421
This commit is contained in:
Simon McVittie 2020-03-18 10:23:08 +00:00
commit 9d46d9d457

View File

@ -734,7 +734,7 @@
#ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */ #ifndef __GI_SCANNER__ /* The static assert macro really confuses the introspection parser */
#define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2 #define G_PASTE_ARGS(identifier1,identifier2) identifier1 ## identifier2
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2) #define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L #if !defined(__cplusplus) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false") #define G_STATIC_ASSERT(expr) _Static_assert (expr, "Expression evaluates to false")
#elif (defined(__cplusplus) && __cplusplus >= 201103L) || \ #elif (defined(__cplusplus) && __cplusplus >= 201103L) || \
(defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \ (defined(__cplusplus) && defined (_MSC_VER) && (_MSC_VER >= 1600)) || \