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.
This commit is contained in:
Bartosz Taudul 2019-05-01 12:57:42 +02:00
parent 303bbdd512
commit 9ec8704dad
2 changed files with 5 additions and 5 deletions

View File

@ -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;
}

View File

@ -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<uint32_t> m_zoneId;
LZ4_stream_t* m_stream;
void* m_stream; // LZ4_stream_t*
char* m_buffer;
int m_bufferOffset;
int m_bufferStart;