diff --git a/deps/ox/src/ox/std/assert.cpp b/deps/ox/src/ox/std/assert.cpp index 1b025511..d3127b31 100644 --- a/deps/ox/src/ox/std/assert.cpp +++ b/deps/ox/src/ox/std/assert.cpp @@ -17,12 +17,12 @@ namespace ox { -void assertFunc([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]bool pass, [[maybe_unused]]const char *msg) noexcept { +void assertFunc([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]bool pass, [[maybe_unused]]const char *assertTxt, [[maybe_unused]]const char *msg) noexcept { if (!pass) { #if defined(OX_USE_STDLIB) - std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m (" << file << ':' << line << "): " << msg << std::endl; + std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m " << assertTxt << " [" << file << ':' << line << "]: " << msg << std::endl; printStackTrace(2); - oxTrace("assert").del("") << "Failed assert: " << msg << " (" << file << ":" << line << ")"; + oxTrace("assert").del("") << "Failed assert: " << msg << " (" << assertTxt << ") " << " [" << file << ":" << line << "]"; std::abort(); #else panic(file, line, msg); @@ -30,7 +30,7 @@ void assertFunc([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[ma } } -void assertFunc(const char *file, int line, const Error &err, const char *assertMsg) noexcept { +void assertFunc(const char *file, int line, const Error &err, const char*, const char *assertMsg) noexcept { if (err) { #if defined(OX_USE_STDLIB) std::cerr << "\033[31;1;1mASSERT FAILURE:\033[0m (" << file << ':' << line << "): " << assertMsg << '\n'; @@ -42,7 +42,7 @@ void assertFunc(const char *file, int line, const Error &err, const char *assert std::cerr << "\tError Location:\t" << err.file << ':' << err.line << '\n'; } printStackTrace(2); - oxTrace("panic").del("") << "Panic: " << assertMsg << " (" << file << ":" << line << ")"; + oxTrace("panic").del("") << "Panic: " << assertMsg << " [" << file << ":" << line << "]"; std::abort(); #else panic(file, line, assertMsg); diff --git a/deps/ox/src/ox/std/assert.hpp b/deps/ox/src/ox/std/assert.hpp index da80bf35..f6b1e2f7 100644 --- a/deps/ox/src/ox/std/assert.hpp +++ b/deps/ox/src/ox/std/assert.hpp @@ -19,9 +19,9 @@ namespace ox { -void assertFunc(const char *file, int line, bool pass, const char *msg) noexcept; +void assertFunc(const char *file, int line, bool pass, const char *assertTxt, const char *msg) noexcept; -void assertFunc(const char *file, int line, const Error &err, const char *msg) noexcept; +void assertFunc(const char *file, int line, const Error &err, const char *assertTxt, const char *msg) noexcept; void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_unused]]const char *msg, [[maybe_unused]]const Error &err = OxError(0)) noexcept; @@ -29,7 +29,7 @@ void panic([[maybe_unused]]const char *file, [[maybe_unused]]int line, [[maybe_u #define oxPanic(errCode, msg) ox::panic(__FILE__, __LINE__, msg, errCode) #ifndef NDEBUG -#define oxAssert(pass, msg) ox::assertFunc(__FILE__, __LINE__, pass, msg) +#define oxAssert(pass, msg) ox::assertFunc(__FILE__, __LINE__, pass, #pass, msg) #else inline void oxAssert(bool, const char*) {} inline void oxAssert(ox::Error, const char*) {}