Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/wolfpld/tracy.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--client/TracyCallstack.cpp13
-rw-r--r--client/TracyProfiler.cpp2
-rw-r--r--common/TracySocket.cpp4
-rw-r--r--profiler/src/ResolvService.cpp2
-rw-r--r--server/TracyPrint.cpp4
-rw-r--r--server/TracyStorage.cpp3
6 files changed, 26 insertions, 2 deletions
diff --git a/client/TracyCallstack.cpp b/client/TracyCallstack.cpp
index 15145476..f89e14a3 100644
--- a/client/TracyCallstack.cpp
+++ b/client/TracyCallstack.cpp
@@ -35,6 +35,19 @@ CallstackEntry cb_data[MaxCbTrace];
extern "C" { t_RtlWalkFrameChain RtlWalkFrameChain = 0; }
+#if defined __MINGW32__ && API_VERSION_NUMBER < 12
+extern "C" {
+// Actual required API_VERSION_NUMBER is unknown because it is undocumented. These functions are not present in at least v11.
+DWORD IMAGEAPI SymAddrIncludeInlineTrace(HANDLE hProcess, DWORD64 Address);
+BOOL IMAGEAPI SymQueryInlineTrace(HANDLE hProcess, DWORD64 StartAddress, DWORD StartContext, DWORD64 StartRetAddress,
+ DWORD64 CurAddress, LPDWORD CurContext, LPDWORD CurFrameIndex);
+BOOL IMAGEAPI SymFromInlineContext(HANDLE hProcess, DWORD64 Address, ULONG InlineContext, PDWORD64 Displacement,
+ PSYMBOL_INFO Symbol);
+BOOL IMAGEAPI SymGetLineFromInlineContext(HANDLE hProcess, DWORD64 qwAddr, ULONG InlineContext,
+ DWORD64 qwModuleBaseAddress, PDWORD pdwDisplacement, PIMAGEHLP_LINE64 Line64);
+};
+#endif
+
void InitCallstack()
{
#ifdef UNICODE
diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp
index 86df7500..3302abdc 100644
--- a/client/TracyProfiler.cpp
+++ b/client/TracyProfiler.cpp
@@ -235,7 +235,7 @@ static int64_t SetupHwTimer()
#elif defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
static inline void CpuId( uint32_t* regs, uint32_t leaf )
{
-#if defined _MSC_VER || defined __CYGWIN__
+#if defined _WIN32 || defined __CYGWIN__
__cpuidex( (int*)regs, leaf, 0 );
#else
__get_cpuid( leaf, regs, regs+1, regs+2, regs+3 );
diff --git a/common/TracySocket.cpp b/common/TracySocket.cpp
index e8c2749c..e4b89af9 100644
--- a/common/TracySocket.cpp
+++ b/common/TracySocket.cpp
@@ -436,7 +436,11 @@ IpAddress::~IpAddress()
void IpAddress::Set( const struct sockaddr& addr )
{
+#if __MINGW32__
+ auto ai = (struct sockaddr_in*)&addr;
+#else
auto ai = (const struct sockaddr_in*)&addr;
+#endif
inet_ntop( AF_INET, &ai->sin_addr, m_text, 17 );
m_number = ai->sin_addr.s_addr;
}
diff --git a/profiler/src/ResolvService.cpp b/profiler/src/ResolvService.cpp
index 845258e3..a60ccc2b 100644
--- a/profiler/src/ResolvService.cpp
+++ b/profiler/src/ResolvService.cpp
@@ -1,4 +1,4 @@
-#ifdef _MSC_VER
+#ifdef _WIN32
# include <ws2tcpip.h>
#else
# include <arpa/inet.h>
diff --git a/server/TracyPrint.cpp b/server/TracyPrint.cpp
index e3e17aa7..229ca194 100644
--- a/server/TracyPrint.cpp
+++ b/server/TracyPrint.cpp
@@ -1,12 +1,16 @@
#ifdef _MSC_VER
# pragma warning( disable: 4244 ) // conversion from don't care to whatever, possible loss of data
#endif
+#ifdef __MINGW32__
+# define __STDC_FORMAT_MACROS
+#endif
#include <assert.h>
#include <inttypes.h>
#include <math.h>
#include <stdint.h>
#include <stdio.h>
+#include <stdlib.h> // llabs()
#include <string.h>
#include "TracyPrint.hpp"
diff --git a/server/TracyStorage.cpp b/server/TracyStorage.cpp
index 1e10f166..9fda5f28 100644
--- a/server/TracyStorage.cpp
+++ b/server/TracyStorage.cpp
@@ -1,3 +1,6 @@
+#ifdef __MINGW32__
+# define __STDC_FORMAT_MACROS
+#endif
#include <assert.h>
#include <inttypes.h>
#include <string>