Fri Apr 17 15:22:35 2020 UTC ()
Remove the static_assert() fallback for pre-C11 and pre-C++11

C++ without real static_assert() can be incompatible with the C fallback
as presented in openjdk.

A pre-C11 compiler can be picky on the implementation.


(kamil)
diff -r1.24 -r1.25 src/include/assert.h

cvs diff -r1.24 -r1.25 src/include/assert.h (expand / switch to unified diff)

--- src/include/assert.h 2019/05/27 07:31:11 1.24
+++ src/include/assert.h 2020/04/17 15:22:34 1.25
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: assert.h,v 1.24 2019/05/27 07:31:11 kamil Exp $ */ 1/* $NetBSD: assert.h,v 1.25 2020/04/17 15:22:34 kamil Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -95,20 +95,18 @@ @@ -95,20 +95,18 @@
95#define __assert_function__ (__static_cast(const void *,0)) 95#define __assert_function__ (__static_cast(const void *,0))
96#endif 96#endif
97 97
98#ifndef __ASSERT_DECLARED 98#ifndef __ASSERT_DECLARED
99#define __ASSERT_DECLARED 99#define __ASSERT_DECLARED
100__BEGIN_DECLS 100__BEGIN_DECLS
101__dead void __assert(const char *, int, const char *); 101__dead void __assert(const char *, int, const char *);
102__dead void __assert13(const char *, int, const char *, const char *); 102__dead void __assert13(const char *, int, const char *, const char *);
103void __diagassert(const char *, int, const char *); 103void __diagassert(const char *, int, const char *);
104void __diagassert13(const char *, int, const char *, const char *); 104void __diagassert13(const char *, int, const char *, const char *);
105__END_DECLS 105__END_DECLS
106#endif /* __ASSERT_DECLARED */ 106#endif /* __ASSERT_DECLARED */
107 107
108#ifndef static_assert 
109#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L 108#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L
 109#ifndef static_assert
110#define static_assert _Static_assert 110#define static_assert _Static_assert
111#elif defined(_NETBSD_SOURCE) && (__cplusplus - 0) < 201103L 
112#define static_assert(x, y) __CTASSERT(x) 
113#endif /* static_assert */ 111#endif /* static_assert */
114#endif 112#endif