From 4f4f7a7c46b50affba6db5d9992e90ae21d01c0e Mon Sep 17 00:00:00 2001 From: kleuter Date: Tue, 19 Nov 2024 13:57:04 +0100 Subject: [PATCH] fixed compilation when using non-microsoft compiler --- qtbase/src/corelib/thread/qthread_win.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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");