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/38657aa15b1b
branches:  trunk
changeset: 841549:38657aa15b1b
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 352e28eeb671 -r 38657aa15b1b 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