diff options
author | Dominick Allen <djallen@librehumanitas.org> | 2024-10-15 12:34:59 -0500 |
---|---|---|
committer | Dominick Allen <djallen@librehumanitas.org> | 2024-10-15 12:34:59 -0500 |
commit | 93d8e7d066ec89a235630907164b07ada6ee5c3c (patch) | |
tree | 59d8a8012075cb6337bb932f7568eb246de93dfa /include | |
parent | 2eaa2875f0f2523439beb623fc63146ef295c8cc (diff) |
Change asssertions to abort.
Diffstat (limited to 'include')
-rw-r--r-- | include/fud_assert.hpp | 13 |
1 files changed, 7 insertions, 6 deletions
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 <stacktrace> + +#include <source_location> + 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<void>(0) : assertFail(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__)) +#define fudAssert(expr) ((expr) ? static_cast<void>(0) : assertFail(#expr, std::source_location::current())) } // namespace fud |