OSDN Git Service

SYS_III, SYS_V, ATARI プリプロセッサを除去。 / Remove SYS_III, SYS_V, ATARI preprocessors.
[hengbandforosx/hengbandosx.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 HPUX version of UNIX
64  */
65 #ifndef HPUX
66 /* #define HPUX */
67 #endif
68
69 /*
70  * OPTION: Compile on an SGI running IRIX
71  */
72 #ifndef SGI
73 /* #define SGI */
74 #endif
75
76 /*
77  * OPTION: Compile on a SunOS machine
78  */
79 #ifndef SUNOS
80 /* #define SUNOS */
81 #endif
82
83 /*
84  * OPTION: Compile on a Solaris machine
85  */
86 #ifndef SOLARIS
87 /* #define SOLARIS */
88 #endif
89
90 /*
91  * OPTION: Compile on an ultrix/4.2BSD/Dynix/etc. version of UNIX,
92  * Do not define this if you are on any kind of SunOS.
93  */
94 #ifndef ULTRIX
95 /* #define ULTRIX */
96 #endif
97
98
99
100 /*
101  * Extract the "SUNOS" flag from the compiler
102  */
103 #if defined(sun)
104 # ifndef SUNOS
105 #   define SUNOS
106 # endif
107 #endif
108
109 /*
110  * Extract the "ULTRIX" flag from the compiler
111  */
112 #if defined(ultrix) || defined(Pyramid)
113 # ifndef ULTRIX
114 #  define ULTRIX
115 # endif
116 #endif
117
118 /*
119  * Extract the "ACORN" flag from the compiler
120  */
121 #ifdef __riscos
122 # ifndef ACORN
123 #  define ACORN
124 # endif
125 #endif
126
127 /*
128  * Extract the "SGI" flag from the compiler
129  */
130 #ifdef sgi
131 # ifndef SGI
132 #  define SGI
133 # endif
134 #endif
135
136 /*
137  * Extract the "WINDOWS" flag from the compiler
138  */
139 #if defined(_Windows) || defined(__WINDOWS__) || \
140     defined(__WIN32__) || defined(WIN32) || \
141     defined(__WINNT__) || defined(__NT__)
142 # ifndef WINDOWS
143 #  define WINDOWS
144 # endif
145 #endif
146
147
148
149 /*
150  * OPTION: Define "L64" if a "long" is 64-bits.  See "h-types.h".
151  * The only such platform that angband is ported to is currently
152  * DEC Alpha AXP running OSF/1 (OpenVMS uses 32-bit longs).
153  */
154 #if defined(__alpha) && defined(__osf__)
155 # define L64
156 #endif
157
158
159
160 /*
161  * OPTION: set "SET_UID" if the machine is a "multi-user" machine.
162  * This option is used to verify the use of "uids" and "gids" for
163  * various "Unix" calls, and of "pids" for getting a random seed,
164  * and of the "umask()" call for various reasons, and to guess if
165  * the "kill()" function is available, and for permission to use
166  * functions to extract user names and expand "tildes" in filenames.
167  * It is also used for "locking" and "unlocking" the score file.
168  * Basically, SET_UID should *only* be set for "Unix" machines,
169  * or for the "Atari" platform which is Unix-like, apparently
170  */
171 #if !defined(MACINTOSH) && !defined(WINDOWS) && \
172     !defined(USE_EMX) && \
173     !defined(ACORN) && !defined(VM)
174 # define SET_UID
175 #endif
176
177
178 /*
179  * OPTION: Set "USG" for "System V" versions of Unix
180  * This is used to choose a "lock()" function, and to choose
181  * which header files ("string.h" vs "strings.h") to include.
182  * It is also used to allow certain other options, such as options
183  * involving userid's, or multiple users on a single machine, etc.
184  */
185 #ifdef SET_UID
186 # if defined(SOLARIS) || \
187      defined(HPUX) || defined(SGI)
188 #  ifndef USG
189 #   define USG
190 #  endif
191 # endif
192 #endif
193
194
195 /*
196  * Every system seems to use its own symbol as a path separator.
197  * Default to the standard Unix slash, but attempt to change this
198  * for various other systems.  Note that any system that uses the
199  * "period" as a separator (i.e. ACORN) will have to pretend that
200  * it uses the slash, and do its own mapping of period <-> slash.
201  * Note that the VM system uses a "flat" directory, and thus uses
202  * the empty string for "PATH_SEP".
203  */
204 #undef PATH_SEP
205 #define PATH_SEP "/"
206 #ifdef MACINTOSH
207 # undef PATH_SEP
208 # define PATH_SEP ":"
209 #endif
210 #if defined(WINDOWS) || defined(WINNT)
211 # undef PATH_SEP
212 # define PATH_SEP "\\"
213 #endif
214 #if defined(OS2) || defined(USE_EMX)
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(MACH_O_CARBON)
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: Define "HAS_STRICMP" only if "stricmp()" exists.
243  * Note that "stricmp()" is not actually used by Angband.
244  */
245 /* #define HAS_STRICMP */
246
247 /*
248  * Linux has "stricmp()" with a different name
249  */
250 #if defined(linux)
251 # define HAS_STRICMP
252 # define stricmp strcasecmp
253 #endif
254
255
256 /*
257  * OPTION: Define "HAVE_USLEEP" only if "usleep()" exists.
258  *
259  * Note that this is only relevant for "SET_UID" machines.
260  * Note that new "SOLARIS" and "SGI" machines have "usleep()".
261  */
262 #if defined(SET_UID) && !defined(HAVE_CONFIG_H)
263 # if !defined(HPUX) && !defined(ULTRIX) && !defined(ISC)
264 #  define HAVE_USLEEP
265 # endif
266 #endif
267
268 #ifdef USE_IBM
269 # ifndef HAVE_USLEEP
270 #  define HAVE_USLEEP /* Set for gcc (djgpp-v2), TY */
271 # endif
272 #endif
273
274 #ifdef JP
275 # if defined(EUC)
276 #  define iskanji(x) (((unsigned char)(x) >= 0xa1 && (unsigned char)(x) <= 0xfe) || (unsigned char)(x) == 0x8e)
277 #  define iskana(x)  (0)
278 # elif defined(SJIS)
279 #  define iskanji(x) ((0x81 <= (unsigned char)(x) && (unsigned char)(x) <= 0x9f) || (0xe0 <= (unsigned char)(x) && (unsigned char)(x) <= 0xfc))
280 #  define iskana(x)  (((unsigned char)(x) >= 0xA0) && ((unsigned char)(x) <= 0xDF))
281 # else
282 #  error Oops! Please define "EUC" or "SJIS" for kanji-code of your system.
283 # endif
284 #endif
285
286 #endif /* INCLUDED_H_CONFIG_H */