From 9ec8704dad8b683ae9f1b263dc138d395196f3bb Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Wed, 1 May 2019 12:57:42 +0200 Subject: [PATCH] Don't include LZ4 headers in tracy headers. The LZ4 implementation is wrapped in tracy namespace, but it also adds some defines, which may conflict with other LZ4 implementations. --- client/TracyProfiler.cpp | 7 ++++--- client/TracyProfiler.hpp | 3 +-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index f31b8640..37107797 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -45,6 +45,7 @@ #include "../common/TracyProtocol.hpp" #include "../common/TracySocket.hpp" #include "../common/TracySystem.hpp" +#include "../common/tracy_lz4.hpp" #include "tracy_rpmalloc.hpp" #include "TracyCallstack.hpp" #include "TracyScoped.hpp" @@ -1031,7 +1032,7 @@ Profiler::~Profiler() tracy_free( m_lz4Buf ); tracy_free( m_itemBuf ); tracy_free( m_buffer ); - LZ4_freeStream( m_stream ); + LZ4_freeStream( (LZ4_stream_t*)m_stream ); if( m_sock ) { @@ -1155,7 +1156,7 @@ void Profiler::Worker() HandshakeStatus handshake = HandshakeWelcome; m_sock->Send( &handshake, sizeof( handshake ) ); - LZ4_resetStream( m_stream ); + LZ4_resetStream( (LZ4_stream_t*)m_stream ); m_sock->Send( &welcome, sizeof( welcome ) ); #ifdef TRACY_ON_DEMAND @@ -1540,7 +1541,7 @@ bool Profiler::NeedDataSize( size_t len ) bool Profiler::SendData( const char* data, size_t len ) { - const lz4sz_t lz4sz = LZ4_compress_fast_continue( m_stream, data, m_lz4Buf + sizeof( lz4sz_t ), (int)len, LZ4Size, 1 ); + const lz4sz_t lz4sz = LZ4_compress_fast_continue( (LZ4_stream_t*)m_stream, data, m_lz4Buf + sizeof( lz4sz_t ), (int)len, LZ4Size, 1 ); memcpy( m_lz4Buf, &lz4sz, sizeof( lz4sz ) ); return m_sock->Send( m_lz4Buf, lz4sz + sizeof( lz4sz_t ) ) != -1; } diff --git a/client/TracyProfiler.hpp b/client/TracyProfiler.hpp index a5b592f1..cfcf966e 100644 --- a/client/TracyProfiler.hpp +++ b/client/TracyProfiler.hpp @@ -11,7 +11,6 @@ #include "TracyCallstack.hpp" #include "TracySysTime.hpp" #include "TracyFastVector.hpp" -#include "../common/tracy_lz4.hpp" #include "../common/TracyQueue.hpp" #include "../common/TracyAlign.hpp" #include "../common/TracyAlloc.hpp" @@ -450,7 +449,7 @@ private: bool m_noExit; std::atomic m_zoneId; - LZ4_stream_t* m_stream; + void* m_stream; // LZ4_stream_t* char* m_buffer; int m_bufferOffset; int m_bufferStart;