From 2502352180c6a96b2b544f3bbf41b5569af3441d Mon Sep 17 00:00:00 2001 From: Caio Oliveira Date: Wed, 10 Sep 2025 02:22:07 +0200 Subject: [PATCH] [core, desktop] "fixes" from building on mxe/x86_64-w64-mingw32 (#396) * well, i couldn't build the executable, but in anyway those build errors can come back later to bite our backs * include missing include * safeguard _MSC_VER only headers * saw some of those changes on another PR but I cant find it at moment Signed-off-by: Caio Oliveira Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/396 Reviewed-by: crueter Co-authored-by: Caio Oliveira Co-committed-by: Caio Oliveira --- src/core/file_sys/vfs/vfs_real.cpp | 6 +++++- src/core/hle/service/nifm/nifm.cpp | 3 +++ src/core/hle/service/nvnflinger/hardware_composer.cpp | 2 ++ src/core/internal_network/emu_net_state.cpp | 2 ++ src/core/internal_network/wifi_scanner.cpp | 2 ++ src/yuzu/main.cpp | 2 ++ 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/core/file_sys/vfs/vfs_real.cpp b/src/core/file_sys/vfs/vfs_real.cpp index 052684e9db..4199667171 100644 --- a/src/core/file_sys/vfs/vfs_real.cpp +++ b/src/core/file_sys/vfs/vfs_real.cpp @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later @@ -442,11 +445,12 @@ std::vector RealVfsDirectory::GetFiles() const { FileTimeStampRaw RealVfsDirectory::GetFileTimeStamp(std::string_view path_) const { const auto full_path = FS::SanitizePath(path + '/' + std::string(path_)); const auto fs_path = std::filesystem::path{FS::ToU8String(full_path)}; - struct stat file_status; #ifdef _WIN32 + struct _stat64 file_status; const auto stat_result = _wstat64(fs_path.c_str(), &file_status); #else + struct stat file_status; const auto stat_result = stat(fs_path.c_str(), &file_status); #endif diff --git a/src/core/hle/service/nifm/nifm.cpp b/src/core/hle/service/nifm/nifm.cpp index 15c7d8d2c7..7d43677c6f 100644 --- a/src/core/hle/service/nifm/nifm.cpp +++ b/src/core/hle/service/nifm/nifm.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -32,8 +33,10 @@ #undef interface #include #pragma pop_macro("interface") +#ifdef _MSC_VER #pragma comment(lib, "wlanapi.lib") #endif +#endif namespace { diff --git a/src/core/hle/service/nvnflinger/hardware_composer.cpp b/src/core/hle/service/nvnflinger/hardware_composer.cpp index 7098f4709d..a262a3dcd5 100644 --- a/src/core/hle/service/nvnflinger/hardware_composer.cpp +++ b/src/core/hle/service/nvnflinger/hardware_composer.cpp @@ -4,6 +4,8 @@ // SPDX-FileCopyrightText: Copyright 2024 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later +#include + #include #include "core/hle/service/nvdrv/devices/nvdisp_disp0.h" diff --git a/src/core/internal_network/emu_net_state.cpp b/src/core/internal_network/emu_net_state.cpp index 17fa58fa08..d6d1a70a60 100644 --- a/src/core/internal_network/emu_net_state.cpp +++ b/src/core/internal_network/emu_net_state.cpp @@ -10,8 +10,10 @@ #define NOMINMAX #include #include +#ifdef _MSC_VER #pragma comment(lib, "wlanapi.lib") #endif +#endif #include #include diff --git a/src/core/internal_network/wifi_scanner.cpp b/src/core/internal_network/wifi_scanner.cpp index f4b1738e69..127221099f 100644 --- a/src/core/internal_network/wifi_scanner.cpp +++ b/src/core/internal_network/wifi_scanner.cpp @@ -15,8 +15,10 @@ using namespace std::chrono_literals; #define NOMINMAX #include #include +#ifdef _MSC_VER #pragma comment(lib, "wlanapi.lib") #endif +#endif namespace Network { #ifdef ENABLE_WIFI_SCAN diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index c6e004813c..e23e9a6a48 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -178,7 +178,9 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual #include #include #include +#ifdef _MSC_VER #pragma comment(lib, "Dwmapi.lib") +#endif static inline void ApplyWindowsTitleBarDarkMode(HWND hwnd, bool enabled) { if (!hwnd)