Fix Linux build and locale

This commit is contained in:
Reonu 2024-04-25 15:51:04 +01:00
parent ac2150b0fa
commit c4b89613ab
3 changed files with 4 additions and 2 deletions

View File

@ -293,8 +293,6 @@ int main(int argc, char** argv) {
cfi.FontWeight = FW_NORMAL; cfi.FontWeight = FW_NORMAL;
wcscpy_s(cfi.FaceName, L"NSimSun"); wcscpy_s(cfi.FaceName, L"NSimSun");
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi); SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);
#else
std::setlocale(LC_ALL, "en_US.UTF-8");
#endif #endif
//printf("Current dir: %ls\n", std::filesystem::current_path().c_str()); //printf("Current dir: %ls\n", std::filesystem::current_path().c_str());

View File

@ -1049,6 +1049,9 @@ void recomp::get_window_size(int& width, int& height) {
} }
void init_hook(RT64::RenderInterface* interface, RT64::RenderDevice* device) { void init_hook(RT64::RenderInterface* interface, RT64::RenderDevice* device) {
#if defined(__linux__)
std::locale::global(std::locale::classic());
#endif
ui_context = std::make_unique<UIContext>(); ui_context = std::make_unique<UIContext>();
ui_context->rml.add_menu(recomp::Menu::Config, recomp::create_config_menu()); ui_context->rml.add_menu(recomp::Menu::Config, recomp::create_config_menu());

View File

@ -21,6 +21,7 @@
# undef Status # undef Status
# undef LockMask # undef LockMask
# undef Always # undef Always
# undef Success
#endif #endif
struct UltraThreadContext { struct UltraThreadContext {