Subject: Re: FW: Re: wxwin port
From: [email-masked] (J.J.Farrell)

10 Nov 1996 22:11:38 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
Content-Type: text
Original-To: [email-masked] (Keith Gary Boyce)
Original-Cc: [email-masked]
In-Reply-To: <[email-masked]> from "Keith Gary Boyce" at Nov 10, 96 02:32:01 am
X-Mailer: ELM [version 2.4 PL23]
Content-Length: 874       
Original-Sender: [email-masked]

> From: Keith Gary Boyce <[email-masked]>
> 
> Does anyone have any input on why 16 bytes from gnu-win32 and
> 14 for other compiler
> 
> >typedef struct tagBITMAPFILEHEADER {
> >        WORD    bfType;
> >        DWORD   bfSize;
> >        WORD    bfReserved1;
> >        WORD    bfReserved2;
> >        DWORD   bfOffBits;
> >} BITMAPFILEHEADER, FAR *LPBITMAPFILEHEADER, *PBITMAPFILEHEADER;
> 
> WORD is 16 bits=2 bytes, DWORD is 32 bits=4 bytes, so this is
> 
> 3 * 2 + 2 * 4 = 14

The C language allows compilers to add padding between structure
members and at the end of a structure as they see fit. It looks
like the compilers you are using have different views on what is
fitting! You cannot portably determine the size of a structure
from the sizes of its members. The documentation should include
information on how the compiler does this padding.

Regards,
		jjf
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".