From c4b89613abd0fbb9c71c3ad141384b0d699dfac4 Mon Sep 17 00:00:00 2001 From: Reonu Date: Thu, 25 Apr 2024 15:51:04 +0100 Subject: [PATCH] Fix Linux build and locale --- src/main/main.cpp | 2 -- src/ui/ui_renderer.cpp | 3 +++ ultramodern/ultramodern.hpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/main.cpp b/src/main/main.cpp index cd9057a..15dd750 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -293,8 +293,6 @@ int main(int argc, char** argv) { cfi.FontWeight = FW_NORMAL; wcscpy_s(cfi.FaceName, L"NSimSun"); SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi); -#else - std::setlocale(LC_ALL, "en_US.UTF-8"); #endif //printf("Current dir: %ls\n", std::filesystem::current_path().c_str()); diff --git a/src/ui/ui_renderer.cpp b/src/ui/ui_renderer.cpp index 6fad299..d468dcb 100644 --- a/src/ui/ui_renderer.cpp +++ b/src/ui/ui_renderer.cpp @@ -1049,6 +1049,9 @@ void recomp::get_window_size(int& width, int& height) { } void init_hook(RT64::RenderInterface* interface, RT64::RenderDevice* device) { +#if defined(__linux__) + std::locale::global(std::locale::classic()); +#endif ui_context = std::make_unique(); ui_context->rml.add_menu(recomp::Menu::Config, recomp::create_config_menu()); diff --git a/ultramodern/ultramodern.hpp b/ultramodern/ultramodern.hpp index c2fa807..f125e6a 100644 --- a/ultramodern/ultramodern.hpp +++ b/ultramodern/ultramodern.hpp @@ -21,6 +21,7 @@ # undef Status # undef LockMask # undef Always +# undef Success #endif struct UltraThreadContext {