Mail Archives: djgpp/1998/01/01/14:30:33
I have found quite a few replies that really have no relevancy to the
problem. The WIndows SDK wants to maintain backward compatibility. However
in this case you don't want to remove the FARs because of keeping the
compatibiliity. You will want to find where FAR is defined and add
something like #ifdef DJGPP #define FAR #endif This would keep
compatibility yet remove th need for fars, as they are frivolous in Win32
programming.
For more clarification the FAR definition was supposed to be defined to the
compiler specific directive that caused it to use a 32-bit pointer instead
of a 16-bit pointer (like in MSVC this was far (this was important in WIn16
days) For compatibility and porting ease, they kept the definition yet
since all pointers are 32-bit in 32-bit programming there is really no need
to explictily state that so we define the FAR to be nothing: #define FAR.
Hope this helps,
John Luebs
John Luebs
Thomas Mulgrew <no AT email DOT addr> wrote in article
<6852am$hkb$1 AT newsource DOT ihug DOT co DOT nz>...
> I'm completely new to socket programming (or windows for that matter),
and
> having a bit of trouble getting started.
>
> When I compile a file that #includes winsock.h (using gcc -Zwin32
prog.cpp -c
> -o prog.o or something along those lines), the compiler reports parse
errors
> while in the winsock.h file.
>
> Generated by lines like this:
>
> struct hostent FAR * PASCAL FAR gethostbyname(const char FAR * name);
>
> And the parse error is reported to be "before __attribute__"
>
> I'm not exactly sure what FAR means in a 32bit addressing mode context,
but
> that aside I believe the line is declaring a function 'gethostbyname', to
be
> called using the pascal calling convention, and which returns a pointer
to a
> hostent structure.
>
> What I would like to know is: what does 'FAR' mean here (can I throw them
out)?
> Do I need to change winsock.h in order to make it parse properly?, and
> ultimately, how do I make this file parse?
>
> -Tom
>
>
- Raw text -