summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilip Withnall <philip@tecnocode.co.uk>2019-07-02 10:13:19 +0000
committerPhilip Withnall <philip@tecnocode.co.uk>2019-07-02 10:13:19 +0000
commit01bc57576be19bf5718453f9130e01eae575cd10 (patch)
treece857a78b3de4ab070523755607adb348c584c8d
parenta656555f76f1b5666d1210e4a6a02b1f3d619aec (diff)
parent7b91440ca48ab1e06920299a205359a5668398ef (diff)
downloadglib-01bc57576be19bf5718453f9130e01eae575cd10.tar.gz
Merge branch 'msvc-static-assert' into 'master'
gmacros.h: Use static_assert on MSVC if possible See merge request GNOME/glib!964
-rw-r--r--glib/gmacros.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/glib/gmacros.h b/glib/gmacros.h
index fd81416dd..2764d9552 100644
--- a/glib/gmacros.h
+++ b/glib/gmacros.h
@@ -736,7 +736,9 @@
#define G_PASTE(identifier1,identifier2) G_PASTE_ARGS (identifier1, identifier2)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
#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 (_MSC_VER) && (_MSC_VER >= 1800))
#define G_STATIC_ASSERT(expr) static_assert (expr, "Expression evaluates to false")
#else
#ifdef __COUNTER__