OSDN Git Service

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