From 0f6101b19a49951c78353b6c2820f081c6544f11 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Thu, 7 Nov 2019 18:58:08 +0100 Subject: [PATCH] Fix mingw/cygwin thread name setter/getter. --- common/TracySystem.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/TracySystem.cpp b/common/TracySystem.cpp index af47b090..7782ed7a 100644 --- a/common/TracySystem.cpp +++ b/common/TracySystem.cpp @@ -51,12 +51,12 @@ TRACY_API void InitRPMallocThread(); void SetThreadName( const char* name ) { -#if defined _WIN32 && !defined PTW32_VERSION && !defined __WINPTHREADS_VERSION +#if defined _WIN32 || defined __CYGWIN__ # if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2 wchar_t buf[256]; mbstowcs( buf, name, 256 ); SetThreadDescription( GetCurrentThread(), buf ); -# else +# elif defined _MSC_VER const DWORD MS_VC_EXCEPTION=0x406D1388; # pragma pack( push, 8 ) struct THREADNAME_INFO @@ -129,7 +129,7 @@ const char* GetThreadName( uint64_t id ) ptr = ptr->next; } #else -# ifdef _WIN32 +# if defined _WIN32 || defined __CYGWIN__ # if defined NTDDI_WIN10_RS2 && NTDDI_VERSION >= NTDDI_WIN10_RS2 auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id ); if( hnd != 0 )