From: David Wells Date: Thu, 29 May 2025 14:57:36 +0000 (-0400) Subject: AssertThrow: use DEAL_II_BUILTIN_EXPECT() to remove some definitions. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3e40b280905449bd5b23b4716a83487c0cca6461;p=dealii.git AssertThrow: 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 06f11a80db..2e958bb583 100644 --- a/include/deal.II/base/exception_macros.h +++ b/include/deal.II/base/exception_macros.h @@ -653,39 +653,21 @@ * @note Active in both DEBUG and RELEASE modes * @ingroup Exceptions */ -#ifdef DEAL_II_HAVE_BUILTIN_EXPECT -# define AssertThrow(cond, exc) \ - do \ - { \ - if (__builtin_expect(!(cond), false)) \ - ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \ - ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \ - throw_on_exception, \ - __FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, \ - #cond, \ - #exc, \ - exc); \ - } \ - while (false) -#else /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ -# define AssertThrow(cond, exc) \ - do \ - { \ - if (!(cond)) \ - ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \ - ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \ - throw_on_exception, \ - __FILE__, \ - __LINE__, \ - __PRETTY_FUNCTION__, \ - #cond, \ - #exc, \ - exc); \ - } \ - while (false) -#endif /*ifdef DEAL_II_HAVE_BUILTIN_EXPECT*/ +#define AssertThrow(cond, exc) \ + do \ + { \ + if (DEAL_II_BUILTIN_EXPECT(!(cond), false)) \ + ::dealii::deal_II_exceptions::internals::issue_error_noreturn( \ + ::dealii::deal_II_exceptions::internals::ExceptionHandling:: \ + throw_on_exception, \ + __FILE__, \ + __LINE__, \ + __PRETTY_FUNCTION__, \ + #cond, \ + #exc, \ + exc); \ + } \ + while (false) /**