From fbdac8d61eeea9123c9c550e2a9088ec260151d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Thu, 21 Nov 2024 19:31:40 +0100 Subject: [PATCH] headers: Don't define static_assert for C23 and C++ Change-Id: I1e67b09b2a310de5cf41c4eef9af46f78b4e9de0 Reviewed-on: https://review.haiku-os.org/c/haiku/+/8586 Reviewed-by: waddlesplash --- headers/posix/assert.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/headers/posix/assert.h b/headers/posix/assert.h index 0f7bb74548..bf3df7f603 100644 --- a/headers/posix/assert.h +++ b/headers/posix/assert.h @@ -52,6 +52,7 @@ extern void __assert_perror_fail(int error, const char *file, # define assert(condition) ((void)0) #endif -#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && !defined(static_assert) +#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L && __STDC_VERSION__ <= 201710L \ + && !defined(static_assert) && !defined(__cplusplus) # define static_assert _Static_assert #endif