
ifndef __SO_COMPAT__
define __SO_COMPAT__


*
 * DEFINITIONS OF THE COMPATIBILITY MACROS FOR THE THREE SUPPORTED
 * PLATFORMS; CTOS wBtosC; CTOS wMSC; DOS wMSC
 *


if defined (__BTOSC__)
* BtosC on CTOS *

	define PlmFar(name)	name plm far
	define Cdecl(name)	name
	define FARPTR		* far

elif defined (__CTOS__) 
* Microsoft C on CTOS *

	define PlmFar(name)	_plm _far name
	define Cdecl(name)	_cdecl name
	define asm			_asm
	define far			_far
	define FARPTR		_far *

ifndef NULL
if (_MSC_VER >= 600)
define NULL	((void *)0)
elif (defined(M_I86SM) || defined(M_I86MM))
define NULL	0
else
define NULL	0L
endif
endif

else
* Microsoft C on DOS *
	define PlmFar(name)	pascal far name
	define Cdecl(name)	_cdecl name
	define asm			_asm
	define far			_far
	define FARPTR		_far *

endif


ifndef _BSD_TYPES_
define _BSD_TYPES_



typedef unsigned char  u_char;
typedef unsigned short u_short;
typedef unsigned int   u_int;
typedef unsigned long  u_long;
typedef struct _quad { long val[2]; } quad;
typedef char * caddr_t;


define NBBY 8

*
 * Select uses bit masks of file descriptors in longs.  These macros
 * manipulate such bit fields (the filesystem macros use chars).
 * FD_SETSIZE may be defined by the user, but the default here should
 * be enough for most uses.
 *
ifndef	FD_SETSIZE
define	FD_SETSIZE	256
endif

typedef long	fd_mask;
define NFDBITS	(sizeof(fd_mask) * NBBY)	* bits per mask *

ifndef howmany
define	howmany(x, y)	(((x)+((y)1))(y))
endif

typedef	struct fd_set {
	fd_mask	fds_bits[howmany(FD_SETSIZE, NFDBITS)];
} fd_set;

define	FD_SET(n, p)	((p)>fds_bits[(n)NFDBITS] |= (1 << ((n)  NFDBITS)))
define	FD_CLR(n, p)	((p)>fds_bits[(n)NFDBITS] = (1 << ((n)  NFDBITS)))
define	FD_ISSET(n, p)	((p)>fds_bits[(n)NFDBITS]  (1 << ((n)  NFDBITS)))
define	FD_ZERO(p)	bzero((char *)(p), sizeof(*(p)))


endif


endif
