Re: [Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-30 Thread Stefan Weil
Am 30.08.2011 20:29, schrieb Paolo Bonzini: On 08/30/2011 07:57 PM, Blue Swirl wrote: > > +#if defined(_WIN32) > +# define QEMU_PACKED __attribute__((gcc_struct, packed)) Maybe we could also use gcc_struct also for non-win32? > +#else > +# define QEMU_PACKED __attribute__((packed)) > +#e

Re: [Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-30 Thread Paolo Bonzini
On 08/30/2011 07:57 PM, Blue Swirl wrote: > > +#if defined(_WIN32) > +# define QEMU_PACKED __attribute__((gcc_struct, packed)) Maybe we could also use gcc_struct also for non-win32? > +#else > +# define QEMU_PACKED __attribute__((packed)) > +#endif Indeed. Paolo

Re: [Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-30 Thread Blue Swirl
On Sun, Aug 28, 2011 at 8:43 PM, Stefan Weil wrote: > A packed struct needs different gcc attributes for compilations > with MinGW compilers because glib-2.0 adds compiler flag > -mms-bitfields which modifies the packing algorithm. > > Attribute gcc_struct reverses the negative effects of -mms-bit

Re: [Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-28 Thread Stefan Weil
Am 28.08.2011 22:47, schrieb Andreas Färber: Am 28.08.2011 um 22:43 schrieb Stefan Weil: A packed struct needs different gcc attributes for compilations with MinGW compilers because glib-2.0 adds compiler flag -mms-bitfields which modifies the packing algorithm. Is that algorithm actually nee

Re: [Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-28 Thread Andreas Färber
Am 28.08.2011 um 22:43 schrieb Stefan Weil: A packed struct needs different gcc attributes for compilations with MinGW compilers because glib-2.0 adds compiler flag -mms-bitfields which modifies the packing algorithm. Is that algorithm actually needed anywhere? If not, is there no GCC option

[Qemu-devel] [PATCH 1/7] Add new macro QEMU_PACKED for packed C structures

2011-08-28 Thread Stefan Weil
A packed struct needs different gcc attributes for compilations with MinGW compilers because glib-2.0 adds compiler flag -mms-bitfields which modifies the packing algorithm. Attribute gcc_struct reverses the negative effects of -mms-bitfields. QEMU_PACKED sets this attribute and must be used for a