Mail Archives: djgpp/2000/10/20/16:15:16
see DOT sig AT for DOT email DOT address (Peter B. Steiger) writes:
> Can somebody translate this to English for me? I grew up on Pascal
> and went from there to Clipper where I earn a living, so I have never
> been able to wrap my mind around C syntax. This week I'm trying to
> write a C module to link in with my Clipper program, and the Clipper
> headers required for such a project make some definitions that were
> apparently written for the Evil Empire's compiler; gcc gags on them
> with "Parse error before *". Here's an example:
>
> typedef unsigned char BYTE;
> typedef BYTE far *BYTEP;
> typedef BYTEP PBYTE;
>
> What the heck does that mean, and why doesn't gcc like it?
Essentially, it makes the type `BYTE' as another name for `unsigned
char'; the type `BYTEP' meaning far pointer to BYTE; and PBYTE meaning
the same as BYTEP. Poor style, IMHO; I'd rather see just BYTE, and
the rest written BYTE * where necessary.
Anyway, the reason the compiler doesn't like it is `far'. This is a
relic of 16-bit DOS compilers. The FAQ explains how to handle it, but
the easiest thing to try is just to get rid of it; try
#define far /* nothing */
before including the header, and see if that works.
--
Nate Eldredge
neldredge AT hmc DOT edu
- Raw text -