summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--internal.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/internal.h b/internal.h
index f3ba39f2d1..8d92d9510a 100644
--- a/internal.h
+++ b/internal.h
@@ -79,8 +79,10 @@ extern "C" {
# define __has_extension __has_feature
#endif
-#if GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
+#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
# define STATIC_ASSERT(name, expr) _Static_assert(expr, #name ": " #expr)
+#elif GCC_VERSION_SINCE(4, 6, 0) || __has_extension(c_static_assert)
+# define STATIC_ASSERT(name, expr) RB_GNUC_EXTENSION _Static_assert(expr, #name ": " #expr)
#else
# define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]
#endif