From 93d8e7d066ec89a235630907164b07ada6ee5c3c Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Tue, 15 Oct 2024 12:34:59 -0500 Subject: Change asssertions to abort. --- include/fud_assert.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'include/fud_assert.hpp') diff --git a/include/fud_assert.hpp b/include/fud_assert.hpp index 8caf751..6b21fdc 100644 --- a/include/fud_assert.hpp +++ b/include/fud_assert.hpp @@ -18,17 +18,18 @@ #ifndef FUD_ASSERT_HPP #define FUD_ASSERT_HPP +/* TODO: Investigate stacktrace */ +// #include + +#include + namespace fud { -// clang-format off [[noreturn]] void assertFail( const char* assertion, - const char* file, - unsigned int line, - const char* function) noexcept(false); -// clang-format on + std::source_location sourceLocation = std::source_location::current()); -#define fudAssert(expr) ((expr) ? static_cast(0) : assertFail(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__)) +#define fudAssert(expr) ((expr) ? static_cast(0) : assertFail(#expr, std::source_location::current())) } // namespace fud -- cgit v1.2.3