From fd6ea6bf5a1c9b90e730944cea1c9ebdf1760f12 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Tue, 12 Sep 2023 06:14:47 +0200 Subject: entity: fix build on unpatched StringView --- entity/name-of.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/entity/name-of.hpp b/entity/name-of.hpp index 81feee19..42674a19 100644 --- a/entity/name-of.hpp +++ b/entity/name-of.hpp @@ -11,7 +11,14 @@ template static constexpr auto mangled_name() { // NOLINT(bugprone-reserved-identifier) using namespace Corrade::Containers; using SVF = StringViewFlag; - return StringView { FM_PRETTY_FUNCTION, SVF::Global|SVF::NullTerminated }; + constexpr auto my_strlen = [](const char* str) constexpr -> size_t { + const char* start = str; + for (; *str; str++) + ; + return (size_t)(str - start); + }; + const char* str = FM_PRETTY_FUNCTION; + return StringView { str, my_strlen(str), SVF::Global|SVF::NullTerminated }; } template constexpr inline auto name_of = mangled_name(); -- cgit v1.2.3