From: David Wells Date: Thu, 29 May 2025 14:55:25 +0000 (-0400) Subject: AssertNothrow: use DEAL_II_BUILTIN_EXPECT() to remove some definitions. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c5065e3b4c73b8041acb7b958bdc47b73364af6b;p=dealii.git AssertNothrow: use DEAL_II_BUILTIN_EXPECT() to remove some definitions. --- 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 \