diff options
| author | Shauren <shauren.trinity@gmail.com> | 2011-12-17 14:37:00 +0100 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2011-12-17 14:37:00 +0100 |
| commit | cef048beba21261e9bd224c9649789d2e3438692 (patch) | |
| tree | 86fd60dee600cadcc2b0ddedd9aa0eefe08850b2 | |
| parent | 1af4d40be6d689a12ccf2fd1b45c7f950be0c3ac (diff) | |
Core/DB2: Wrap DB2 structures in #pragma pack(1) to prevent byte padding and allow correct reading on all platforms
| -rw-r--r-- | src/server/game/DataStores/DB2Structure.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/server/game/DataStores/DB2Structure.h b/src/server/game/DataStores/DB2Structure.h index ae070924b5b..e4632e835d8 100644 --- a/src/server/game/DataStores/DB2Structure.h +++ b/src/server/game/DataStores/DB2Structure.h @@ -30,6 +30,13 @@ #include <set> #include <vector> +// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform +#if defined(__GNUC__) +#pragma pack(1) +#else +#pragma pack(push, 1) +#endif + // Structures used to access raw DB2 data and required packing to portability struct ItemEntry { @@ -138,4 +145,11 @@ struct ItemExtendedCostEntry //uint32 Unknown[5]; // 26-30 }; +// GCC has alternative #pragma pack(N) syntax and old gcc version does not support pack(push, N), also any gcc version does not support it at some platform +#if defined(__GNUC__) +#pragma pack() +#else +#pragma pack(pop) +#endif + #endif
\ No newline at end of file |
