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:
Marc-André Lureau 2010-12-29 14:23:59 +01:00 committed by Hans de Goede
parent 097a177968
commit 1043a5df4d
2 changed files with 5 additions and 3 deletions

View File

@ -33,8 +33,6 @@
#undef SPICE_ATTR_PACKED
#ifndef __GNUC__
#if defined(__MINGW32__) || !defined(__GNUC__)
#pragma pack(pop)
#endif

View File

@ -49,6 +49,10 @@
#define SPICE_ATTR_PACKED __attribute__ ((__packed__))
#ifdef __MINGW32__
#pragma pack(push,1)
#endif
#else
#pragma pack(push)