Core/DB2: Wrap DB2 structures in #pragma pack(1) to prevent byte padding and allow correct reading on all platforms
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user