From 8249b28bea29e8ce17eac12776a60ec3f9e47176 Mon Sep 17 00:00:00 2001 From: Dominick Allen Date: Thu, 17 Oct 2024 19:42:29 -0500 Subject: Rename InvalidInput to ArgumentInvalid. --- include/fud_assert.hpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'include/fud_assert.hpp') diff --git a/include/fud_assert.hpp b/include/fud_assert.hpp index 6b21fdc..ecfaa2f 100644 --- a/include/fud_assert.hpp +++ b/include/fud_assert.hpp @@ -22,9 +22,22 @@ // #include #include +#include "fud_span.hpp" namespace fud { +constexpr std::size_t MAX_FILE_CHARS = 256; +constexpr std::size_t MAX_FUNCTION_CHARS = 256; +constexpr std::size_t BITS_PER_OCTAL = 3; +constexpr auto MAX_LINE_CHARS = BITS_PER_OCTAL * sizeof(decltype(std::source_location{}.line())) + 3; +constexpr std::size_t MAX_ASSERT_CHARS = 512 - MAX_LINE_CHARS; +constexpr std::size_t ASSERT_MSG_SIZE = MAX_FILE_CHARS + MAX_LINE_CHARS + MAX_FUNCTION_CHARS + MAX_ASSERT_CHARS; + +void assertFormat( + const char* assertion, + std::source_location sourceLocation, + Span buffer); + [[noreturn]] void assertFail( const char* assertion, std::source_location sourceLocation = std::source_location::current()); -- cgit v1.2.3