Mail Archives: djgpp/1998/02/08/16:47:10
pneyz wrote:
>
> > If I try to include this in a simple program, gcc complains about the
> > use of semicolons in a structure and (it seems) about the use of
> > 'BYTE'. Is the above just meant to be a very formal looking piece of
> > pseudocode, or can one actually declare bytes and words (2 bytes?) in
> > this manner?
>
> BYTE and WORD are not defined be default, so most coders put something
> like:
>
> typedef unsigned char byte;
> typedef unsigned int word;
>
> In their code for gfx routines. However, in DJGPP, an int is 4 bytes by
> default, so you should change the int to a short. byte and word are not
> C identifiers, but are holdovers from asm (I think).
Additionally you may have to put a
#pragma pack(1)
before and a
#pragma pack()
after the struct definition, because otherwise gcc will align
struct members to d(?)word boundaries. I am pretty, but not completely,
sure that a TGA header is packed with no spare space between members.
--
Ciao
Tom
*************************************************************
* Thomas Demmer *
* Lehrstuhl fuer Stroemungsmechanik *
* Ruhr-Uni-Bochum *
* Universitaetsstr. 150 *
* D-44780 Bochum *
* Tel: +49 234 700 6434 *
* Fax: +49 234 709 4162 *
* http://www.lstm.ruhr-uni-bochum.de/~demmer *
*************************************************************
- Raw text -