OSDN Git Service

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