From 33331ea529e54f0a9f205404e3ad3505b2732e43 Mon Sep 17 00:00:00 2001 From: Romain BOULLARD Date: Fri, 21 Aug 2026 23:01:25 +0200 Subject: [PATCH] flush logs on all asserts --- .../Sources/Utils/Include/Utils/Assert/Assert.hpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Bigfoot/Sources/Utils/Include/Utils/Assert/Assert.hpp b/Bigfoot/Sources/Utils/Include/Utils/Assert/Assert.hpp index 708a39c..f28fe6e 100644 --- a/Bigfoot/Sources/Utils/Include/Utils/Assert/Assert.hpp +++ b/Bigfoot/Sources/Utils/Include/Utils/Assert/Assert.hpp @@ -17,16 +17,27 @@ #include #endif +#define BIGFOOT_FLUSH_LOG \ + do \ + { \ + if (Bigfoot::Singleton::HasInstance()) \ + { \ + Bigfoot::Singleton::GetInstance().Flush(); \ + } \ + } while (false) + #if defined BIGFOOT_WINDOWS #define BREAK \ do \ { \ + BIGFOOT_FLUSH_LOG; \ __debugbreak(); \ } while (false) #elif defined BIGFOOT_LINUX #define BREAK \ do \ { \ + BIGFOOT_FLUSH_LOG; \ std::raise(SIGTRAP); \ } while (false) #endif @@ -60,10 +71,6 @@ if (!(p_assert)) [[unlikely]] \ { \ HANDLER::Handle(location, p_message __VA_OPT__(, ) __VA_ARGS__); \ - if (Bigfoot::Singleton::HasInstance()) \ - { \ - Bigfoot::Singleton::GetInstance().Flush(); \ - } \ BREAK; \ std::abort(); \ } \