diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp index 7ae6cf3b..976f434b 100644 --- a/client/TracyCallstack.cpp +++ b/client/TracyCallstack.cpp @@ -1,5 +1,5 @@ -#include #include +#include #include "TracyCallstack.hpp" #ifdef TRACY_HAS_CALLSTACK @@ -89,7 +89,8 @@ CallstackEntryData DecodeCallstackPtr( uint64_t ptr ) int write; const auto proc = GetCurrentProcess(); #ifndef __CYGWIN__ - const auto inlineNum = std::min( MaxCbTrace - 1, SymAddrIncludeInlineTrace( proc, ptr ) ); + DWORD inlineNum = SymAddrIncludeInlineTrace( proc, ptr ); + if( inlineNum > MaxCbTrace - 1 ) inlineNum = MaxCbTrace - 1; DWORD ctx = 0; DWORD idx; BOOL doInline = FALSE; diff --git a/client/TracyCallstack.hpp b/client/TracyCallstack.hpp index 739114bd..6a853925 100644 --- a/client/TracyCallstack.hpp +++ b/client/TracyCallstack.hpp @@ -20,7 +20,6 @@ extern "C" #include #include -#include #include "../common/TracyAlloc.hpp" #include "../common/TracyForceInline.hpp" diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index 2b34cb51..2dc15f46 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -3,20 +3,17 @@ #include #include -#include #include #include #include "tracy_concurrentqueue.h" #include "TracyCallstack.hpp" #include "TracySysTime.hpp" -#include "TracySysTrace.hpp" #include "TracyFastVector.hpp" #include "../common/TracyQueue.hpp" #include "../common/TracyAlign.hpp" #include "../common/TracyAlloc.hpp" #include "../common/TracyMutex.hpp" -#include "../common/TracySystem.hpp" #if defined _WIN32 || defined __CYGWIN__ # include @@ -30,6 +27,10 @@ # define TRACY_HW_TIMER #endif +#if !defined TRACY_HW_TIMER || ( __ARM_ARCH >= 6 && !defined CLOCK_MONOTONIC_RAW ) + #include +#endif + #ifndef TracyConcat # define TracyConcat(x,y) TracyConcatIndirect(x,y) #endif diff --git a/client/TracySysTime.cpp b/client/TracySysTime.cpp index b3cb0cbc..4b4cdc7e 100644 --- a/client/TracySysTime.cpp +++ b/client/TracySysTime.cpp @@ -5,7 +5,6 @@ # if defined _WIN32 || defined __CYGWIN__ # include # elif defined __linux__ -# include # include # include # elif defined __APPLE__ diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp index 830bfba9..19ac815e 100644 --- a/common/TracySocket.cpp +++ b/common/TracySocket.cpp @@ -1,4 +1,3 @@ -#include #include #include #include @@ -192,7 +191,7 @@ int Socket::RecvBuffered( void* buf, int len, int timeout ) m_bufLeft = Recv( m_buf, BufSize, timeout ); if( m_bufLeft <= 0 ) return m_bufLeft; - const auto sz = std::min( len, m_bufLeft ); + const auto sz = len < m_bufLeft ? len : m_bufLeft; memcpy( buf, m_buf, sz ); m_bufPtr = m_buf + sz; m_bufLeft -= sz; diff --git a/common/TracySystem.hpp b/common/TracySystem.hpp index ae4f835e..7f6424ef 100644 --- a/common/TracySystem.hpp +++ b/common/TracySystem.hpp @@ -5,7 +5,7 @@ # ifndef _WINDOWS_ extern "C" __declspec(dllimport) unsigned long __stdcall GetCurrentThreadId(void); # endif -#else +#elif defined __APPLE__ || ( !defined __ANDROID__ && !defined __linux__ ) # include #endif