From bcd4b5a2355d74385f3fd7e613418dce7f42a857 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucca=20Jim=C3=A9nez=20K=C3=B6nings?= Date: Wed, 15 May 2024 12:54:50 +0200 Subject: [PATCH] Fix Debug asserts on FreeBSD MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lucca Jiménez Könings --- include/CustomAssert.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/include/CustomAssert.h b/include/CustomAssert.h index 71094e6..d45a8c1 100644 --- a/include/CustomAssert.h +++ b/include/CustomAssert.h @@ -32,6 +32,7 @@ #include #include "Common.h" +#include "Compat.h" static const char* const ANSI_RESET = "\u001b[0m"; @@ -56,7 +57,7 @@ static const char* const ANSI_WHITE_BOLD = "\u001b[37;1m"; static const char* const ANSI_BOLD = "\u001b[1m"; static const char* const ANSI_UNDERLINE = "\u001b[4m"; -#ifdef DEBUG +#if defined(DEBUG) && !defined(BEAMMP_FREEBSD) #include inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const char* function, [[maybe_unused]] unsigned line, [[maybe_unused]] const char* condition_string, [[maybe_unused]] bool result) { @@ -81,8 +82,8 @@ inline void _assert([[maybe_unused]] const char* file, [[maybe_unused]] const ch beammp_errorf("Assertion failed in '{}:{}': {}.", __func__, _line, #cond); \ } \ } while (false) -#define beammp_assert_not_reachable() \ - do { \ +#define beammp_assert_not_reachable() \ + do { \ beammp_errorf("Assertion failed in '{}:{}': Unreachable code reached. This may result in a crash or undefined state of the program.", __func__, _line); \ } while (false) #endif // DEBUG