Browse Source

Util: Add extra safety check for custom asserts

master
Riyyi 2 years ago
parent
commit
04f5f42bb5
  1. 4
      src/util/meta/assert.h

4
src/util/meta/assert.h

@ -65,7 +65,9 @@ inline void __assertion_failed(const char* assertion, const char* file, uint32_t
if constexpr (sizeof...(Parameters) > 0) { if constexpr (sizeof...(Parameters) > 0) {
fprintf(stderr, ": "); fprintf(stderr, ": ");
// Cant use the formatting library to print asserts caused by the formatting library // Cant use the formatting library to print asserts caused by the formatting library
if (!std::string_view(function).starts_with("Util::Format::")) { std::string_view functionString = function;
if (!functionString.starts_with("Util::Format::")
&& !functionString.starts_with("Util::GenericLexer::")) {
std::string message; std::string message;
formatTo(message, parameters...); formatTo(message, parameters...);
fprintf(stderr, "%s", message.c_str()); fprintf(stderr, "%s", message.c_str());

Loading…
Cancel
Save