diff options
Diffstat (limited to 'sibs/SafeSerializer.hpp')
-rw-r--r-- | sibs/SafeSerializer.hpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sibs/SafeSerializer.hpp b/sibs/SafeSerializer.hpp index 72ef5a3..379b7c8 100644 --- a/sibs/SafeSerializer.hpp +++ b/sibs/SafeSerializer.hpp @@ -22,7 +22,7 @@ namespace sibs { usize offset = buffer.size(); buffer.resize(buffer.size() + sizeof(T)); - #ifdef LITTLE_ENDIAN + #if BYTE_ORDER == BIG_ENDIAN switch(sizeof(T)) { case 1: @@ -47,7 +47,7 @@ namespace sibs } } #else - memcpy(&buffer[offset], &data, sizeof(T)); + *(T*)&buffer[offset] = data; #endif } |