OSDN Git Service

Initial revision
[hengbandforosx/hengbandosx.git] / src / h-config.h
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 #ifdef USE_IBM
36
37   /*
38    * OPTION: Compile on an IBM (automatic)
39    */
40   #ifndef MSDOS
41     #define MSDOS
42   #endif
43
44
45   /* Use the new SVGA code */
46   #ifndef USE_IBM_SVGA
47     #define USE_IBM_SVGA
48   #endif
49
50
51 #endif
52
53 /*
54  * OPTION: Compile on a SYS III version of UNIX
55  */
56 #ifndef SYS_III
57 /* #define SYS_III */
58 #endif
59
60 /*
61  * OPTION: Compile on a SYS V version of UNIX (not Solaris)
62  */
63 #ifndef SYS_V
64 /* #define SYS_V */
65 #endif
66
67 /*
68  * OPTION: Compile on a HPUX version of UNIX
69  */
70 #ifndef HPUX
71 /* #define HPUX */
72 #endif
73
74 /*
75  * OPTION: Compile on an SGI running IRIX
76  */
77 #ifndef SGI
78 /* #define SGI */
79 #endif
80
81 /*
82  * OPTION: Compile on a SunOS machine
83  */
84 #ifndef SUNOS
85 /* #define SUNOS */
86 #endif
87
88 /*
89  * OPTION: Compile on a Solaris machine
90  */
91 #ifndef SOLARIS
92 /* #define SOLARIS */
93 #endif
94
95 /*
96  * OPTION: Compile on an ultrix/4.2BSD/Dynix/etc. version of UNIX,
97  * Do not define this if you are on any kind of SunOS.
98  */
99 #ifndef ULTRIX
100 /* #define ULTRIX */
101 #endif
102
103
104
105 /*
106  * Extract the "SUNOS" flag from the compiler
107  */
108 #if defined(sun)
109 # ifndef SUNOS
110 #   define SUNOS
111 # endif
112 #endif
113
114 /*
115  * Extract the "ULTRIX" flag from the compiler
116  */
117 #if defined(ultrix) || defined(Pyramid)
118 # ifndef ULTRIX
119 #  define ULTRIX
120 # endif
121 #endif
122
123 /*
124  * Extract the "ATARI" flag from the compiler [cjh]
125  */
126 #if defined(__atarist) || defined(__atarist__)
127 # ifndef ATARI
128 #  define ATARI
129 # endif
130 #endif
131
132 /*
133  * Extract the "ACORN" flag from the compiler
134  */
135 #ifdef __riscos
136 # ifndef ACORN
137 #  define ACORN
138 # endif
139 #endif
140
141 /*
142  * Extract the "SGI" flag from the compiler
143  */
144 #ifdef sgi
145 # ifndef SGI
146 #  define SGI
147 # endif
148 #endif
149
150 /*
151  * Extract the "MSDOS" flag from the compiler
152  */
153 #ifdef __MSDOS__
154 # ifndef MSDOS
155 #  define MSDOS
156 # endif
157 #endif
158
159 /*
160  * Extract the "WINDOWS" flag from the compiler
161  */
162 #if defined(_Windows) || defined(__WINDOWS__) || \
163     defined(__WIN32__) || defined(WIN32) || \
164     defined(__WINNT__) || defined(__NT__)
165 # ifndef WINDOWS
166 #  define WINDOWS
167 # endif
168 #endif
169
170
171
172 /*
173  * OPTION: Define "L64" if a "long" is 64-bits.  See "h-types.h".
174  * The only such platform that angband is ported to is currently
175  * DEC Alpha AXP running OSF/1 (OpenVMS uses 32-bit longs).
176  */
177 #if defined(__alpha) && defined(__osf__)
178 # define L64
179 #endif
180
181
182
183 /*
184  * OPTION: set "SET_UID" if the machine is a "multi-user" machine.
185  * This option is used to verify the use of "uids" and "gids" for
186  * various "Unix" calls, and of "pids" for getting a random seed,
187  * and of the "umask()" call for various reasons, and to guess if
188  * the "kill()" function is available, and for permission to use
189  * functions to extract user names and expand "tildes" in filenames.
190  * It is also used for "locking" and "unlocking" the score file.
191  * Basically, SET_UID should *only* be set for "Unix" machines,
192  * or for the "Atari" platform which is Unix-like, apparently
193  */
194 #if !defined(MACINTOSH) && !defined(WINDOWS) && \
195     !defined(MSDOS) && !defined(USE_EMX) && \
196     !defined(AMIGA) && !defined(ACORN) && !defined(VM)
197 # define SET_UID
198 #endif
199
200
201 /*
202  * OPTION: Set "USG" for "System V" versions of Unix
203  * This is used to choose a "lock()" function, and to choose
204  * which header files ("string.h" vs "strings.h") to include.
205  * It is also used to allow certain other options, such as options
206  * involving userid's, or multiple users on a single machine, etc.
207  */
208 #ifdef SET_UID
209 # if defined(SYS_III) || defined(SYS_V) || defined(SOLARIS) || \
210      defined(HPUX) || defined(SGI) || defined(ATARI)
211 #  ifndef USG
212 #   define USG
213 #  endif
214 # endif
215 #endif
216
217
218 /*
219  * Every system seems to use its own symbol as a path separator.
220  * Default to the standard Unix slash, but attempt to change this
221  * for various other systems.  Note that any system that uses the
222  * "period" as a separator (i.e. ACORN) will have to pretend that
223  * it uses the slash, and do its own mapping of period <-> slash.
224  * Note that the VM system uses a "flat" directory, and thus uses
225  * the empty string for "PATH_SEP".
226  */
227 #undef PATH_SEP
228 #define PATH_SEP "/"
229 #ifdef MACINTOSH
230 # undef PATH_SEP
231 # define PATH_SEP ":"
232 #endif
233 #if defined(WINDOWS) || defined(WINNT)
234 # undef PATH_SEP
235 # define PATH_SEP "\\"
236 #endif
237 #if defined(MSDOS) || defined(OS2) || defined(USE_EMX)
238 # undef PATH_SEP
239 # define PATH_SEP "\\"
240 #endif
241 #ifdef AMIGA
242 # undef PATH_SEP
243 # define PATH_SEP "/"
244 #endif
245 #ifdef __GO32__
246 # undef PATH_SEP
247 # define PATH_SEP "/"
248 #endif
249 #ifdef VM
250 # undef PATH_SEP
251 # define PATH_SEP ""
252 #endif
253
254
255 /*
256  * The Macintosh allows the use of a "file type" when creating a file
257  */
258 #if defined(MACINTOSH) && !defined(applec)
259 # define FILE_TYPE_TEXT 'TEXT'
260 # define FILE_TYPE_DATA 'DATA'
261 # define FILE_TYPE_SAVE 'SAVE'
262 # define FILE_TYPE(X) (_ftype = (X))
263 #else
264 # define FILE_TYPE(X) ((void)0)
265 #endif
266
267
268 /*
269  * OPTION: Hack -- Make sure "strchr()" and "strrchr()" will work
270  */
271 #if defined(SYS_III) || defined(SYS_V) || defined(MSDOS)
272 # if !defined(__TURBOC__) && !defined(__WATCOMC__) && !defined(__DJGPP__)
273 #  define strchr index
274 #  define strrchr rindex
275 # endif
276 #endif
277
278
279 /*
280  * OPTION: Define "HAS_STRICMP" only if "stricmp()" exists.
281  * Note that "stricmp()" is not actually used by Angband.
282  */
283 /* #define HAS_STRICMP */
284
285 /*
286  * Linux has "stricmp()" with a different name
287  */
288 #if defined(linux)
289 # define HAS_STRICMP
290 # define stricmp strcasecmp
291 #endif
292
293
294 /*
295  * OPTION: Define "HAS_MEMSET" only if "memset()" exists.
296  * Note that the "memset()" routines are used in "z-virt.h"
297  */
298 #define HAS_MEMSET
299
300
301 /*
302  * OPTION: Define "HAS_USLEEP" only if "usleep()" exists.
303  *
304  * Note that this is only relevant for "SET_UID" machines.
305  * Note that new "SOLARIS" and "SGI" machines have "usleep()".
306  */
307 #ifdef SET_UID
308 # if !defined(HPUX) && !defined(ULTRIX) && !defined(ISC)
309 #  define HAS_USLEEP
310 # endif
311 #endif
312
313 #ifdef USE_IBM
314     #ifndef HAS_USLEEP
315     #define HAS_USLEEP /* Set for gcc (djgpp-v2), TY */
316     #endif
317 #endif
318
319 /*
320  * Try to use save tempfile handling on multi-user machines.
321  *
322  * Comment this out if you don't have mkstemp()
323  *
324  * Note - I don't know how widely used this function is.
325  * Feedback would be helpful, so we can remove some platforms
326  * from this 'catch-all' statement.
327  */
328 #ifdef SET_UID
329 #define HAVE_MKSTEMP
330 #endif
331
332 #endif
333
334 #ifdef JP
335 # if defined(EUC)
336 #  define iskanji(x) ((((int)(x) & 0xff) >= 0xa1 && ((int)(x) & 0xff) <= 0xfe) || ((int)(x) & 0xff) == 0x8e)
337 #  define iskana(x)  (0)
338 # elif defined(SJIS)
339 #  define iskanji(x)  ((0x81<=(unsigned char)(x) && (unsigned char)(x)<=0x9f)|| (0xe0<=(unsigned char)(x) && (unsigned char)(x)<=0xfc))
340 #  define iskana(x)  (((x) >= 0xA0) && ((x)<= 0xDF))
341 # elif defined(MSDOS)
342 #  include <jctype.h>
343 # else
344 #  error Oops! Please define "EUC" or "SJIS" for kanji-code of your system.
345 # endif /* MSDOS */
346 #endif
347