Browse Source

[compat] Windows 8.1 support

Signed-off-by: lizzie <lizzie@eden-emu.dev>
pull/2772/head
lizzie 5 months ago
parent
commit
1b7bcb84a1
  1. 5
      src/common/thread.cpp

5
src/common/thread.cpp

@ -81,7 +81,10 @@ void SetCurrentThreadPriority(ThreadPriority new_priority) {
// Sets the debugger-visible name of the current thread. // Sets the debugger-visible name of the current thread.
void SetCurrentThreadName(const char* name) { void SetCurrentThreadName(const char* name) {
SetThreadDescription(GetCurrentThread(), UTF8ToUTF16W(name).data());
if (auto pf = (decltype(&SetThreadDescription))GetProcAddress(GetModuleHandle(TEXT("KernelBase.dll")), "SetThreadDescription"); pf)
pf(GetCurrentThread(), UTF8ToUTF16W(name).data()); // Windows 10+
else
; // No-op
} }
#else // !MSVC_VER, so must be POSIX threads #else // !MSVC_VER, so must be POSIX threads

Loading…
Cancel
Save