Does anyone know what this is? It's in a piece of code I'm trying to debug, and I've never seen it:

typedef void FAR * socktag;

Also, could someone explain the difference between these two lines (after the typedef executes):

socktag SMTPSock;
int SMTPSock;

Edited 5 Years Ago by Duki: n/a

My questions continue to become more and more complex - sorry. How does this:

int (FAR PASCAL *pgensock_getchar) (socktag st, int wait, char FAR * ch);

compare to this:

int gensock_getchar (int st, int wait, char * ch)
{
   int retval = 0;
   connection *conn;

   conn = (connection *)st;

   if ((retval = conn->cc_getchar(wait, ch)))
      return (retval);
   else
      return (0);
}

Does anyone know what this is?

It's just a macro that's either blank or represents the compiler's keyword for a far pointer (à la Intel's 16-bit segmented memory model).

could someone explain the difference between these two lines (after the typedef executes)

One is a pointer, the other is an int? That should be obvious.

Here is a complete explanation if you're really all that interested. Applies to 16-bit MS-DOS compilers. If you want to port a 16-bit program to 32-bit compiler than just define FAR to be empty

#ifdef FAR
#undef FAR
#endif
#define FAR

You will want to do the same with NEAR

Edited 5 Years Ago by Ancient Dragon: n/a

This article has been dead for over six months. Start a new discussion instead.