From 877acb561382f7e6218ef1f48d9d47ad8697e02b Mon Sep 17 00:00:00 2001 From: Adrian <78108584+AdrianCassar@users.noreply.github.com> Date: Sat, 1 Feb 2025 19:51:40 +0000 Subject: [PATCH] [3PP] Uplift utfcpp --- .gitmodules | 2 +- src/xenia/base/cvar.cc | 12 ++++++------ src/xenia/base/string.cc | 2 +- src/xenia/base/utf8.cc | 2 +- third_party/utfcpp | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.gitmodules b/.gitmodules index de2c33175..7bb327b53 100644 --- a/.gitmodules +++ b/.gitmodules @@ -42,7 +42,7 @@ url = https://github.com/libsdl-org/SDL.git [submodule "third_party/utfcpp"] path = third_party/utfcpp - url = https://github.com/xenia-project/utfcpp.git + url = https://github.com/nemtrif/utfcpp.git [submodule "third_party/fmt"] path = third_party/fmt url = https://github.com/fmtlib/fmt.git diff --git a/src/xenia/base/cvar.cc b/src/xenia/base/cvar.cc index 273c077bc..2f5168480 100644 --- a/src/xenia/base/cvar.cc +++ b/src/xenia/base/cvar.cc @@ -9,7 +9,7 @@ #include "xenia/base/cvar.h" #include -#define UTF_CPP_CPLUSPLUS 201703L +#define UTF_CPP_CPLUSPLUS 202002L #include "third_party/utfcpp/source/utf8.h" #include "xenia/base/console.h" @@ -125,9 +125,9 @@ std::string EscapeBasicString(const std::string_view view) { result += "\\\\"; } else if (c < 0x20 || c == 0x7F) { if (c <= 0xFFFF) { - result += fmt::format("\\u{:04X}", c); + result += fmt::format("\\u{:04X}", static_cast(c)); } else { - result += fmt::format("\\u{:08X}", c); + result += fmt::format("\\u{:08X}", static_cast(c)); } } else { utfcpp::append(static_cast(c), result); @@ -159,7 +159,7 @@ std::string EscapeMultilineBasicString(const std::string_view view) { if (c == '\b') { result += "\\b"; } else if (c == '\t' || c == '\n') { - result += c; + result += static_cast(c); } else if (c == '\f') { result += "\\f"; } else if (c == '\r') { @@ -171,9 +171,9 @@ std::string EscapeMultilineBasicString(const std::string_view view) { result += "\\\\"; } else if (c < 0x20 || c == 0x7F) { if (c <= 0xFFFF) { - result += fmt::format("\\u{:04X}", c); + result += fmt::format("\\u{:04X}", static_cast(c)); } else { - result += fmt::format("\\u{:08X}", c); + result += fmt::format("\\u{:08X}", static_cast(c)); } } else { utfcpp::append(static_cast(c), result); diff --git a/src/xenia/base/string.cc b/src/xenia/base/string.cc index 9d13b7d86..c32c55fa8 100644 --- a/src/xenia/base/string.cc +++ b/src/xenia/base/string.cc @@ -22,7 +22,7 @@ #include #endif // !XE_PLATFORM_WIN32 -#define UTF_CPP_CPLUSPLUS 201703L +#define UTF_CPP_CPLUSPLUS 202002L #include "third_party/utfcpp/source/utf8.h" namespace utfcpp = utf8; diff --git a/src/xenia/base/utf8.cc b/src/xenia/base/utf8.cc index 103712d53..7c12f0a08 100644 --- a/src/xenia/base/utf8.cc +++ b/src/xenia/base/utf8.cc @@ -15,7 +15,7 @@ #include #include -#define UTF_CPP_CPLUSPLUS 201703L +#define UTF_CPP_CPLUSPLUS 202002L #include "third_party/utfcpp/source/utf8.h" namespace utfcpp = utf8; diff --git a/third_party/utfcpp b/third_party/utfcpp index f295c4b9a..65701fe00 160000 --- a/third_party/utfcpp +++ b/third_party/utfcpp @@ -1 +1 @@ -Subproject commit f295c4b9a1f4db635164ab4defc3938049152a3c +Subproject commit 65701fe00700577f9f4e9b96d682bd7cfcc0b76e