diff options
| author | kamil <kamil@NetBSD.org> | 2019-05-27 07:31:11 +0000 |
|---|---|---|
| committer | kamil <kamil@NetBSD.org> | 2019-05-27 07:31:11 +0000 |
| commit | 8901322028565d01c7cecb95478aeb03ab311bb4 (patch) | |
| tree | 6759f8370191a43ccd101060c89ce6fa2361be65 /include/assert.h | |
| parent | 9a5e4539e5e83a371571049a8e619961d5575d79 (diff) | |
As a _NETBSD_SOURCE extension define static_assert for pre-c11/c++99
Proposed on source-changes-d.
Diffstat (limited to 'include/assert.h')
| -rw-r--r-- | include/assert.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/assert.h b/include/assert.h index fba62a017f8..f3f39b5f104 100644 --- a/include/assert.h +++ b/include/assert.h @@ -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 @@ void __diagassert13(const char *, int, const char *, const char *); __END_DECLS #endif /* __ASSERT_DECLARED */ -#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L #ifndef static_assert +#if defined(_ISOC11_SOURCE) || (__STDC_VERSION__ - 0) >= 201101L #define static_assert _Static_assert +#elif defined(_NETBSD_SOURCE) && (__cplusplus - 0) < 201103L +#define static_assert(x, y) __CTASSERT(x) #endif /* static_assert */ #endif |
