From 8de876daf2265358844678e15de127457a7410ab Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Thu, 27 Jun 2024 21:36:09 +0000 Subject: [PATCH 1/4] Windows: Use newer wine unixcall API __wine_unix_call is no longer exported in recent wine versions. --- Source/Windows/Defs/ntdll.def | 2 +- Source/Windows/include/wine/unixlib.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Windows/Defs/ntdll.def b/Source/Windows/Defs/ntdll.def index 64151e73e..a72e2d0fd 100644 --- a/Source/Windows/Defs/ntdll.def +++ b/Source/Windows/Defs/ntdll.def @@ -9,4 +9,4 @@ EXPORTS NtGetContextThread NtContinue __wine_dbg_output - __wine_unix_call + __wine_unix_call_dispatcher DATA diff --git a/Source/Windows/include/wine/unixlib.h b/Source/Windows/include/wine/unixlib.h index 937ccb117..1b8f39929 100644 --- a/Source/Windows/include/wine/unixlib.h +++ b/Source/Windows/include/wine/unixlib.h @@ -11,7 +11,11 @@ extern "C" { typedef UINT64 unixlib_handle_t; -NTSTATUS WINAPI __wine_unix_call(unixlib_handle_t handle, unsigned int code, void* args); +extern NTSTATUS(WINAPI* __wine_unix_call_dispatcher)(unixlib_handle_t, unsigned int, void*); + +static inline NTSTATUS __wine_unix_call(unixlib_handle_t handle, unsigned int code, void* args) { + return __wine_unix_call_dispatcher(handle, code, args); +} #ifdef __cplusplus } From 230e3245fddb636fe680ed43f8dbcbec37a1d9f2 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Tue, 16 Apr 2024 17:27:45 +0000 Subject: [PATCH 2/4] FileLoading: Fix compilation with newer libc++ --- FEXCore/Source/Utils/FileLoading.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/FEXCore/Source/Utils/FileLoading.cpp b/FEXCore/Source/Utils/FileLoading.cpp index bd46a3396..e56ae36a8 100644 --- a/FEXCore/Source/Utils/FileLoading.cpp +++ b/FEXCore/Source/Utils/FileLoading.cpp @@ -81,7 +81,7 @@ ssize_t LoadFileToBuffer(const fextl::string& Filepath, std::span Buffer) #else template static bool LoadFileImpl(T& Data, const fextl::string& Filepath, size_t FixedSize) { - std::ifstream f(Filepath, std::ios::binary | std::ios::ate); + std::ifstream f(Filepath.c_str(), std::ios::binary | std::ios::ate); if (f.fail()) { return false; } @@ -93,7 +93,7 @@ static bool LoadFileImpl(T& Data, const fextl::string& Filepath, size_t FixedSiz } ssize_t LoadFileToBuffer(const fextl::string& Filepath, std::span Buffer) { - std::ifstream f(Filepath, std::ios::binary | std::ios::ate); + std::ifstream f(Filepath.c_str(), std::ios::binary | std::ios::ate); return f.readsome(Buffer.data(), Buffer.size()); } From 09f476924fee0971dabef42e8b68ad79bcb5f504 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 26 Jun 2024 13:03:30 +0000 Subject: [PATCH 3/4] FEXCore: Fix missing return in win32 SetSignalMask path --- FEXCore/Source/Utils/Threads.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/FEXCore/Source/Utils/Threads.cpp b/FEXCore/Source/Utils/Threads.cpp index 828faf728..0535df5b4 100644 --- a/FEXCore/Source/Utils/Threads.cpp +++ b/FEXCore/Source/Utils/Threads.cpp @@ -47,6 +47,8 @@ uint64_t SetSignalMask(uint64_t Mask) { #ifndef _WIN32 ::syscall(SYS_rt_sigprocmask, SIG_SETMASK, &Mask, &Mask, 8); return Mask; +#else + return 0; #endif } From a70e3e42b2887bc11e52ee1365388c25d91d4deb Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Wed, 26 Jun 2024 12:53:19 +0000 Subject: [PATCH 4/4] FEXCore: Drop unneeded MinGW library naming workaround It's generally expected for libraries to use the .a suffix with MinGW, and DLLs are still correctly named without the prior special handling. --- FEXCore/Source/CMakeLists.txt | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/FEXCore/Source/CMakeLists.txt b/FEXCore/Source/CMakeLists.txt index c7178eca2..e760ae751 100644 --- a/FEXCore/Source/CMakeLists.txt +++ b/FEXCore/Source/CMakeLists.txt @@ -367,16 +367,6 @@ function(AddLibrary Name Type) target_link_libraries(${Name} FEXCore_Base) target_compile_options(${Name} PRIVATE ${FEX_TUNE_COMPILE_FLAGS}) set_target_properties(${Name} PROPERTIES OUTPUT_NAME FEXCore) - if (MINGW_BUILD) - # Mingw build isn't building a linux shared library, so it can't have a SONAME. - set_target_properties(${Name} PROPERTIES NO_SONAME ON) - # Change the suffixes otherwise cmake continues using .a and .so - if (${Type} STREQUAL SHARED) - set_target_properties(${Name} PROPERTIES SUFFIX ".dll") - elseif(${Type} STREQUAL STATIC) - set_target_properties(${Name} PROPERTIES SUFFIX ".lib") - endif() - endif() AddDefaultOptionsToTarget(${Name}) endfunction()