]> https://gitweb.dealii.org/ - dealii.git/commitdiff
AssertNothrow: use DEAL_II_BUILTIN_EXPECT() to remove some definitions.
authorDavid Wells <drwells@email.unc.edu>
Thu, 29 May 2025 14:55:25 +0000 (10:55 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 29 May 2025 15:14:57 +0000 (11:14 -0400)
include/deal.II/base/exception_macros.h

index 174c8d2ac2f5c127ead1181dafdc80532ff2d818..06f11a80dbf226810a469539f8decd812b14e630 100644 (file)
  * @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                             \

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.