www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/11/15/08:48:19

From: sorinb AT sky DOT dsp DOT pub DOT ro (Balea Mihai Sorin)
Subject: Re: Question about DJGPP C syntax
To: 93602081 AT neptune DOT np DOT ac DOT sg (Teng Yong Jeffrey)
Date: Wed, 15 Nov 1995 14:57:42 +0200 (EET)
Cc: djgpp AT sun DOT soe DOT clarkson DOT edu

On Wed, Nov 15, Teng Yong Jeffrey wrote:
> 
> I recently downloaded a public-domain text windowing package
> in the form of c-winsrc.txt from garbo.uwasa.fi
> 
> I unzipped the files inside and try compiling them, but
> somehow I couldn't get DJGPP to recognize the "far"
> declarations - what's the problem?
> 
> the code is ...
>    .... ScrRestoreRect (...)
>       {
>       ....;
>       unsigned char far *fpBuf;
>       ...;
>       }
> 
> I've been searching for documentation on the syntax of C
> as allowed by DJGPP and the documentation for the C
> functions. Where can they be found?
> I can't seem to find them anywhere (and I've downloaded
> gcc263dc.zip)
> 
"far" declaration are specific to 16 bit compilers as Borland, where you
have two types of pointer : "near" ( 16 bit offset ) and "far" ( 16 bit
segment + 16 bit offset ).
With djgpp you only have one type of pointers ( 32 bit offset -- you can
call them "near" if you want ).In fact that is one of the strongest
points of flat protected mode programming.
So , all you have to do is to remove the "far" word from declarations.
Be warned that your code may contain other elements specific to 16 bit
programming that won't work with djgpp.

About the documentation, gcc complies with ANSI standard, so any book
about this will do. ( The online docs don't explain the C syntax , as
this is supposed to be known. However, they explain all the standard
functions )

Hope this helps,

Sorin Balea -- sorinb AT sky DOT dsp DOT pub DOT ro

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019