From 84f2e5e57907caa3bb811aec43656e7fad1e69e3 Mon Sep 17 00:00:00 2001 From: Katy Coe Date: Wed, 25 Nov 2020 16:50:11 +0100 Subject: [PATCH] C++: Exclude std::codecvt from Visual Studio < 2019 (#94) --- Il2CppInspector.Common/Properties/Resources.Designer.cs | 2 +- Il2CppInspector.Common/Properties/Resources.resx | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Il2CppInspector.Common/Properties/Resources.Designer.cs b/Il2CppInspector.Common/Properties/Resources.Designer.cs index 9dd3f4f..2281fd2 100644 --- a/Il2CppInspector.Common/Properties/Resources.Designer.cs +++ b/Il2CppInspector.Common/Properties/Resources.Designer.cs @@ -137,7 +137,7 @@ namespace Il2CppInspector.Properties { ///// Helper function to open a new console window and redirect stdout there ///void il2cppi_new_console(); /// - ///// Helper [rest of string was truncated]";. + ///#if _MSC_V [rest of string was truncated]";. /// internal static string Cpp_HelpersH { get { diff --git a/Il2CppInspector.Common/Properties/Resources.resx b/Il2CppInspector.Common/Properties/Resources.resx index 755c92f..837898e 100644 --- a/Il2CppInspector.Common/Properties/Resources.resx +++ b/Il2CppInspector.Common/Properties/Resources.resx @@ -185,6 +185,7 @@ void il2cppi_new_console() { freopen_s((FILE**) stdout, "CONOUT$", "w", stdout); } +#if _MSC_VER >= 1920 // Helper function to convert Il2CppString to std::string std::string il2cppi_to_string(Il2CppString* str) { std::u16string u16(reinterpret_cast<const char16_t*>(str->chars)); @@ -195,7 +196,8 @@ std::string il2cppi_to_string(Il2CppString* str) { std::string il2cppi_to_string(app::String* str) { std::u16string u16(reinterpret_cast<const char16_t*>(&str->fields.m_firstChar)); return std::wstring_convert<std::codecvt_utf8_utf16<char16_t>, char16_t>{}.to_bytes(u16); -} +} +#endif // Generated C++ file by Il2CppInspector - http://www.djkaty.com - https://github.com/djkaty @@ -218,11 +220,13 @@ void il2cppi_log_write(std::string text); // Helper function to open a new console window and redirect stdout there void il2cppi_new_console(); +#if _MSC_VER >= 1920 // Helper function to convert Il2CppString to std::string std::string il2cppi_to_string(Il2CppString* str); // Helper function to convert System.String to std::string std::string il2cppi_to_string(app::String* str); +#endif // Helper function to check if a metadata usage pointer is initialized template<typename T> bool il2cppi_is_initialized(T* metadataItem) {