From 16aca3a6bfbbc7f514025a94ba52e57699aec11c Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 7 Feb 2021 12:33:56 +0100 Subject: [PATCH 1/2] Fixed compile for Windows --- src/protocol/RawCommand.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/protocol/RawCommand.h b/src/protocol/RawCommand.h index 0e0c421..a543009 100644 --- a/src/protocol/RawCommand.h +++ b/src/protocol/RawCommand.h @@ -21,7 +21,11 @@ namespace ts::command { CommandFragment(const CommandFragment& other) = default; CommandFragment(CommandFragment&&) = default; }; + + /* Windows aligns stuff somewhat different */ +#ifndef WIN32 static_assert(sizeof(CommandFragment) == 8 + sizeof(pipes::buffer)); +#endif struct ReassembledCommand { public: From 075ac4cb27377bd1451b02862e672ddd64f445cb Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 7 Feb 2021 15:04:01 +0100 Subject: [PATCH 2/2] Fixed client compile --- CMakeLists.txt | 15 ++++++++------- src/misc/memtracker.h | 2 +- src/protocol/PacketDecoder.h | 4 ---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ea3e68b..7bff075 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -121,6 +121,13 @@ set(SOURCE_FILES src/protocol/buffers_allocator_c.cpp src/protocol/CryptHandler.cpp src/protocol/CompressionHandler.cpp + src/protocol/ringbuffer.cpp + src/protocol/AcknowledgeManager.cpp + src/protocol/PacketLossCalculator.cpp + src/protocol/RawCommand.cpp + src/protocol/PacketDecoder.cpp + src/protocol/PingHandler.cpp + src/protocol/PacketStatistics.cpp src/Properties.cpp src/Error.cpp @@ -134,13 +141,6 @@ set(SOURCE_FILES src/bbcode/bbcodes.cpp src/channel/TreeView.cpp - src/protocol/ringbuffer.cpp - src/protocol/AcknowledgeManager.cpp - src/protocol/PacketLossCalculator.cpp - src/protocol/RawCommand.cpp - src/protocol/PacketDecoder.cpp - src/protocol/PingHandler.cpp - src/protocol/PacketStatistics.cpp ) set(HEADER_FILES @@ -189,6 +189,7 @@ endif() if(FEATURE_LOGGING) set(SOURCE_FILES ${SOURCE_FILES} src/misc/memtracker.cpp) set(HEADER_FILES ${HEADER_FILES} src/misc/memtracker.h) + add_definitions(-DFEATURE_MEMTRACK) else() message("Missing logging support. Don't build mem tracker") endif() diff --git a/src/misc/memtracker.h b/src/misc/memtracker.h index 0cdc2d5..dd0b4de 100644 --- a/src/misc/memtracker.h +++ b/src/misc/memtracker.h @@ -5,7 +5,7 @@ namespace memtrack { #define TRACK_OBJECT_ALLOCATION -#ifdef TRACK_OBJECT_ALLOCATION +#if defined(FEATURE_MEMTRACK) && defined(TRACK_OBJECT_ALLOCATION) extern void allocated(const char* name, void* address); extern void freed(const char* name, void* address); template diff --git a/src/protocol/PacketDecoder.h b/src/protocol/PacketDecoder.h index a98647e..1a71671 100644 --- a/src/protocol/PacketDecoder.h +++ b/src/protocol/PacketDecoder.h @@ -12,10 +12,6 @@ namespace ts::connection { class CryptHandler; } -namespace ts::stats { - class ConnectionStatistics; -} - namespace ts::protocol { enum struct PacketProcessResult { SUCCESS,