diff --git a/source/network/NMTCreator.h b/source/network/NMTCreator.h index 1753289194..c5d46b97e8 100644 --- a/source/network/NMTCreator.h +++ b/source/network/NMTCreator.h @@ -44,6 +44,8 @@ #define CREATING_NMT +#ifndef NMT_CREATOR_IMPLEMENT + /*************************************************************************/ // Pass 1, class definition #define NMT_CREATOR_PASS_CLASSDEF @@ -117,7 +119,7 @@ public: \ #include "NMTCreator.h" #undef NMT_CREATOR_PASS_CLASSDEF -#ifdef NMT_CREATOR_IMPLEMENT +#else // NMT_CREATOR_IMPLEMENT #include "StringConverters.h" diff --git a/source/network/NetMessage.cpp b/source/network/NetMessage.cpp index 1c87b444de..fbd6ab9013 100644 --- a/source/network/NetMessage.cpp +++ b/source/network/NetMessage.cpp @@ -27,10 +27,13 @@ #include "precompiled.h" #include "simulation/Entity.h" #include "ps/Vector2D.h" -#define ALLNETMSGS_IMPLEMENT -#include "NetMessage.h" #include "ps/CLogger.h" #include "Network.h" +#include "NetMessage.h" + +#undef ALLNETMSGS_DONT_CREATE_NMTS +#define ALLNETMSGS_IMPLEMENT +#include "NetMessages.h" #include #include diff --git a/source/network/Network.h b/source/network/Network.h index c3853b45fb..7175dd9749 100644 --- a/source/network/Network.h +++ b/source/network/Network.h @@ -66,6 +66,7 @@ MORE INFO #include "StreamSocket.h" #include "NetMessage.h" +#include "lib/bits.h" // round_up #include #include @@ -73,9 +74,7 @@ MORE INFO //------------------------------------------------- // Typedefs and Macros //------------------------------------------------- -#define BLOCK_SIZE 4096 -#define ALIGN_UP( _n, _block ) ( _n + _block - (_n % _block ) ) -#define ALIGN_BLOCK( _n ) ALIGN_UP( _n, BLOCK_SIZE ) +#define ALIGN_BLOCK( _n ) round_up(size_t(_n), size_t(4096)) typedef CLocker > CLockedMessageDeque;