This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Re: packed structures
- To: "Tom Stokes" <tstokes at pacbell dot net>, "CYGWIN32" <gnu-win32 at cygnus dot com>
- Subject: Re: packed structures
- From: "Tom Stokes" <tstokes at pacbell dot net>
- Date: Wed, 12 Aug 1998 09:36:41 -0700
Thanks to all that replied. This does work. The size is 9.
typedef struct HeaderTag {
ULONG HeaderLength;
CHAR PackingType;
USHORT NumRows;
USHORT PackedSize;
} __attribute__ ((packed)) HeaderType, *pHeaderType;
Tom Stokes
If anyone is interested, this is from manpages:
----------------------------------------------------------------------------
----------------------------------------
packed
The packed attribute specifies that a variable or structure field should
have the
smallest possible alignment--one byte for a variable, and one bit for a
field,
unless you specify a larger value with the aligned attribute.
Here is a structure in which the field x is packed, so that it
immediately follows a:
struct foo
{
char a;
int x[2] __attribute__ ((packed));
};
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".