mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-14 04:01:48 +00:00
Use proper __APPLE__ macro.
This commit is contained in:
parent
1d9542ea25
commit
c7cb89307f
@ -82,7 +82,7 @@ bool Socket::Connect( const char* addr, const char* port )
|
|||||||
for( ptr = res; ptr; ptr = ptr->ai_next )
|
for( ptr = res; ptr; ptr = ptr->ai_next )
|
||||||
{
|
{
|
||||||
if( ( sock = socket( ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol ) ) == -1 ) continue;
|
if( ( sock = socket( ptr->ai_family, ptr->ai_socktype, ptr->ai_protocol ) ) == -1 ) continue;
|
||||||
#if defined __MACOSX__ || defined __IPHONE__
|
#if defined __APPLE__
|
||||||
int val = 1;
|
int val = 1;
|
||||||
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
|
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
|
||||||
#endif
|
#endif
|
||||||
@ -251,7 +251,7 @@ Socket* ListenSocket::Accept()
|
|||||||
if( FD_ISSET( m_sock, &fds ) )
|
if( FD_ISSET( m_sock, &fds ) )
|
||||||
{
|
{
|
||||||
int sock = accept( m_sock, (sockaddr*)&remote, &sz);
|
int sock = accept( m_sock, (sockaddr*)&remote, &sz);
|
||||||
#if defined __MACOSX__ || defined __IPHONE__
|
#if defined __APPLE__
|
||||||
int val = 1;
|
int val = 1;
|
||||||
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
|
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
|
||||||
#endif
|
#endif
|
||||||
|
@ -91,7 +91,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
|
|||||||
auto data = (ThreadNameData*)tracy_malloc( sizeof( ThreadNameData ) );
|
auto data = (ThreadNameData*)tracy_malloc( sizeof( ThreadNameData ) );
|
||||||
# ifdef _WIN32
|
# ifdef _WIN32
|
||||||
data->id = GetThreadId( static_cast<HANDLE>( handle ) );
|
data->id = GetThreadId( static_cast<HANDLE>( handle ) );
|
||||||
# elif defined __MACOSX__ || defined __IPHONE__
|
# elif defined __APPLE__
|
||||||
pthread_thread_id( handle, data->id );
|
pthread_thread_id( handle, data->id );
|
||||||
# else
|
# else
|
||||||
data->id = (uint64_t)handle;
|
data->id = (uint64_t)handle;
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define __TRACYSYSTEM_HPP__
|
#define __TRACYSYSTEM_HPP__
|
||||||
|
|
||||||
#ifdef TRACY_ENABLE
|
#ifdef TRACY_ENABLE
|
||||||
# if defined __ANDROID__ || defined __CYGWIN__ || defined __MACOSX__ || defined __IPHONE__
|
# if defined __ANDROID__ || defined __CYGWIN__ || defined __APPLE__
|
||||||
# define TRACY_COLLECT_THREAD_NAMES
|
# define TRACY_COLLECT_THREAD_NAMES
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
@ -24,7 +24,7 @@ static inline uint64_t GetThreadHandle()
|
|||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
|
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
|
||||||
return uint64_t( GetCurrentThreadId() );
|
return uint64_t( GetCurrentThreadId() );
|
||||||
#elif defined __MACOSX__ || defined __IPHONE__
|
#elif defined __APPLE__
|
||||||
uint64_t id;
|
uint64_t id;
|
||||||
pthread_threadid_np( pthread_self(), id );
|
pthread_threadid_np( pthread_self(), id );
|
||||||
return id;
|
return id;
|
||||||
|
Loading…
Reference in New Issue
Block a user