From b6f86551e97d5b13fadabef38eb3640e85a32e2c Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 2 Sep 2023 01:11:40 -0500 Subject: [PATCH] [ox/std] Make assert functions take StringViews instead of C strings --- deps/ox/src/ox/std/assert.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/deps/ox/src/ox/std/assert.hpp b/deps/ox/src/ox/std/assert.hpp index 4eb766ff..f2669c3a 100644 --- a/deps/ox/src/ox/std/assert.hpp +++ b/deps/ox/src/ox/std/assert.hpp @@ -22,9 +22,9 @@ namespace ox { -void panic(const char *file, int line, const char *panicMsg, const Error &err = OxError(0)) noexcept; +void panic(CRStringView file, int line, CRStringView panicMsg, const Error &err = OxError(0)) noexcept; -constexpr void constexprPanic(const char *file, int line, const char *panicMsg, const Error &err = OxError(0)) noexcept { +constexpr void constexprPanic(CRStringView file, int line, CRStringView panicMsg, const Error &err = OxError(0)) noexcept { if (!std::is_constant_evaluated()) { panic(file, line, panicMsg, err); } else { @@ -32,7 +32,7 @@ constexpr void constexprPanic(const char *file, int line, const char *panicMsg, } } -constexpr void assertFunc(const char *file, int line, bool pass, [[maybe_unused]]const char *assertTxt, [[maybe_unused]]const char *msg) noexcept { +constexpr void assertFunc(CRStringView file, int line, bool pass, [[maybe_unused]]CRStringView assertTxt, [[maybe_unused]]CRStringView msg) noexcept { if (!pass) { if (!std::is_constant_evaluated()) { #ifdef OX_USE_STDLIB @@ -51,7 +51,7 @@ constexpr void assertFunc(const char *file, int line, bool pass, [[maybe_unused] } } -constexpr void assertFunc(const char *file, int line, const Error &err, const char*, const char *assertMsg) noexcept { +constexpr void assertFunc(CRStringView file, int line, const Error &err, CRStringView, CRStringView assertMsg) noexcept { if (err) { if (!std::is_constant_evaluated()) { #if defined(OX_USE_STDLIB) @@ -75,7 +75,7 @@ constexpr void assertFunc(const char *file, int line, const Error &err, const ch } } -constexpr void expect(const char *file, int line, const auto &actual, const auto &expected) noexcept { +constexpr void expect(CRStringView file, int line, const auto &actual, const auto &expected) noexcept { if (actual != expected) { if (!std::is_constant_evaluated()) { #if defined(OX_USE_STDLIB)