mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice-protocol
synced 2025-12-30 17:49:00 +00:00
mingw32: specify packing alignment to 1 byte, to override -mms-bitfield
Ex: G_STRUCT_OFFSET(SpiceLinkReply, num_channel_caps) is 172 bytes when compiled with -mms-bitfield, and 170 bytes without. GLib/Gtk are compiled with -mms-bitfield, and it is necessary to compile with the same option for compatibility. The pack pragma for MINGW32 corrects the structure alignement. We could use the pack pragma for GNUC unconditionally, that could help to ensure struct binary compatibility between different compiled flavours.
This commit is contained in:
parent
097a177968
commit
1043a5df4d
@ -33,8 +33,6 @@
|
||||
|
||||
#undef SPICE_ATTR_PACKED
|
||||
|
||||
#ifndef __GNUC__
|
||||
|
||||
#if defined(__MINGW32__) || !defined(__GNUC__)
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif
|
||||
|
||||
@ -49,6 +49,10 @@
|
||||
|
||||
#define SPICE_ATTR_PACKED __attribute__ ((__packed__))
|
||||
|
||||
#ifdef __MINGW32__
|
||||
#pragma pack(push,1)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#pragma pack(push)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user