diff --git a/qtbase/src/corelib/thread/qthread_win.cpp b/qtbase/src/corelib/thread/qthread_win.cpp index 3fa2fba6..2c2831cf 100644 --- a/qtbase/src/corelib/thread/qthread_win.cpp +++ b/qtbase/src/corelib/thread/qthread_win.cpp @@ -240,6 +240,8 @@ typedef struct tagTHREADNAME_INFO typedef HRESULT(WINAPI* SetThreadDescriptionFunc)(HANDLE, PCWSTR); +#if defined(Q_CC_MSVC) + // Helper function to set the thread name using RaiseException and __try static void setThreadNameUsingException(HANDLE threadId, LPCSTR threadName) { THREADNAME_INFO info; @@ -256,6 +258,8 @@ static void setThreadNameUsingException(HANDLE threadId, LPCSTR threadName) { } } +#endif // Q_CC_MSVC + void qt_set_thread_name(HANDLE threadId, const QString &name) { HMODULE hKernel32 = GetModuleHandleW(L"Kernel32.dll");