From e6ca27ac2fe6fb97ff192d8d5abf923e59611406 Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Thu, 22 Feb 2024 10:32:37 +0900 Subject: [PATCH] Revert "assert: When defining NDEBUG, do not use macro parameters" This reverts commit 3b6e7c1927e0eeb47f57b34de6f3056d4d11087b. --- include/assert.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/assert.h b/include/assert.h index be3ec5c588..89d550a600 100644 --- a/include/assert.h +++ b/include/assert.h @@ -96,7 +96,7 @@ # define DEBUGVERIFY(f) _VERIFY(f, __DEBUG_ASSERT_FILE__, __DEBUG_ASSERT_LINE__) #else # define DEBUGPANIC() -# define DEBUGASSERT(f) ((void)(0)) +# define DEBUGASSERT(f) ((void)(1 || (f))) # define DEBUGVERIFY(f) ((void)(f)) #endif @@ -106,7 +106,7 @@ */ #ifdef NDEBUG -# define assert(f) ((void)(0)) +# define assert(f) ((void)(1 || (f))) # define VERIFY(f) assert(f) #else # define assert(f) _ASSERT(f, __ASSERT_FILE__, __ASSERT_LINE__)