diff options
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 |