Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/include Limit static_assert visibility to C11.



details:   https://anonhg.NetBSD.org/src/rev/4f2ae84539d5
branches:  trunk
changeset: 451434:4f2ae84539d5
user:      maya <maya%NetBSD.org@localhost>
date:      Wed May 22 21:25:01 2019 +0000

description:
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:

 include/assert.h |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r 8e5fef4164ac -r 4f2ae84539d5 include/assert.h
--- a/include/assert.h  Wed May 22 17:27:41 2019 +0000
+++ b/include/assert.h  Wed May 22 21:25:01 2019 +0000
@@ -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 @@
 __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 */



Home | Main Index | Thread Index | Old Index