OSDN Git Service

#define MSDOS プリプロセッサを除去。 / Remove #define MSDOS preprocessor.
[hengband/hengband.git] / src / h-config.h
1 /*!
2  * @file h-config.h
3  * @brief 変愚時追加された基本事項のヘッダーファイル /
4  * The most basic "include" file. This file simply includes other low level header files.
5  * @date 2014/08/15
6  * @author
7  * 不明(変愚蛮怒スタッフ?)
8  * @details
9  * <pre>
10  * Choose the hardware, operating system, and compiler.
11  * Also, choose various "system level" compilation options.
12  * A lot of these definitions take effect in "h-system.h"
13  * Note that you may find it simpler to define some of these
14  * options in the "Makefile", especially any options describing
15  * what "system" is being used.
16  * no system definitions are needed for 4.3BSD, SUN OS, DG/UX
17  * </pre>
18  */
19
20 #ifndef INCLUDED_H_CONFIG_H
21 #define INCLUDED_H_CONFIG_H
22
23
24 /*
25  * OPTION: Compile on a Macintosh (see "A-mac-h" or "A-mac-pch")
26  * Automatic for Mac MPW compilation
27  */
28 #ifndef MACINTOSH
29 /* #define MACINTOSH */
30 #endif
31
32 /*
33  * OPTION: Compile on Windows (automatic)
34  */
35 #ifndef WINDOWS
36 /* #define WINDOWS */
37 #endif
38
39 /*
40  * Extract the "MAC_MPW" flag from the compiler
41  */
42 #if defined(__SC__) || defined(__MRC__)
43 # ifndef MACINTOSH
44 #  define MACINTOSH
45 # endif
46 # ifndef MAC_MPW
47 #  define MAC_MPW
48 # endif
49 #endif
50
51
52 #ifdef USE_IBM
53
54   /* Use the new SVGA code */
55   #ifndef USE_IBM_SVGA
56     #define USE_IBM_SVGA
57   #endif
58
59
60 #endif
61
62 /*
63  * OPTION: Compile on a SYS III version of UNIX
64  */
65 #ifndef SYS_III
66 /* #define SYS_III */
67 #endif
68
69 /*
70  * OPTION: Compile on a SYS V version of UNIX (not Solaris)
71  */
72 #ifndef SYS_V
73 /* #define SYS_V */
74 #endif
75
76 /*
77  * OPTION: Compile on a HPUX version of UNIX
78  */
79 #ifndef HPUX
80 /* #define HPUX */
81 #endif
82
83 /*
84  * OPTION: Compile on an SGI running IRIX
85  */
86 #ifndef SGI
87 /* #define SGI */
88 #endif
89
90 /*
91  * OPTION: Compile on a SunOS machine
92  */
93 #ifndef SUNOS
94 /* #define SUNOS */
95 #endif
96
97 /*
98  * OPTION: Compile on a Solaris machine
99  */
100 #ifndef SOLARIS
101 /* #define SOLARIS */
102 #endif
103
104 /*
105  * OPTION: Compile on an ultrix/4.2BSD/Dynix/etc. version of UNIX,
106  * Do not define this if you are on any kind of SunOS.
107  */
108 #ifndef ULTRIX
109 /* #define ULTRIX */
110 #endif
111
112
113
114 /*
115  * Extract the "SUNOS" flag from the compiler
116  */
117 #if defined(sun)
118 # ifndef SUNOS
119 #   define SUNOS
120 # endif
121 #endif
122
123 /*
124  * Extract the "ULTRIX" flag from the compiler
125  */
126 #if defined(ultrix) || defined(Pyramid)
127 # ifndef ULTRIX
128 #  define ULTRIX
129 # endif
130 #endif
131
132 /*
133  * Extract the "ATARI" flag from the compiler [cjh]
134  */
135 #if defined(__atarist) || defined(__atarist__)
136 # ifndef ATARI
137 #  define ATARI
138 # endif
139 #endif
140
141 /*
142  * Extract the "ACORN" flag from the compiler
143  */
144 #ifdef __riscos
145 # ifndef ACORN
146 #  define ACORN
147 # endif
148 #endif
149
150 /*
151  * Extract the "SGI" flag from the compiler
152  */
153 #ifdef sgi
154 # ifndef SGI
155 #  define SGI
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(USE_EMX) && \
196     !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(OS2) || defined(USE_EMX)
238 # undef PATH_SEP
239 # define PATH_SEP "\\"
240 #endif
241 #ifdef __GO32__
242 # undef PATH_SEP
243 # define PATH_SEP "/"
244 #endif
245 #ifdef VM
246 # undef PATH_SEP
247 # define PATH_SEP ""
248 #endif
249
250
251 /*
252  * The Macintosh allows the use of a "file type" when creating a file
253  */
254 #if defined(MACINTOSH) || defined(MACH_O_CARBON)
255 # define FILE_TYPE_TEXT 'TEXT'
256 # define FILE_TYPE_DATA 'DATA'
257 # define FILE_TYPE_SAVE 'SAVE'
258 # define FILE_TYPE(X) (_ftype = (X))
259 #else
260 # define FILE_TYPE(X) ((void)0)
261 #endif
262
263
264 /*
265  * OPTION: Define "HAS_STRICMP" only if "stricmp()" exists.
266  * Note that "stricmp()" is not actually used by Angband.
267  */
268 /* #define HAS_STRICMP */
269
270 /*
271  * Linux has "stricmp()" with a different name
272  */
273 #if defined(linux)
274 # define HAS_STRICMP
275 # define stricmp strcasecmp
276 #endif
277
278
279 /*
280  * OPTION: Define "HAVE_USLEEP" only if "usleep()" exists.
281  *
282  * Note that this is only relevant for "SET_UID" machines.
283  * Note that new "SOLARIS" and "SGI" machines have "usleep()".
284  */
285 #if defined(SET_UID) && !defined(HAVE_CONFIG_H)
286 # if !defined(HPUX) && !defined(ULTRIX) && !defined(ISC)
287 #  define HAVE_USLEEP
288 # endif
289 #endif
290
291 #ifdef USE_IBM
292 # ifndef HAVE_USLEEP
293 #  define HAVE_USLEEP /* Set for gcc (djgpp-v2), TY */
294 # endif
295 #endif
296
297 #ifdef JP
298 # if defined(EUC)
299 #  define iskanji(x) (((unsigned char)(x) >= 0xa1 && (unsigned char)(x) <= 0xfe) || (unsigned char)(x) == 0x8e)
300 #  define iskana(x)  (0)
301 # elif defined(SJIS)
302 #  define iskanji(x) ((0x81 <= (unsigned char)(x) && (unsigned char)(x) <= 0x9f) || (0xe0 <= (unsigned char)(x) && (unsigned char)(x) <= 0xfc))
303 #  define iskana(x)  (((unsigned char)(x) >= 0xA0) && ((unsigned char)(x) <= 0xDF))
304 # else
305 #  error Oops! Please define "EUC" or "SJIS" for kanji-code of your system.
306 # endif
307 #endif
308
309 #endif /* INCLUDED_H_CONFIG_H */