Source-Changes-HG archive

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

[src/trunk]: src/include As a _NETBSD_SOURCE extension define static_assert f...



details:   https://anonhg.NetBSD.org/src/rev/7e20fa1d7827
branches:  trunk
changeset: 841655:7e20fa1d7827
user:      kamil <kamil%NetBSD.org@localhost>
date:      Mon May 27 07:31:11 2019 +0000

description:
As a _NETBSD_SOURCE extension define static_assert for pre-c11/c++99

Proposed on source-changes-d.

diffstat:

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

diffs (21 lines):

diff -r a461b0668235 -r 7e20fa1d7827 include/assert.h
--- a/include/assert.h  Mon May 27 05:33:48 2019 +0000
+++ b/include/assert.h  Mon May 27 07:31:11 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: assert.h,v 1.23 2019/05/22 21:25:01 maya Exp $ */
+/*     $NetBSD: assert.h,v 1.24 2019/05/27 07:31:11 kamil Exp $        */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -105,8 +105,10 @@
 __END_DECLS
 #endif /* __ASSERT_DECLARED */
 
+#ifndef static_assert
 #if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
-#ifndef static_assert
 #define static_assert _Static_assert
+#elif defined(_NETBSD_SOURCE) && (__cplusplus - 0) < 201103L
+#define static_assert(x, y) __CTASSERT(x)
 #endif /* static_assert */
 #endif



Home | Main Index | Thread Index | Old Index