Mail Archives: djgpp/1997/02/23/23:42:24
On Sun, 23 Feb 1997, Delong wrote:
> I am trying to get the VBE implementation to return a VBEInfoBlock, and
> VBEInfoBlock is supposed to be 512 bytes long, but the structure I
> defined after the VBE 2.0 specs to have 512 bytes (I counted them) is
> turning out to be 516 bytes long!
>
The FAQ explains this (I'm not at a DOS box now so I can't grep it to tell
you where. Anyway, structures are padded by DJGPP for performance
reasons. This is typically not a problem because it is done so
consistently. However, there are times when structres are used to access
files that are of a particular format (like dBASE III files) and these are
not padded the way DJGPP would. There are a few solutions here. The one
I use (which some on this list have said is "evil" - sorry :) is to use a
#pragma pack(1) before the declaration of the structure you want packed.
The FAQ gives other solutions to this problem.
Hope this helps.
David May
ID Card Adminstrator
Albuquerque TVI
- Raw text -