summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authormaya <maya@NetBSD.org>2019-05-22 21:25:01 +0000
committermaya <maya@NetBSD.org>2019-05-22 21:25:01 +0000
commit39ea17a8cf41a9693252c4386aace5281478e0d1 (patch)
treebc2a4516c391177c0a79889dc8774ce64c239ba7 /include
parent0dc53c75a0a3a12d1f86547a67c462069f495095 (diff)
Limit static_assert visibility to C11.
The existing definition caused issues as GCC only provides _Static_assert when building C11 code. This follows the C standard: static_assert available since C11. Fixes https://rt.perl.org/Public/Bug/Display.html?id=134023
Diffstat (limited to 'include')
-rw-r--r--include/assert.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/assert.h b/include/assert.h
index e74dfad5908..fba62a017f8 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -1,4 +1,4 @@
-/* $NetBSD: assert.h,v 1.22 2016/10/03 12:08:39 kamil Exp $ */
+/* $NetBSD: assert.h,v 1.23 2019/05/22 21:25:01 maya Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -105,7 +105,7 @@ void __diagassert13(const char *, int, const char *, const char *);
__END_DECLS
#endif /* __ASSERT_DECLARED */
-#if ((__cplusplus - 0) < 201103L)
+#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
#ifndef static_assert
#define static_assert _Static_assert
#endif /* static_assert */