mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-10 02:31:48 +00:00
Fix compiling TracyClient.cpp on UWP with undefined TRACY_ENABLE
This commit is contained in:
parent
92b182d47e
commit
10b3d7ad82
@ -10,6 +10,11 @@
|
|||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
# include <malloc.h>
|
# include <malloc.h>
|
||||||
|
|
||||||
|
# if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
|
||||||
|
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||||
|
# define TRACY_ON_UWP
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# include <string.h>
|
# include <string.h>
|
||||||
@ -127,7 +132,11 @@ void ThreadNameMsvcMagic( const THREADNAME_INFO& info )
|
|||||||
TRACY_API void SetThreadName( const char* name )
|
TRACY_API void SetThreadName( const char* name )
|
||||||
{
|
{
|
||||||
#if defined _WIN32
|
#if defined _WIN32
|
||||||
|
# if defined TRACY_ON_UWP
|
||||||
|
static auto _SetThreadDescription = &::SetThreadDescription;
|
||||||
|
# else
|
||||||
static auto _SetThreadDescription = (t_SetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "SetThreadDescription" );
|
static auto _SetThreadDescription = (t_SetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "SetThreadDescription" );
|
||||||
|
# endif
|
||||||
if( _SetThreadDescription )
|
if( _SetThreadDescription )
|
||||||
{
|
{
|
||||||
wchar_t buf[256];
|
wchar_t buf[256];
|
||||||
@ -191,7 +200,11 @@ TRACY_API const char* GetThreadName( uint32_t id )
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# if defined _WIN32
|
# if defined _WIN32
|
||||||
|
# if defined TRACY_ON_UWP
|
||||||
|
static auto _GetThreadDescription = &::GetThreadDescription;
|
||||||
|
# else
|
||||||
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
|
static auto _GetThreadDescription = (t_GetThreadDescription)GetProcAddress( GetModuleHandleA( "kernel32.dll" ), "GetThreadDescription" );
|
||||||
|
# endif
|
||||||
if( _GetThreadDescription )
|
if( _GetThreadDescription )
|
||||||
{
|
{
|
||||||
auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id );
|
auto hnd = OpenThread( THREAD_QUERY_LIMITED_INFORMATION, FALSE, (DWORD)id );
|
||||||
|
Loading…
Reference in New Issue
Block a user