Re: Gtk+ 2.3 ABI breakage or Gtk-Error **: incompatible build!

On Fri, 2003-10-31 at 18:21, Tor Lillqvist wrote:
> Owen Taylor writes:
>  > Do you happen to have a reference for the MS bitfield rules?
> I guess the ultimate reference is in the gcc sources ;-). (I don't
> know whether the -mms-bitfields flag implementation is included in the
> official sources, or just in some mingw/cygwin gcc patch set.) There
> might be some discussion in some gcc mailing list archive, let's see..

Looked at that some, and apparently the relevant rule that is causing
the difference here, is that bitfields will be packed into a storage
unit of the underlying type of the bitfield. E.g., with GCC's normal

 guint8  a:1;
 guint16 b:1;
 guint32 c:1;

is all packed into 1 32 bit word, but MSVC will pack it as 
8-bit word, 8-bit pad, 16-bit word, 32-bit word.

Which is a useful thing to know for saving a bit of space on Win32 in
our structures for future additions.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]