mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2024-11-24 20:40:32 +08:00
fixed compilation when using non-microsoft compiler
This commit is contained in:
parent
6ba197bce4
commit
4f4f7a7c46
@ -240,6 +240,8 @@ typedef struct tagTHREADNAME_INFO
|
|||||||
|
|
||||||
typedef HRESULT(WINAPI* SetThreadDescriptionFunc)(HANDLE, PCWSTR);
|
typedef HRESULT(WINAPI* SetThreadDescriptionFunc)(HANDLE, PCWSTR);
|
||||||
|
|
||||||
|
#if defined(Q_CC_MSVC)
|
||||||
|
|
||||||
// Helper function to set the thread name using RaiseException and __try
|
// Helper function to set the thread name using RaiseException and __try
|
||||||
static void setThreadNameUsingException(HANDLE threadId, LPCSTR threadName) {
|
static void setThreadNameUsingException(HANDLE threadId, LPCSTR threadName) {
|
||||||
THREADNAME_INFO info;
|
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)
|
void qt_set_thread_name(HANDLE threadId, const QString &name)
|
||||||
{
|
{
|
||||||
HMODULE hKernel32 = GetModuleHandleW(L"Kernel32.dll");
|
HMODULE hKernel32 = GetModuleHandleW(L"Kernel32.dll");
|
||||||
|
Loading…
Reference in New Issue
Block a user