Skip to content

Commit

Permalink
splitting out cpp files
Browse files Browse the repository at this point in the history
  • Loading branch information
gafferongames committed Dec 25, 2023
1 parent f4129e7 commit 6f32a45
Show file tree
Hide file tree
Showing 8 changed files with 587 additions and 510 deletions.
2 changes: 1 addition & 1 deletion premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ project "yojimbo"
kind "StaticLib"
links { "reliable", "netcode", "tlsf" }
files { "yojimbo.h", "yojimbo.cpp", "yojimbo_**.h", "yojimbo_**.cpp" }
defines { "SERIALIZE_ENABLE_TESTS=1" }

project "client"
files { "client.cpp", "shared.h" }
Expand All @@ -76,6 +75,7 @@ project "soak"
project "test"
files { "test.cpp" }
links { "yojimbo", "sodium", "tlsf", "netcode", "reliable" }
defines { "SERIALIZE_ENABLE_TESTS=1" }

newaction
{
Expand Down
12 changes: 6 additions & 6 deletions serialize/serialize.h
Original file line number Diff line number Diff line change
Expand Up @@ -2333,7 +2333,7 @@ namespace serialize

#include <time.h>

static void SerializeCheckHandler( const char * condition,
inline void SerializeCheckHandler( const char * condition,
const char * function,
const char * file,
int line )
Expand All @@ -2358,7 +2358,7 @@ do
} \
} while(0)

void test_endian()
inline void test_endian()
{
uint32_t value = 0x11223344;

Expand All @@ -2381,7 +2381,7 @@ void test_endian()
#endif // #if SERIALIZE_LITTLE_ENDIAN
}

void test_bitpacker()
inline void test_bitpacker()
{
const int BufferSize = 256;

Expand Down Expand Up @@ -2440,7 +2440,7 @@ void test_bitpacker()
serialize_check( reader.GetBitsRemaining() == bytesWritten * 8 - bitsWritten );
}

void test_bits_required()
inline void test_bits_required()
{
serialize_check( serialize::bits_required( 0, 0 ) == 0 );
serialize_check( serialize::bits_required( 0, 1 ) == 1 );
Expand Down Expand Up @@ -2576,7 +2576,7 @@ struct TestObject
}
};

void test_stream()
inline void test_stream()
{
const int BufferSize = 1024;

Expand Down Expand Up @@ -2614,7 +2614,7 @@ void test_stream()
} \
while (0)

void serialize_test()
inline void serialize_test()
{
// while ( 1 )
{
Expand Down
3 changes: 1 addition & 2 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include <inttypes.h>

#include "shared.h"
#include "serialize.h"

using namespace yojimbo;

Expand Down Expand Up @@ -2246,8 +2247,6 @@ void test_single_message_type_unreliable()
} \
while (0)

void serialize_test();

extern "C" void netcode_test();

extern "C" void reliable_test();
Expand Down
Loading

0 comments on commit 6f32a45

Please sign in to comment.