mirror of
https://github.com/wolfpld/tracy.git
synced 2024-11-27 08:14:34 +00:00
Merged in rokups/tracy/mingw-fixes (pull request #39)
Fix multiple build errors when compiling with MinGW.
This commit is contained in:
commit
37b03559f0
@ -35,6 +35,19 @@ CallstackEntry cb_data[MaxCbTrace];
|
|||||||
|
|
||||||
extern "C" { t_RtlWalkFrameChain RtlWalkFrameChain = 0; }
|
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()
|
void InitCallstack()
|
||||||
{
|
{
|
||||||
#ifdef UNICODE
|
#ifdef UNICODE
|
||||||
|
@ -235,7 +235,7 @@ static int64_t SetupHwTimer()
|
|||||||
#elif defined TRACY_HW_TIMER && ( defined __i386 || defined _M_IX86 || defined __x86_64__ || defined _M_X64 )
|
#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 )
|
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 );
|
__cpuidex( (int*)regs, leaf, 0 );
|
||||||
#else
|
#else
|
||||||
__get_cpuid( leaf, regs, regs+1, regs+2, regs+3 );
|
__get_cpuid( leaf, regs, regs+1, regs+2, regs+3 );
|
||||||
|
@ -436,7 +436,11 @@ IpAddress::~IpAddress()
|
|||||||
|
|
||||||
void IpAddress::Set( const struct sockaddr& addr )
|
void IpAddress::Set( const struct sockaddr& addr )
|
||||||
{
|
{
|
||||||
|
#if __MINGW32__
|
||||||
|
auto ai = (struct sockaddr_in*)&addr;
|
||||||
|
#else
|
||||||
auto ai = (const struct sockaddr_in*)&addr;
|
auto ai = (const struct sockaddr_in*)&addr;
|
||||||
|
#endif
|
||||||
inet_ntop( AF_INET, &ai->sin_addr, m_text, 17 );
|
inet_ntop( AF_INET, &ai->sin_addr, m_text, 17 );
|
||||||
m_number = ai->sin_addr.s_addr;
|
m_number = ai->sin_addr.s_addr;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _WIN32
|
||||||
# include <ws2tcpip.h>
|
# include <ws2tcpip.h>
|
||||||
#else
|
#else
|
||||||
# include <arpa/inet.h>
|
# include <arpa/inet.h>
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
# pragma warning( disable: 4244 ) // conversion from don't care to whatever, possible loss of data
|
# pragma warning( disable: 4244 ) // conversion from don't care to whatever, possible loss of data
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef __MINGW32__
|
||||||
|
# define __STDC_FORMAT_MACROS
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h> // llabs()
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "TracyPrint.hpp"
|
#include "TracyPrint.hpp"
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
#ifdef __MINGW32__
|
||||||
|
# define __STDC_FORMAT_MACROS
|
||||||
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
Loading…
Reference in New Issue
Block a user