home *** CD-ROM | disk | FTP | other *** search
- /* host.h - Variations between host machines/compilers defined here. */
-
- /************************************************************************
- * Copyright(C) 1988-91 Neural-Ware Inc *
- * Penn Center West, IV-227, Pittsburgh, PA 15276 *
- * *
- * All rights reserved. No part of this program may be reproduced, *
- * stored in a retrieval system, or tramsmitted, in any form or by any *
- * means, electronic, mechanical, photocopying, recording or otherwise *
- * without the prior written permission of the copyright owner, *
- * Neural-Ware, Inc. *
- ************************************************************************
- */
-
- /* TM : 06-Sep-90: pull together all information into single file */
- /* AWP, TM - add platform detection, more generic #ifdefs */
-
- #ifndef HOST_H
- #define HOST_H 1
-
- /*
- * -----------------------------------------------------------------------
- * SEC 1. MAP SOFTWARE/PLATFORM #IFDEFS ONTO SPECIFIC MACHINE TYPES
- * -----------------------------------------------------------------------
- */
-
- #define MULTIPLAT **error** -- multiple definitions for this platform
-
- #if defined(_CRAY) && defined(_UNICOS)
- /* --------------- xxx xxx ( CRAY ) --------------- */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef CRAY
- #define CRAY 1
- #endif
- #endif
-
- #if defined(mips) && defined(nec) && defined(nec_e48m220) \
- && defined(nec_ews) && defined(nec_ews_risc1) && defined(nec_ews_svr4) \
- && defined(r3000) && defined(unix)
- /* --------------- xxx xxx ( EWS ) --------------- */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef EWS
- #define EWS 1
- #endif
- #endif
-
- #if defined(bsd4_2) && defined(ultrix) && defined(unix) && defined(vax)
- /* --------------- xxx xxx ( VAXULT ) --------------- */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef VAXULT
- #define VAXULT 1
- #endif
- #endif
-
- #if defined(sparc) && defined(sun) && defined(unix)
- /* --------------- xxx xxx ( SUN4 ) --------------- */
- /* oddly enough, while the cc defines sun4 in this case,
- cpp does not. */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef SUN4
- #define SUN4 1
- #endif
- #endif
-
- #if defined(mc68000) && defined(mc68020) && defined(sun) && defined(sun3) \
- && defined(unix)
- /* --------------- xxx xxx ( SUN3 ) --------------- */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef SUN3
- #define SUN3 1
- #endif
- #endif
-
- #if defined(i386) && defined(sun) && defined(sun386) && defined(unix)
- /* --------------- xxx xxx (SUN386) --------------- */
- #ifdef platform
- MULTIPLAT
- #endif
- #define platform
- #ifndef SUN386
- #define SUN386 1
- #endif
- #endif
-
- #if defined(SUN3) || defined (SUN386) || defined (SUN4)
- /* force SUN definition */
- #define SUN 1
- #endif
-
- /*
- * -----------------------------------------------------------------------
- * SEC 2. Set up defaults
- * -----------------------------------------------------------------------
- */
-
- /* undef INT_EQ_SHORT, INT_EQ_LONG by default;
- one must be defined, depending upon the compiler */
-
- #undef INT_EQ_SHORT
- #undef INT_EQ_LONG
-
- /* some compilers do not permit sizeof(int) to be used in a macro; if
- yours does, define SIZEOF_MACRO_OK */
-
- #undef SIZEOF_MACRO_OK
-
- #if !defined(_STDIO_H)
- #include <stdio.h>
- #endif
- #if defined(SKY) && !defined(fileno)
- /* riddle this: SKY's stdio.h will not define fileno unless _K_AND_R
- is set or _MSDOS and __HIGHC__ are set. */
- #define fileno(__stream) ((__stream)->_file)
- #endif
- /*
- * -----------------------------------------------------------------------
- * SEC 3. For each "platform" specify ...
- * The following symbols should be defined as 1 if applicable;
- * undefined otherwise
- *
- * PROTOTYPING : supports function prototyping (or tolerates the syntax)
- * ANSI_HEADER : supports new style function header
- *
- * ELLIPSIS : should be defined as "..." or nothing, depending upon
- * what should be in the last argument of a prototype to indicate
- * that the number of args is variable
-
- * IBM_TYPE : this product is being built for some sort of IBM AT
- * variant - possibilities include standard IBM, NEC, and FUJITSU
- *
- * one of the xxx_KEYS options must be selected, except for X versions
- *
- * IBM_KEYS
- * NEC_KEYS
- * FUJITSU_KEYS
- * SUN_KEYS
- * -----------------------------------------------------------------------
- */
- /**/
- #if (!defined(HOST_IS) && defined(__ZTC__))
- #define HOST_IS "IBM AT,MS-DOS,ZORTECH C"
- #define IBM_TYPE 1
- #define MSDOS 1 /* operating system (predefined by */
- /* Zortech preprocessor) */
- #ifndef DLC
- #define DLC 1 /* compiler - for historical reasons */
- #endif
-
- #define PROTOTYPING 1 /* compiler supports function prototyping */
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_SHORT 1
- #define SIZEOF_MACRO_OK 1
-
- #endif /* __ZTC */
- /**/
- #if (!defined(HOST_IS) && defined(__TURBOC__))
- #define HOST_IS "IBM AT,MS-DOS,TURBO C"
- #define IBM_TYPE 1
- #define MSDOS 1 /* operating system (predefined by */
- /* Zortech preprocessor) */
-
- #define PROTOTYPING 1 /* compiler supports function prototyping */
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_SHORT 1
- #define SIZEOF_MACRO_OK 1
-
- #endif /* __TURBOC__ */
- /**/
-
- /* M_I86 and MSDOS are predefined by Microsoft C compiler */
-
- #if (!defined(HOST_IS) && defined(M_I86))
- #define HOST_IS "IBM 80x86,MS-DOS,MSC 6.0"
-
- #define IBM_TYPE 1
- #define MSC 6 /* set MSC to the version */
-
- #define PROTOTYPING 1 /* compiler supports function prototyping */
-
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_SHORT 1
-
- #endif /* M_I86 */
-
- /**/
- /* IBM AT, MS-DOS, Turbo C */
- #if (!defined(HOST_IS) && defined(__TURBOC__))
- #define HOST_IS "IBM AT,MS-DOS,TURBO C"
- #define IBM_TYPE 1
- #define MSDOS 1 /* operating system */
-
- #define PROTOTYPING 1 /* compiler supports function prototyping */
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_SHORT 1
- #define SIZEOF_MACRO_OK 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #if LPTR
- #define NULL (0L)
- #else
- #define NULL 0
- #endif
- #endif
-
- #endif /* __TURBOC__ */
-
- /**/
- #if defined(IBP)
- /* This must come after the __ZTC__, */
-
- #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
- extern void _assert(char *, char *, unsigned);
-
- #define fprintf ndp_fprintf
- #define vfprintf ndp_vfprintf
- #define fputs ndp_fputs
- #define fputc ndp_fputc
- int ndp_vfprintf(FILE *stream, const char *format, va_list arg);
- int ndp_fprintf(FILE *stream, const char *format, ...);
- int ndp_fputs(const char *s, FILE *stream);
- int ndp_fputc(int c, FILE *stream);
-
- #ifndef M_I86
- #ifndef __TURBOC__
- #ifndef __ZTC__ /* this stuff runs under protected mode */
- #define HOST_IS "IBM 386,MS-DOS,NDP C"
- #define IBM_TYPE 1
-
- #ifndef IBM
- #define IBM 1
- #endif
-
- #ifndef MSDOS
- #define MSDOS 1 /* operating system - defined as arg to make */
- #endif
-
- #define NDP 1 /* compiler */
-
- #define stdprn stderr
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL (0L)
- #endif
-
- /* Unsupported type syntax */
- #define signed
- #define volatile
- #define far
-
- #else /* __ZTC__ */
- #define SERVER 1
- #endif /* __ZTC__ */
- #else /* __TURBOC__ */
- #define SERVER 1
- #endif /* __TURBOC__ */
- #else /* M_I86 */
- #define SERVER 1
- #endif /* M_I86 */
- #endif /* IBP */
-
- /**/
- /* The I860 set may be called when HOST_IS has already been defined */
- /* This must come after the M_I86 stuff */
- #if defined(M860) || defined(A860) || defined(W860)
- #define TWO_MACHINE_MODEL 1
- #define I860 1
- #ifndef M_I86
- #define WORKER 1
- #ifdef M860
- #define HOST_IS "I860, MS-DOS, GreenHills C"
- #else
- #ifdef A860
- #define HOST_IS "I860, MS-DOS, MetaWare C"
- #define assert(e) ((e) || (_assert("e",__FILE__,__LINE__),1))
- extern void _assert(char *, char *, unsigned);
- #else
- /* W860 */
- #define HOST_IS "I860, MS-DOS, ???????? C"
- #endif
- #endif
- #define IBM_TYPE 1
-
- #ifndef IBM
- #define IBM 1
- #endif
-
- #ifndef MSDOS
- #define MSDOS 1 /* operating system - defined as arg to make */
- #endif
-
- #define stdprn stderr
- #define NDP 1 /* compiler */
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL (0L)
- #endif
-
- /* Unsupported type syntax */
- #define signed
- #define volatile
- #define far
-
- #else /* M_I86 */
- #define SERVER 1
- #endif /* M_I86 */
- #endif /* I860 set */
-
- /**/
- #if (!defined(HOST_IS) && defined(NEXT))
- #define HOST_IS "NeXT, Mach, GNU C"
-
- /* machine: Symbol NeXT is defined by GNU C compiler */
- /* operating system: Symbol __MACH__ is defined by GNU C compiler */
- /* compiler: Symbol __GNUC__ is defined when compiling ".c", */
- /* ".s", or ".m" files */
- /* Symbol __OBJC__ is defined when compiling */
- /* Objective C ".m" files */
-
- #ifndef NEXTSTD_H
- #include "appkit/nextstd.h"
- /* brings in math.h, stdio.h, and others */
- /* nextstd.h is included by appkit.h if */
- /* NEXTSTD_H is not defined */
- #endif
-
- #define UNIX 1
-
- #define PROTOTYPING 1 /* GNU C compiler supports prototyping */
- #define ANSI_HEADER 1
- #define ELLIPSIS
-
- #define INT_EQ_LONG 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL (0)
- #endif
-
- typedef void *windowhandle_t; /* whenever used should be cast to id !! */
-
- typedef struct
- {
- float red;
- float green;
- float blue;
- }RGBColor; /* define an RGB color structure */
-
- #endif /* NEXT */
- /**/
- #if (!defined(HOST_IS) && defined(RS6))
- #define HOST_IS "RS-6000,AIX"
-
- #ifndef AIXOS
- #define AIXOS 1 /* AIX operating system */
- #endif
- #define UNIX 1
- #define DGXWIN 1 /* X-windows environment */
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- #undef signed /* chars are unsigned */
- #define const
- #define volatile
- #define cdecl
-
- #endif /* RS6 */
-
- /**/
- #if (!defined(HOST_IS) && defined(VAXULT))
- #define HOST_IS "VAX,ULTRIX"
-
- #ifndef ULTRIX
- #define ULTRIX 1 /* DEC Ultrix operating system */
- #endif
- #define UNIX 1
- #define DGXWIN 1 /* X-windows environment */
-
- #undef ANSI_HEADER
- #undef PROTOTYPING
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- #if 0
- #undef signed /* chars are unsigned */
- #else
- #define signed
- #endif
- #define const
- #define volatile
- #define cdecl
-
- #endif /* VAXULT */
- /**/
- #if (!defined(HOST_IS) && defined(EWS))
- #define HOST_IS "EWS/SVR4"
-
- #ifndef SYSV
- #define SYSV 1 /* System 5 */
- #endif
-
- #ifndef SVR4
- #define SVR4 1 /* System 5 release 4 */
- #endif
-
- #define UNIX 1
-
- #define DGXWIN 1 /* X-windows environment */
-
- #undef PROTOTYPING
- #undef ANSI_HEADER 1
-
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- #undef signed /* chars are unsigned */
- #define const
- #define volatile
- #define cdecl
-
- #endif /* EWS */
- /**/
- #if (!defined(HOST_IS) && defined(CRAY))
- #define HOST_IS "CRAY/UNICOS"
-
- #ifndef UNICOS
- #define UNICOS 1
- #endif
-
- #define UNIX 1
-
- #define DGXWIN 1 /* X-windows environment */
-
- #undef PROTOTYPING
- #undef ANSI_HEADER 1
-
- #define ELLIPSIS ...
-
- /* Actually, an INT is 64 bit */
- #define INT_EQ_LONG 1
-
- #undef signed /* chars are unsigned */
- #define const
- #define volatile
- #define cdecl
-
- #endif /* CRAY */
- /**/
- #if (!defined(HOST_IS) && defined(SKY))
- #define HOST_IS "SKY/SUN4/SUNOS"
-
- #define UNIX 1
- #define DGXWIN 1 /* X-windows environment */
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- #if 0
- #undef signed
- #endif
- #define const
- #define volatile
- #define cdecl
-
- #endif /* SKY */
- /**/
- #if (!defined(HOST_IS) && (defined(SUN)))
- /*if (!defined(HOST_IS) && (defined(SUN))) */
- #define HOST_IS "Sun,BSD Unix,PCC"
-
- #define BSDC 1 /* compiler */
-
- #if defined(SUN4SV) || defined(SUN3) || defined(SUN386)
- #define SUN_KEYS 1 /* keyboard */
- #define DGSUN 1 /* DG routines for SUN */
- typedef char *windowhandle_t;
- #else
- #define DGXWIN 1
- #endif
- #define UNIX 1 /* UNIX operating system for special things */
-
- #ifndef SUNOS_3
- #ifndef SUNOS_4
- #define SUNOS_4 1 /* default to SUN OS/4 */
- #endif
- #endif
-
- #ifdef __TRANSPUTER__
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
- #else
- #undef PROTOTYPING
- #undef ANSI_HEADER
- #define ELLIPSIS
- #define void int /* Unix C doesn't handle void right */
- #endif
-
- #define INT_EQ_LONG 1 /* is this true for all SUNs? */
-
- #define signed /* chars are signed */
- #define const
- #define volatile
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL 0
- #endif
-
- /* BSD still erroneously uses index() and rindex() */
- #define strchr index
- #define strrchr rindex
-
- #endif /* SUN */
- /**/
- #if (!defined(HOST_IS) && (defined(MEIKO)))
-
- #define HOST_IS "MEIKO,Sun host"
-
- #define BSDC 1 /* compiler */
-
- #define DGXWIN 1
-
- #define UNIX 1 /* UNIX operating system for special things */
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define INT_EQ_LONG 1
-
- #define signed /* chars are signed */
- #define const
- #define volatile
-
- /* BSD still erroneously uses index() and rindex() */
- #define strchr index
- #define strrchr rindex
-
- #endif /* MEIKO */
- /**/
- #if !defined(HOST_IS) && defined(XTM)
- #undef XTM
- #define XTM 1 /* machine */
- #define UNIX 1 /* a misnomer on the XTM */
- #define IBM_KEYS 1
-
- #define HOST_IS "XTM, QIX"
-
- #ifndef nw2pt /* is this correct ? should be in n2host.h, I think. */
- #define TRANS 1
- #endif
-
- #define PROTOTYPING 1
- #define ANSI_HEADER 1
- #define ELLIPSIS ...
-
- #define DGXTM 1
-
- #define INT_EQ_LONG 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL 0
- #endif
-
- /* For windowing systems, we need a handle type for windows */
-
- typedef char *windowhandle_t;
-
- #endif /* XTM */
-
- /**/
- #if !defined(HOST_IS) && (defined(MAC) || defined(THINK_C))
- #define HOST_IS "Apple Macintosh"
-
- #ifndef MAC
- #define MAC 1
- #endif
-
- #define MACOS 1
- #define DGMAC 1
-
- #define ANSI_HEADER 1
- #if defined(MPW3) || defined(THINK_C)
- #define PROTOTYPING 1
- #define ELLIPSIS ...
- #else
- #undef PROTOTYPING
- #define ELLIPSIS
- #endif /* mpw3 */
-
- #define signed /* chars are signed */
- #define const
- #define volatile
-
- #define INT_EQ_LONG 1
-
- /* Default 0 pointer type */
- #ifndef NULL
- #define NULL 0L
- #endif
- #ifndef PROPRIETARY
- #include "mac.h" /* Macintosh - specific stuff */
- #endif
- #endif /* MAC */
-
- /**/
- #ifndef HOST_IS
- error! error! error!
- #endif
-
- #ifndef PROPRIETARY
- #ifdef IBM_TYPE
- #ifdef NEC
- #define NEC_KEYS 1 /* keyboard classification */
- #define NEC_BIOS 1 /* bios classification */
- #define IBM_SOUND 1 /* sound classification */
- #define IBM_GRAPHICS 1 /* screen classification */
- #define DGNEC 1 /* graphics library */
- #else
- #ifdef FUJITSU
- #define FUJITSU_KEYS 1 /* keyboard classification */
- #define FUJITSU_BIOS 1 /* bios classification */
- #define FUJITSU_SOUND 1 /* sound classification */
- #define FUJITSU_GRAPHICS 1 /* screen classification */
- #define DGFUJ 1 /* graphics library */
- #else
- #define IBM_KEYS 1 /* keyboard classification */
- #define IBM_BIOS 1 /* bios classification */
- #define IBM_SOUND 1 /* sound classification */
- #define IBM_GRAPHICS 1 /* screen classification */
- #define DGPC 1 /* graphics library */
- #endif /* FUJITSU */
- #endif /* NEC */
- #endif /* IBM_TYPE */
- #endif /* PROPRIETARY */
- /*
- * -----------------------------------------------------------------------
- * SEC 4. Universal definitions which apply to everybody
- * -----------------------------------------------------------------------
- */
-
- #ifdef PROTOTYPING
- #define ARGLIST(a) a
- #define _A0 void
- #else
- #define ARGLIST(a) ()
- #define _A0
- #endif
-
- #define BITSPERBYTE 8
-
- typedef long SL; /* signed long */
- #define xdr_sl xdr_long
-
- typedef unsigned long UL; /* unsigned long */
- #define xdr_ul xdr_u_long
-
- typedef short SW; /* signed word */
- #define xdr_sw xdr_short
-
- typedef unsigned short UW; /* unsigned word */
- #define xdr_uw xdr_u_short
-
- typedef char XB; /* unknown byte type */
- #define xdr_xb xdr_char
-
- typedef unsigned char UB; /* unsigned byte */
- #define xdr_ub xdr_u_char
-
- typedef int NINT; /* native integer */
- #define xdr_nint xdr_int
-
- typedef int UNINT; /* unsigned native integer */
-
- typedef double REAL; /* floating point number */
- #define xdr_real xdr_double
-
- typedef float SREAL; /* short real */
- #define xdr_sreal xdr_float
-
- #ifndef NW2tm /* conflict with cstools/build.h */
- typedef char TEXT; /* text string */
- #endif
-
- #define VOID void
- #define FAST register /* fast definitions */
- #define IMPORT extern /* external reference */
-
- #define NORMTERM 0 /* Normal exit condition */
- #define ERRTERM 1 /* error exit condition */
-
- #define EXPORT /* declare an external */
- #define LOCAL static /* local variables */
-
- #define ASof(x) (sizeof((x))/sizeof(x[0]))
-
- /*
- * -----------------------------------------------------------------------
- * SEC 5. definitions which vary depending upon compiler or platform
- * -----------------------------------------------------------------------
- */
-
- #ifdef SUN
- typedef char MVOID;
- #else
- #define MVOID void
- #endif
-
- #ifdef MAC
- typedef short bool;
- #else
- typedef int bool;
- #endif
-
- #ifdef INT_EQ_SHORT
- #define MAXINT 0x7FFF
- #define MININT 0x8000
- #define INT_16 int
- #define INT_32 long
- #define xdr_int32 xdr_long
- #endif
-
- #ifdef INT_EQ_LONG
- #define MAXINT 0x7FFFFFFF
- #define MININT 0x80000000
- #define INT_16 short
- #define INT_32 int
- #define xdr_int32 xdr_int
- #endif
-
- #ifdef SIZEOF_MACRO_OK
-
- #define SIZEOFINT sizeof(int)
- #define SIZEOFLONG sizeof(long)
-
- #else /* preprocessor chokes on sizeof(int) in a MACRO */
-
- #define SIZEOFSHORT 2
- #define SIZEOFLONG 4
-
- #ifdef INT_EQ_LONG
- #define SIZEOFINT SIZEOFLONG
- #else
- #define SIZEOFINT SIZEOFSHORT
- #endif /* not INT_EQ_LONG */
-
- #endif /* not SIZEOF_MACRO_OK */
-
- #define NRZRO (.000001) /* close enough to zero */
-
- #ifdef MSDOS
- #define FNLEN 8 /* max length for a file name */
- #define FN_DISP_LEN FNLEN /* The display portion of file */
- #define FNXLEN 12 /* extended length */
- #endif /* MSDOS */
-
- #if defined(UNIX)
- #define FNLEN 40 /* max length for a file name */
- #define FN_DISP_LEN 8 /* The display portion of file */
- #define FNXLEN 120 /* extended length */
- #endif /* SUN */
-
- #ifdef MAC
- #define FNLEN 27 /* max length for a file name */
- #define FN_DISP_LEN 8 /* The display portion of file */
- #define FNXLEN 31 /* extended length */
- #endif /* MAC */
-
- #define L4A(x) (((x)+3)&(-4)) /* always 4-byte alignment */
-
- #define FNALC L4A(FNLEN+1) /* space to allocate */
- #define FNXALC L4A(FNXLEN+1) /* space to allocate */
-
- /* remove unused macros */
-
- #undef INT_EQ_LONG
- #undef INT_EQ_SHORT
-
- /* A story: ( TM, 1/23/91 )
- According to the Harbison-Steele reference, ANSI C permits void
- in a function prototype, but not in a function definition, to
- indicate that the function accepts no arguments.
-
- Some compilers, otherwise ANSI compliant, require that the definition
- use "void" to match the prototype. To solve this sticky problem,
- use NO_ARGS in function definitions only.
- */
-
- #if defined(__TRANSPUTER__) || defined(M_I86) || defined(RS6)
- #define NO_ARGS void
- #else
- #define NO_ARGS
- #endif
-
- /* Older Unix machines use varargs.h to support a portable method for
- handling multiple arguments. Newer compilers supply ANSI standard
- stdarg.h */
-
- #undef USE_VARARGS
- #if defined(SUN) || defined(EWS) || defined(CRAY)
- /* force VARARGS */
- #define USE_VARARGS 1
- #endif
-
- #ifdef USE_VARARGS
- #include <varargs.h>
- #define VA_START(argp, last_arg) va_start(argp)
- #define VA_ALIST ,va_alist
- #else
- #include <stdarg.h>
- #define VA_START(argp, last_arg) va_start(argp, last_arg)
- #define va_dcl
- #define VA_ALIST
- #endif
-
- #if defined(unix) && !defined(I860) && !defined(EWS) && !defined(CRAY)
- #define BSDUNIX 1
- #endif
-
- #ifdef DGXWIN
- #include <X11/Intrinsic.h>
- #include <X11/keysym.h>
- #define FLIP_Y( value ) ((dg_displaybox[3] - (value)))
- typedef Widget windowhandle_t;
- #endif
-
- /* MSDOS compiler support for far pointers */
-
- #if defined(__ZTC__)
- #define ZFAR far
- #define FAR far
- #else
- #define ZFAR
- #if defined(_MSC_VER)
- #define FAR _far
- #else
- #define FAR
- #endif /* not MSC */
- #endif /* not ZTC */
-
- #define VOIDF VOID ZFAR
-
- /* some compilers require (VOID *) cast */
-
- #if defined(SUN) || defined(XTM) || defined(TRANS_PHYS) || defined(VAXULT)
- #define VP (VOID *) /* may cast vars as "(void*)ptr" */
- #else
- #define VP
- #endif
-
- /* process control, initiation and termination */
-
- #ifndef XTM
- #define USAGE_STRC 1 /* Usage structure passed to wait4 function */
- #endif
-
- /* Note: SUNOS_4 has a wait4( ); following are redefinitions for other
- systems to improve readability */
-
- #if defined(RS6) || defined(SYSV)
- #define wait4(pid,sp,opt,use) waitpid(pid,sp,opt)
- #undef USAGE_STRC
- #else
- #if defined(SUNOS_3) || defined(NEXT) || defined(VAXULT)
- #define wait4(pid,sp,opt,use) wait3(sp,opt,use)
- #endif
- #endif
-
- #if defined(RS6) || defined(NEXT) || defined(SYSV)
- #define vfork fork
- #endif
-
- /*
- * Inclusions (INCxxxxx)
- */
-
- /* --- strings.h or alternates --- */
-
- #if defined(BSDUNIX) && !defined(SKY) /* INCSTRINGS */
- #define INCSTRINGS /* use <strings.h> (else <string.h>) */
- #endif /* note: VAX/VMS allows either! */
-
- /* --- sys/types.h or alternates --- */
-
- #if defined(UNIX) || defined(NEXT) || defined(MSC) || defined(__ZTC__) || \
- defined(IBP) || defined(__TURBOC__) || defined(SKY)
- #define INCSYSTYPES /* use <sys/types.h> (most common) */
- #elif defined(M860)
- #define INCMYRIADTYPES /* use <myriad.h>, not <sys/types> */
- #elif !defined(THINK_C) /* (use nothing) */
- #define INCTYPES /* fallthru: use <types.h> */
- #endif
-
- /* --- sys/file.h or alternates --- */
-
- #if !defined(VAXULT) && !defined(MSDOS) /* (BSDUNIX. NEXT? RS6? XTM? ...?) */
- #define INCSYSFILE /* INCSYSFILE */
- #else /* use <sys/file.h> (most common) */
- #define INCFILE
- #endif /* else use <file.h> */
-
- /* --- sys/vm.h or alternates --- */
-
- #if defined(VAXULT) || defined(EWS) /* INCSYSVM */
- #define INCSYSVM /* use <sys/vm.h> (rare?) */
- #else
- #define INCVM /* else use <vm.h> */
- #endif
-
- /*
- * External References (EXTxxxxx)
- */
-
- /* EXTMEMMOVE ------------------------- */
- #if defined(BSDUNIX) && !defined(VAXULT)
- #define EXTMEMMOVE /* extern memmove() */
- #endif
-
- /* EXTSTDERR ------------------------- */
- /* seems to be everyone but MS-DOS */
- #if defined(MAC) || defined(UNIX) || defined(NEXT) || \
- defined(IBP) || defined(I860)
- #define EXTSTDERR 1 /* use "stderr" else "stdprn" */
- #endif
-
- /*
- * Macro Activiation (MACxxxxx)
- */
-
- /* ( CPP can't handle arithmetic - see nw2/n2menu.c ) */
- #if defined(UNIX)
- #define MACNOARITH
- #endif
-
- /*
- * Code Segment Activiation (SRCxxxxx)
- */
-
- #if !defined(VAXVMS) && !defined(VAXULT)
- #define SRCCASTLONG /* SRCCASTLONG */
- #endif /* supports: "*(long*)(ch) = -1" */
-
- #if defined(MSDOS) && !defined(IBP)
- #define SRCVM /* SRCVM */
- #endif /* enable body of "src/tk/if/vm.c" */
-
- /*
- * Function and Procedure Activiation (FUNxxxxx)
- */
-
- /* String Duplication */
-
- #if defined(RS6)
- #define ZREFSTRDUP 1
- #endif
-
- #if defined(MAC) || defined(XTM) || defined(VAXULT) || defined(SKY)
- #define FUNSTRDUP 1
- #endif
-
- #if defined(FUNSTRDUP) || defined(ZDEFSTRING)
- char *strdup ARGLIST(( char * )); /* this is supposed to be in string.h but it's not */
- #endif
-
- /*
- .
- ....... empty for now .......
- .
- */
-
- /*
- * General (Misc) Use (USExxxxx)
- */
-
- /* ------------------------------------ */
-
- /* ANY other wierdnesses looking for a home... */
-
- #endif /* HOST_H */
-