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(); \ } \