From 26eaab705dd20134ec79be345fee1703c5959de1 Mon Sep 17 00:00:00 2001 From: Brian Smith Date: Sat, 18 May 2024 16:07:39 -0700 Subject: [PATCH] debug_assert_nonsecret: Prefer assert.h if compiler says it is available. --- include/ring-core/check.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/include/ring-core/check.h b/include/ring-core/check.h index 08cbff3e53..3a025d7e46 100644 --- a/include/ring-core/check.h +++ b/include/ring-core/check.h @@ -32,6 +32,13 @@ # else # define debug_assert_nonsecret(x) ((void)0) # endif +# if defined(__has_include) +# if __has_include() +# include +# undef debug_assert_nonsecret +# define debug_assert_nonsecret(x) assert(x) +# endif +# endif #endif // |dev_assert_secret| is like |assert| and should be used (only) when the