diff --git a/src/core/AsyncLogWriter.cpp b/src/core/AsyncLogWriter.cpp index 95da47acb..a005ec3e6 100644 --- a/src/core/AsyncLogWriter.cpp +++ b/src/core/AsyncLogWriter.cpp @@ -22,6 +22,13 @@ #define NOMINMAX #endif #include +#if defined(__MINGW32__) +// This mingw-w64 header snapshot doesn't declare SetThreadDescription even +// though kernel32.dll exports it (Windows 10 1607+, MSVC's SDK already has +// it). Widening _WIN32_WINNT doesn't help — the prototype is absent outright. +extern "C" __declspec(dllimport) HRESULT WINAPI + SetThreadDescription(HANDLE hThread, PCWSTR lpThreadDescription); +#endif #elif defined(__APPLE__) #include #elif defined(__linux__) diff --git a/src/core/SystemInfo.cpp b/src/core/SystemInfo.cpp index d4cf6069a..db7252d8b 100644 --- a/src/core/SystemInfo.cpp +++ b/src/core/SystemInfo.cpp @@ -15,6 +15,13 @@ #endif #include #include +#if defined(__MINGW32__) +// This mingw-w64 header snapshot doesn't declare GetThreadDescription even +// though kernel32.dll exports it (Windows 10 1607+, MSVC's SDK already has +// it). Widening _WIN32_WINNT doesn't help — the prototype is absent outright. +extern "C" __declspec(dllimport) HRESULT WINAPI + GetThreadDescription(HANDLE hThread, PWSTR* ppszThreadDescription); +#endif #elif defined(Q_OS_MAC) #include #include diff --git a/src/core/ThreadName.cpp b/src/core/ThreadName.cpp index acb5666a4..866432563 100644 --- a/src/core/ThreadName.cpp +++ b/src/core/ThreadName.cpp @@ -8,6 +8,13 @@ #endif #include #include +#if defined(__MINGW32__) +// This mingw-w64 header snapshot doesn't declare SetThreadDescription even +// though kernel32.dll exports it (Windows 10 1607+, MSVC's SDK already has +// it). Widening _WIN32_WINNT doesn't help — the prototype is absent outright. +extern "C" __declspec(dllimport) HRESULT WINAPI + SetThreadDescription(HANDLE hThread, PCWSTR lpThreadDescription); +#endif #elif defined(__APPLE__) #include #elif defined(__linux__)