1 /* File: h-config.h */
2 
3 #ifndef INCLUDED_H_CONFIG_H
4 #define INCLUDED_H_CONFIG_H
5 
6 /*
7  * Choose the hardware, operating system, and compiler.
8  * Also, choose various "system level" compilation options.
9  * A lot of these definitions take effect in "h-system.h"
10  *
11  * Note that you may find it simpler to define some of these
12  * options in the "Makefile", especially any options describing
13  * what "system" is being used.
14  */
15 
16 
17 /*
18  * no system definitions are needed for 4.3BSD, SUN OS, DG/UX
19  */
20 
21 /*
22  * OPTION: Compile on a Macintosh (see "A-mac-h" or "A-mac-pch")
23  */
24 #ifndef MACINTOSH
25 /* #define MACINTOSH */
26 #endif
27 
28 /*
29  * OPTION: Compile on Windows (automatic)
30  */
31 #ifndef WINDOWS
32 /* #define WINDOWS */
33 #endif
34 
35 /*
36  * OPTION: Compile on an IBM (automatic)
37  */
38 #ifndef MSDOS
39 /* #define MSDOS */
40 #endif
41 
42 /*
43  * OPTION: Compile on a SYS III version of UNIX
44  */
45 #ifndef SYS_III
46 /* #define SYS_III */
47 #endif
48 
49 /*
50  * OPTION: Compile on a SYS V version of UNIX (not Solaris)
51  */
52 #ifndef SYS_V
53 #define SYS_V
54 #endif
55 
56 /*
57  * OPTION: Compile on a HPUX version of UNIX
58  */
59 #ifndef HPUX
60 /* #define HPUX */
61 #endif
62 
63 /*
64  * OPTION: Compile on an SGI running IRIX
65  */
66 #ifndef SGI
67 /* #define SGI */
68 #endif
69 
70 /*
71  * OPTION: Compile on Solaris, treat it as System V
72  */
73 #ifndef SOLARIS
74 /* #define SOLARIS */
75 #endif
76 
77 /*
78  * OPTION: Compile on an ultrix/4.2BSD/Dynix/etc. version of UNIX,
79  * Do not define this if you are on any kind of SUN OS.
80  */
81 #ifndef ultrix
82 /* #define ultrix */
83 #endif
84 
85 
86 
87 /*
88  * OPTION: Compile on Pyramid, treat it as Ultrix
89  */
90 #if defined(Pyramid)
91 # ifndef ultrix
92 #  define ultrix
93 # endif
94 #endif
95 
96 /*
97  * Extract the "ATARI" flag from the compiler [cjh]
98  */
99 #if defined(__atarist) || defined(__atarist__)
100 # ifndef ATARI
101 #  define ATARI
102 # endif
103 #endif
104 
105 /*
106  * Extract the "ACORN" flag from the compiler
107  */
108 #ifdef __riscos
109 # ifndef ACORN
110 #  define ACORN
111 # endif
112 #endif
113 
114 /*
115  * Extract the "SGI" flag from the compiler
116  */
117 #ifdef sgi
118 # ifndef SGI
119 #  define SGI
120 # endif
121 #endif
122 
123 /*
124  * Extract the "MSDOS" flag from the compiler
125  */
126 #ifdef __MSDOS__
127 # ifndef MSDOS
128 #  define MSDOS
129 # endif
130 #endif
131 
132 /*
133  * Extract the "WINDOWS" flag from the compiler
134  */
135 #if defined(_Windows) || defined(__WINDOWS__) || \
136     defined(__WIN32__) || defined(WIN32) || \
137     defined(__WINNT__) || defined(__NT__)
138 # ifndef WINDOWS
139 #  define WINDOWS
140 #  define strcasecmp stricmp
141 #  define strncasecmp strnicmp
142 # endif
143 #endif
144 
145 
146 
147 /*
148  * OPTION: Define "L64" if a "long" is 64-bits.  See "h-types.h".
149  */
150 #if defined(__alpha) || defined(__amd64__) || defined(__ia64__)
151 # define L64
152 #endif
153 
154 
155 
156 /*
157  * OPTION: set "SET_UID" if the machine is a "multi-user" machine.
158  * This option is used to verify the use of "uids" and "gids" for
159  * various "Unix" calls, and of "pids" for getting a random seed,
160  * and of the "umask()" call for various reasons, and to guess if
161  * the "kill()" function is available, and for permission to use
162  * functions to extract user names and expand "tildes" in filenames.
163  * It is also used for "locking" and "unlocking" the score file.
164  * Basically, SET_UID should *only* be set for "Unix" machines,
165  * or for the "Atari" platform which is Unix-like, apparently
166  */
167 #if !defined(MACINTOSH) && !defined(WINDOWS) && \
168     !defined(MSDOS) && \
169     !defined(AMIGA) && !defined(ACORN) && !defined(VM)
170 # define SET_UID
171 #endif
172 
173 
174 /*
175  * OPTION: Set "USG" for "System V" versions of Unix
176  * This is used to choose a "lock()" function, and to choose
177  * which header files ("string.h" vs "strings.h") to include.
178  * It is also used to allow certain other options, such as options
179  * involving userid's, or multiple users on a single machine, etc.
180  */
181 #ifdef SET_UID
182 # if defined(SYS_III) || defined(SYS_V) || defined(SOLARIS) || \
183      defined(HPUX) || defined(SGI) || defined(ATARI)
184 #  ifndef USG
185 #   define USG
186 #  endif
187 # endif
188 #endif
189 
190 
191 /*
192  * Every system seems to use its own symbol as a path separator.
193  * Default to the standard Unix slash, but attempt to change this
194  * for various other systems.  Note that any system that uses the
195  * "period" as a separator (i.e. ACORN) will have to pretend that
196  * it uses the slash, and do its own mapping of period <-> slash.
197  * Note that the VM system uses a "flat" directory, and thus uses
198  * the empty string for "PATH_SEP".
199  */
200 #undef PATH_SEP
201 #define PATH_SEP "/"
202 #ifdef MACINTOSH
203 # undef PATH_SEP
204 # define PATH_SEP ":"
205 #endif
206 #if defined(WINDOWS) || defined(WINNT)
207 # undef PATH_SEP
208 # define PATH_SEP "\\"
209 #endif
210 #if defined(MSDOS) || defined(OS2) || defined(USE_EMX)
211 # undef PATH_SEP
212 # define PATH_SEP "\\"
213 #endif
214 #ifdef AMIGA
215 # undef PATH_SEP
216 # define PATH_SEP "/"
217 #endif
218 #ifdef __GO32__
219 # undef PATH_SEP
220 # define PATH_SEP "/"
221 #endif
222 #ifdef VM
223 # undef PATH_SEP
224 # define PATH_SEP ""
225 #endif
226 
227 
228 /*
229  * The Macintosh allows the use of a "file type" when creating a file
230  */
231 #if defined(MACINTOSH) && !defined(applec)
232 # define FILE_TYPE_TEXT 'TEXT'
233 # define FILE_TYPE_DATA 'DATA'
234 # define FILE_TYPE_SAVE 'SAVE'
235 # define FILE_TYPE(X) (_ftype = (X))
236 #else
237 # define FILE_TYPE(X) ((void)0)
238 #endif
239 
240 
241 /*
242  * OPTION: Hack -- Make sure "strchr()" and "strrchr()" will work
243  */
244 #if defined(SYS_III) || defined(SYS_V) || defined(MSDOS)
245 # if !defined(__TURBOC__) && !defined(__WATCOMC__) && !defined(MINGW)
246 #  define strchr index
247 #  define strrchr rindex
248 # endif
249 #endif
250 
251 
252 /*
253  * OPTION: Define "HAS_STRICMP" only if "stricmp()" exists.
254  * Note that "stricmp()" is not actually used by Angband.
255  */
256 /* #define HAS_STRICMP */
257 
258 /*
259  * Linux has "stricmp()" with a different name
260  */
261 #if defined(linux)
262 # define HAS_STRICMP
263 # define stricmp strcasecmp
264 #endif
265 
266 
267 /*
268  * OPTION: Define "HAS_MEMSET" only if "memset()" exists.
269  * Note that the "memset()" routines are used in "z-virt.h"
270  */
271 #define HAS_MEMSET
272 
273 
274 /*
275  * OPTION: Define "HAS_USLEEP" only if "usleep()" exists.
276  * Note that this is only relevant for "SET_UID" machines
277  */
278 #ifdef SET_UID
279 # if !defined(ultrix) && !defined(SOLARIS) && \
280      !defined(SGI) && !defined(ISC) && !defined(USE_EMX)
281 #  define HAS_USLEEP
282 # endif
283 #endif
284 
285 
286 
287 #endif
288 
289 
290