From ee680f01916571d53a08679ffc8e37eb34e00d37 Mon Sep 17 00:00:00 2001 From: Craig Carnell <1188869+cscd98@users.noreply.github.com> Date: Mon, 8 Dec 2025 19:25:24 +0000 Subject: [PATCH] mingw: fix thread affinity for ming --- Source/Core/Common/Thread.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/Thread.cpp b/Source/Core/Common/Thread.cpp index 258559bc4f..c0642868d6 100644 --- a/Source/Core/Common/Thread.cpp +++ b/Source/Core/Common/Thread.cpp @@ -48,7 +48,8 @@ int CurrentThreadId() void SetThreadAffinity(std::thread::native_handle_type thread, u32 mask) { - SetThreadAffinityMask(thread, mask); + // Cast required for MINGW + SetThreadAffinityMask(reinterpret_cast(thread), mask); } void SetCurrentThreadAffinity(u32 mask) @@ -89,6 +90,7 @@ static void SetCurrentThreadNameViaException(const char* name) info.dwThreadID = static_cast(-1); info.dwFlags = 0; +#if defined(_MSC_VER) __try { RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info); @@ -96,6 +98,7 @@ static void SetCurrentThreadNameViaException(const char* name) __except (EXCEPTION_CONTINUE_EXECUTION) { } +#endif } static void SetCurrentThreadNameViaApi(const char* name)