From 94e94f02b68665bd5c1d5addb3daa851ee99cc2b Mon Sep 17 00:00:00 2001 From: Patrick Wuttke Date: Mon, 23 Jun 2025 00:21:24 +0200 Subject: [PATCH] Modified assertion macros so they evaluate to an empty instruction instead of nothing in non-debug builds. --- source/mijin/debug/assert.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/mijin/debug/assert.hpp b/source/mijin/debug/assert.hpp index efc5263..a422398 100644 --- a/source/mijin/debug/assert.hpp +++ b/source/mijin/debug/assert.hpp @@ -45,7 +45,7 @@ namespace mijin #if MIJIN_DEBUG -#define MIJIN_RAISE_ERROR(msg, source_loc) \ +#define MIJIN_RAISE_ERROR(msg, source_loc) \ switch (mijin::handleError(msg, source_loc)) \ { \ case mijin::ErrorHandling::CONTINUE: \ @@ -99,10 +99,10 @@ if (!static_cast(condition)) \ MIJIN_FATAL("Debug assertion failed: " #condition "\nMessage: " msg); \ } #else // MIJIN_DEBUG -#define MIJIN_ERROR(...) +#define MIJIN_ERROR(...) ((void)0) #define MIJIN_FATAL(...) std::abort() -#define MIJIN_ASSERT(...) -#define MIJIN_ASSERT_FATAL(...) +#define MIJIN_ASSERT(...) ((void)0) +#define MIJIN_ASSERT_FATAL(...) ((void)0) #endif // !MIJIN_DEBUG //