From c5065e3b4c73b8041acb7b958bdc47b73364af6b Mon Sep 17 00:00:00 2001 From: David Wells Date: Thu, 29 May 2025 10:55:25 -0400 Subject: [PATCH] AssertNothrow: use DEAL_II_BUILTIN_EXPECT() to remove some definitions. --- include/deal.II/base/exception_macros.h | 27 ++++++++----------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/include/deal.II/base/exception_macros.h b/include/deal.II/base/exception_macros.h index 174c8d2ac2..06f11a80db 100644 --- a/include/deal.II/base/exception_macros.h +++ b/include/deal.II/base/exception_macros.h @@ -606,25 +606,14 @@ * @ingroup Exceptions */ #ifdef DEBUG -# ifdef DEAL_II_HAVE_BUILTIN_EXPECT -# define AssertNothrow(cond, exc) \ - do \ - { \ - if (__builtin_expect(!(cond), false)) \ - ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ - } \ - while (false) -# else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ -# define AssertNothrow(cond, exc) \ - do \ - { \ - if (!(cond)) \ - ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ - } \ - while (false) -# endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ +# define AssertNothrow(cond, exc) \ + do \ + { \ + if (DEAL_II_BUILTIN_EXPECT(!(cond), false)) \ + ::dealii::deal_II_exceptions::internals::issue_error_nothrow( \ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ + } \ + while (false) #else # define AssertNothrow(cond, exc) \ do \ -- 2.39.5