Use __STDC_VERSION__ instead of __ISO_C_VISIBLE to guard _Static_assert.

We need to test what the compiler supports, not what the C library
provides.  This prevents static_assert from being defined when compiling
with the in-tree gcc (4.2.1) which does not support _Static_assert.
This commit is contained in:
millert 2020-09-06 12:57:25 +00:00
parent 8aed45653f
commit 9f1f2f9e44
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,4 @@
/* $OpenBSD: assert.h,v 1.14 2020/09/05 10:41:31 bentley Exp $ */
/* $OpenBSD: assert.h,v 1.15 2020/09/06 12:57:25 millert Exp $ */
/* $NetBSD: assert.h,v 1.6 1994/10/26 00:55:44 cgd Exp $ */
/*-
@ -62,7 +62,7 @@
#ifndef _ASSERT_H_
#define _ASSERT_H_
#if __ISO_C_VISIBLE >= 2011 && !defined(__cplusplus)
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112
#define static_assert _Static_assert
#endif