1    | /*	SCCS Id: @(#)config1.h	3.3	1999/12/05	*/
2    | /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3    | /* NetHack may be freely redistributed.  See license for details. */
4    | 
5    | #ifndef CONFIG1_H
6    | #define CONFIG1_H
7    | 
8    | /*
9    |  * MS DOS - compilers
10   |  *
11   |  * Microsoft C auto-defines MSDOS,
12   |  * Borland C   auto-defines __MSDOS__,
13   |  * DJGPP       auto-defines MSDOS.
14   |  */
15   | 
16   | /* #define MSDOS */	/* use if not defined by compiler or cases below */
17   | 
18   | #ifdef __MSDOS__	/* for Borland C */
19   | # ifndef MSDOS
20   | # define MSDOS
21   | # endif
22   | #endif
23   | 
24   | #ifdef __TURBOC__
25   | # define __MSC		/* increase Borland C compatibility in libraries */
26   | #endif
27   | 
28   | #ifdef MSDOS
29   | # undef UNIX
30   | #endif
31   | 
32   | /*
33   |  * Mac Stuff.
34   |  */
35   | #ifdef applec		/*	MPW auto-defined symbol */
36   | # define MAC
37   | #endif
38   | 
39   | #ifdef THINK_C		/* Think C auto-defined symbol */
40   | # define MAC
41   | # define NEED_VARARGS
42   | #endif
43   | 
44   | #ifdef __MWERKS__	/* defined by Metrowerks compiler */
45   | # ifndef __BEOS__	/* BeOS */
46   | #  define MAC
47   | # endif
48   | # define NEED_VARARGS
49   | # define USE_STDARG
50   | #endif
51   | 
52   | #if defined(MAC) || defined(__BEOS__)
53   | # define DLB
54   | # undef UNIX
55   | #endif
56   | 
57   | #ifdef __BEOS__
58   | # define NEED_VARARGS
59   | #endif
60   | 
61   | 
62   | /*
63   |  * Amiga setup.
64   |  */
65   | #ifdef AZTEC_C	/* Manx auto-defines this */
66   | # ifdef MCH_AMIGA	/* Manx auto-defines this for AMIGA */
67   | #  ifndef AMIGA
68   | #define AMIGA		/* define for Commodore-Amiga */
69   | #  endif		/* (SAS/C auto-defines AMIGA) */
70   | #define AZTEC_50	/* define for version 5.0 of manx */
71   | # endif
72   | #endif
73   | #ifdef __SASC_60
74   | # define NEARDATA __near /* put some data close */
75   | #else
76   | # ifdef _DCC
77   | # define NEARDATA __near /* put some data close */
78   | # else
79   | # define NEARDATA
80   | # endif
81   | #endif
82   | #ifdef AMIGA
83   | # define NEED_VARARGS
84   | # undef UNIX
85   | # define DLB
86   | # define HACKDIR "NetHack:"
87   | # define NO_MACRO_CPATH
88   | #endif
89   | 
90   | /*
91   |  * Atari auto-detection
92   |  */
93   | 
94   | #ifdef atarist
95   | # undef UNIX
96   | # ifndef TOS
97   | # define TOS
98   | # endif
99   | #else
100  | # ifdef __MINT__
101  | #  undef UNIX
102  | #  ifndef TOS
103  | #  define TOS
104  | #  endif
105  | # endif
106  | #endif
107  | 
108  | /*
109  |  * Windows NT Autodetection
110  |  */
111  | 
112  | #ifdef WIN32
113  | # undef UNIX
114  | # undef MSDOS
115  | # define NHSTDC
116  | # define STRNCMPI
117  | # define USE_STDARG
118  | # define NEED_VARARGS
119  | #endif
120  | 
121  | 
122  | #ifdef VMS	/* really old compilers need special handling, detected here */
123  | # undef UNIX
124  | # ifdef __DECC
125  | #  ifndef __DECC_VER	/* buggy early versions want widened prototypes */
126  | #   define NOTSTDC	/* except when typedefs are involved		*/
127  | #   define USE_VARARGS
128  | #  else
129  | #   define NHSTDC
130  | #   define USE_STDARG
131  | #   define POSIX_TYPES
132  | #   define _DECC_V4_SOURCE	/* avoid some incompatible V5.x changes */
133  | #  endif
134  | #  undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
135  | # else
136  | #  ifdef VAXC	/* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
137  | #   ifdef ANCIENT_VAXC	/* vaxc v2.2 and earlier [lots of warnings to come] */
138  | #    define KR1ED	/* simulate defined() */
139  | #    define USE_VARARGS
140  | #   else		/* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
141  | #     if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
142  | #      define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
143  | #      define signed	/* well, almost close enough */
144  | #include <stddef.h>
145  | #      define UNWIDENED_PROTOTYPES
146  | #     endif
147  | #     define USE_STDARG
148  | #   endif
149  | #  endif /*VAXC*/
150  | # endif /*__DECC*/
151  | # ifdef VERYOLD_VMS	/* v4.5 or earlier; no longer available for testing */
152  | #  define USE_OLDARGS	/* <varargs.h> is there, vprintf & vsprintf aren't */
153  | #  ifdef USE_VARARGS
154  | #   undef USE_VARARGS
155  | #  endif
156  | #  ifdef USE_STDARG
157  | #   undef USE_STDARG
158  | #  endif
159  | # endif
160  | #endif /*VMS*/
161  | 
162  | #ifdef vax
163  | /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
164  | # ifdef ULTRIX_PROTO
165  | #  undef ULTRIX_PROTO
166  | # endif
167  | # ifdef ULTRIX_CC20
168  | #  undef ULTRIX_CC20
169  | # endif
170  | #endif
171  | 
172  | #ifdef KR1ED		/* For compilers which cannot handle defined() */
173  | #define defined(x) (-x-1 != -1)
174  | /* Because:
175  |  * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
176  |  * #define FOO 1 or on command-line -DFOO
177  |  *	=> defined(1) => (-1 != - 1 - 1) => 1
178  |  * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
179  |  * for -DFOO, oh well.
180  |  *	=> defined(0) => (-1 != - 0 - 1) => 0
181  |  *
182  |  * But:
183  |  * defined("") => (-1 != - "" - 1)
184  |  *   [which is an unavoidable catastrophe.]
185  |  */
186  | #endif
187  | 
188  | #endif	/* CONFIG1_H */