Subject: Re: cross-cygwin32; alignement problems
To: Martin Husemann <>
From: Arto Huusko <>
List: tech-pkg
Date: 10/03/2001 19:18:44
On 03-Lok-01, Martin wrote:

>> The w32api defines the PRINTDLG structure in commdlg.h file. The
>> "sizeof" of this structure ends up wrong, preventing me from using it.
>> In the structure, there are 5 WORD fields followed by 32 bit fields
>> and apparently the compiler inserts two bytes of padding after the
>> WORDs.
> I don't know which version of that file you are using, but mine includes
> "pushpack1.h", which then uses #pragma pack to set alignement to 1 byte.
> (Conditionalized on _MSC_VER >= 800)

It is the file from w32api version 1.1 or smth (i.e. not Microsoft's).
It does have at the beginning the #pragma pack(push,1) line.

> To be usefull, the cross compiler needs to honour #pragma pack(push),
> #pragma pack(<number>) and #pragma pack(pop).

Apparently the i386-cygwin32 cross-compiler does not honour it. It
works just fine with the real cygwin's compiler (gcc 2.95.something).

Arto Huusko ( | Diving Is Fun