Use proper __APPLE__ macro.

This commit is contained in:
Bartosz Taudul 2017-11-03 11:09:31 +01:00
parent 1d9542ea25
commit c7cb89307f
3 changed files with 5 additions and 5 deletions

View File

@ -82,7 +82,7 @@ bool Socket::Connect( const char* addr, const char* port )
for( ptr = res; ptr; ptr = ptr->ai_next )
{
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;
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
#endif
@ -251,7 +251,7 @@ Socket* ListenSocket::Accept()
if( FD_ISSET( m_sock, &fds ) )
{
int sock = accept( m_sock, (sockaddr*)&remote, &sz);
#if defined __MACOSX__ || defined __IPHONE__
#if defined __APPLE__
int val = 1;
setsockopt( m_sock, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof( val ) );
#endif

View File

@ -91,7 +91,7 @@ void SetThreadName( std::thread::native_handle_type handle, const char* name )
auto data = (ThreadNameData*)tracy_malloc( sizeof( ThreadNameData ) );
# ifdef _WIN32
data->id = GetThreadId( static_cast<HANDLE>( handle ) );
# elif defined __MACOSX__ || defined __IPHONE__
# elif defined __APPLE__
pthread_thread_id( handle, data->id );
# else
data->id = (uint64_t)handle;

View File

@ -2,7 +2,7 @@
#define __TRACYSYSTEM_HPP__
#ifdef TRACY_ENABLE
# if defined __ANDROID__ || defined __CYGWIN__ || defined __MACOSX__ || defined __IPHONE__
# if defined __ANDROID__ || defined __CYGWIN__ || defined __APPLE__
# define TRACY_COLLECT_THREAD_NAMES
# endif
#endif
@ -24,7 +24,7 @@ static inline uint64_t GetThreadHandle()
#ifdef _WIN32
static_assert( sizeof( decltype( GetCurrentThreadId() ) ) <= sizeof( uint64_t ), "Thread handle too big to fit in protocol" );
return uint64_t( GetCurrentThreadId() );
#elif defined __MACOSX__ || defined __IPHONE__
#elif defined __APPLE__
uint64_t id;
pthread_threadid_np( pthread_self(), id );
return id;