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