OSDN Git Service

93b2941074bc7b92319e09cb8e1400482f4e2371
[hengbandforosx/hengbandosx.git] / src / h-config.h
1 /*!
2  * @file h-config.h
3  * @brief 主に変愚/Zang時追加された基本事項のヘッダーファイル /
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  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
18  *
19  * This software may be copied and distributed for educational, research,
20  * and not for profit purposes provided that this copyright and statement
21  * are included in all such copies.  Other copyrights may also apply.
22 */
23
24 #ifndef INCLUDED_H_CONFIG_H
25 #define INCLUDED_H_CONFIG_H
26
27 /*
28  * OPTION: Compile on Windows (automatic)
29  */
30 #ifndef WINDOWS
31 /* #define WINDOWS */
32 #endif
33
34 /*
35  * Extract the "WINDOWS" flag from the compiler
36  */
37 #if defined(_Windows) || defined(__WINDOWS__) || \
38     defined(__WIN32__) || defined(WIN32) || \
39     defined(__WINNT__) || defined(__NT__)
40 # ifndef WINDOWS
41 #  define WINDOWS
42 # endif
43 #endif
44
45 /*
46  * OPTION: Define "L64" if a "long" is 64-bits.  See "h-types.h".
47  * The only such platform that angband is ported to is currently
48  * DEC Alpha AXP running OSF/1 (OpenVMS uses 32-bit longs).
49  */
50 #if defined(__alpha) && defined(__osf__)
51 # define L64
52 #endif
53
54 /*
55  * OPTION: set "SET_UID" if the machine is a "multi-user" machine.
56  * This option is used to verify the use of "uids" and "gids" for
57  * various "Unix" calls, and of "pids" for getting a random seed,
58  * and of the "umask()" call for various reasons, and to guess if
59  * the "kill()" function is available, and for permission to use
60  * functions to extract user names and expand "tildes" in filenames.
61  * It is also used for "locking" and "unlocking" the score file.
62  * Basically, SET_UID should *only* be set for "Unix" machines,
63  * or for the "Atari" platform which is Unix-like, apparently
64  */
65 #if !defined(WINDOWS) && !defined(VM)
66 # define SET_UID
67 #endif
68
69 /*
70  * Every system seems to use its own symbol as a path separator.
71  * Default to the standard Unix slash, but attempt to change this
72  * for various other systems.  Note that any system that uses the
73  * "period" as a separator will have to pretend that it uses the
74  * slash, and do its own mapping of period <-> slash.
75  * Note that the VM system uses a "flat" directory, and thus uses
76  * the empty string for "PATH_SEP".
77  */
78 #undef PATH_SEP
79 #define PATH_SEP "/"
80
81 #if defined(WINDOWS) || defined(WINNT)
82 # undef PATH_SEP
83 # define PATH_SEP "\\"
84 #endif
85
86 #if defined(OS2)
87 # undef PATH_SEP
88 # define PATH_SEP "\\"
89 #endif
90
91  /*
92  * The Macintosh allows the use of a "file type" when creating a file
93  */
94 #if defined(MACH_O_CARBON)
95 # define FILE_TYPE_TEXT 'TEXT'
96 # define FILE_TYPE_DATA 'DATA'
97 # define FILE_TYPE_SAVE 'SAVE'
98 # define FILE_TYPE(X) (_ftype = (X))
99 #else
100 # define FILE_TYPE(X) ((void)0)
101 #endif
102
103 /*
104  * Linux has "stricmp()" with a different name
105  */
106 #if defined(linux)
107 # define stricmp strcasecmp
108 #endif
109
110 /*
111  * OPTION: Define "HAVE_USLEEP" only if "usleep()" exists.
112  *
113  * Note that this is only relevant for "SET_UID" machines.
114  */
115 #if defined(SET_UID) && !defined(HAVE_CONFIG_H)
116 # if !defined(ISC)
117 #  define HAVE_USLEEP
118 # endif
119 #endif
120
121 #ifdef JP
122 # if defined(EUC)
123 #  define iskanji(x) (((unsigned char)(x) >= 0xa1 && (unsigned char)(x) <= 0xfe) || (unsigned char)(x) == 0x8e)
124 #  define iskana(x)  (0)
125 # elif defined(SJIS)
126 #  define iskanji(x) ((0x81 <= (unsigned char)(x) && (unsigned char)(x) <= 0x9f) || (0xe0 <= (unsigned char)(x) && (unsigned char)(x) <= 0xfc))
127 #  define iskana(x)  (((unsigned char)(x) >= 0xA0) && ((unsigned char)(x) <= 0xDF))
128 # else
129 #  error Oops! Please define "EUC" or "SJIS" for kanji-code of your system.
130 # endif
131 #endif
132
133 #endif /* INCLUDED_H_CONFIG_H */
134
135 #ifndef HAVE_CONFIG_H
136
137 #ifdef JP
138 #define USE_XIM
139 #endif
140
141 #if defined(USE_XIM)
142 #define USE_LOCALE
143 #endif
144
145 #endif /* HAVE_CONFIG_H */
146
147 /*
148  * Look through the following lines, and where a comment includes the
149  * tag "OPTION:", examine the associated "#define" statements, and decide
150  * whether you wish to keep, comment, or uncomment them.  You should not
151  * have to modify any lines not indicated by "OPTION".
152  *
153  * Note: Also examine the "system" configuration file "h-config.h"
154  * and the variable initialization file "variable.c".  If you change
155  * anything in "variable.c", you only need to recompile that file.
156  *
157  * And finally, remember that the "Makefile" will specify some rather
158  * important compile time options, like what visual module to use.
159  */
160
161 /*
162  * OPTION: for multi-user machines running the game setuid to some other
163  * user (like 'games') this SAFE_SETUID option allows the program to drop
164  * its privileges when saving files that allow for user specified pathnames.
165  * This lets the game be installed system wide without major security
166  * concerns.  There should not be any side effects on any machines.
167  *
168  * This will handle "gids" correctly once the permissions are set right.
169  */
170 #define SAFE_SETUID
171
172 /*
173  * This flag enables the "POSIX" methods for "SAFE_SETUID".
174  */
175 #ifdef _POSIX_SAVED_IDS
176 # define SAFE_SETUID_POSIX
177 #endif
178
179  /*
180  * OPTION: Handle signals
181  */
182 #define HANDLE_SIGNALS
183
184 /*
185  * OPTION: Set the "default" path to the angband "lib" directory.
186  *
187  * See "main.c" for usage, and note that this value is only used on
188  * certain machines, primarily Unix machines.  If this value is used,
189  * it will be over-ridden by the "ANGBAND_PATH" environment variable,
190  * if that variable is defined and accessable.  The final slash is
191  * optional, but it may eventually be required.
192  *
193  * Using the value "./lib/" below tells Angband that, by default,
194  * the user will run "angband" from the same directory that contains
195  * the "lib" directory.  This is a reasonable (but imperfect) default.
196  *
197  * If at all possible, you should change this value to refer to the
198  * actual location of the "lib" folder, for example, "/tmp/angband/lib/"
199  * or "/usr/games/lib/angband/", or "/pkg/angband/lib".
200  */
201 #ifndef DEFAULT_PATH
202 # define DEFAULT_PATH "./lib/"
203 #endif
204
205 /*
206  * OPTION: Create and use a hidden directory in the users home directory
207  * for storing pref-files and character-dumps.
208  */
209 #ifdef SET_UID
210 #define PRIVATE_USER_PATH "~/.angband"
211 #endif /* SET_UID */
212
213 /*
214  * On multiuser systems, add the "uid" to savefile names
215  */
216 #ifdef SET_UID
217 # define SAVEFILE_USE_UID
218 #endif
219
220 /*
221  * OPTION: Person to bother if something goes wrong.
222  */
223 /* #define MAINTAINER   "rr9@angband.org" */
224 #define MAINTAINER "echizen@users.sourceforge.jp"
225
226 #ifdef JP
227 #ifdef USE_XFT
228 #define DEFAULT_X11_FONT "monospace-24:lang=ja:spacing=90"
229 #define DEFAULT_X11_FONT_SUB "sans-serif-16:lang=ja"
230 #else
231 /*
232  * OPTION: Default font (when using X11).
233  */
234 #define DEFAULT_X11_FONT \
235         "-*-*-medium-r-normal--24-*-*-*-*-*-iso8859-1" \
236         ",-*-*-medium-r-normal--24-*-*-*-*-*-jisx0208.1983-0"
237 /*      "12x24" \
238         ",kanji24"*/
239 #define DEFAULT_X11_FONT_SUB \
240         "-*-*-medium-r-normal--16-*-*-*-*-*-iso8859-1" \
241         ",-*-*-medium-r-normal--16-*-*-*-*-*-jisx0208.1983-0"
242 #endif
243 /*      "8x16" \
244         ",kanji16"*/
245
246 /*
247  * OPTION: Default fonts (when using X11)
248  */
249 #define DEFAULT_X11_FONT_0              DEFAULT_X11_FONT
250 #define DEFAULT_X11_FONT_1              DEFAULT_X11_FONT_SUB
251 #define DEFAULT_X11_FONT_2              DEFAULT_X11_FONT_SUB
252 #define DEFAULT_X11_FONT_3              DEFAULT_X11_FONT_SUB
253 #define DEFAULT_X11_FONT_4              DEFAULT_X11_FONT_SUB
254 #define DEFAULT_X11_FONT_5              DEFAULT_X11_FONT_SUB
255 #define DEFAULT_X11_FONT_6              DEFAULT_X11_FONT_SUB
256 #define DEFAULT_X11_FONT_7              DEFAULT_X11_FONT_SUB
257
258 #else
259 /*
260  * OPTION: Default font (when using X11).
261  */
262 #define DEFAULT_X11_FONT                "9x15"
263
264 /*
265  * OPTION: Default fonts (when using X11)
266  */
267 #define DEFAULT_X11_FONT_0              "10x20"
268 #define DEFAULT_X11_FONT_1              "9x15"
269 #define DEFAULT_X11_FONT_2              "9x15"
270 #define DEFAULT_X11_FONT_3              "5x8"
271 #define DEFAULT_X11_FONT_4              "5x8"
272 #define DEFAULT_X11_FONT_5              "5x8"
273 #define DEFAULT_X11_FONT_6              "5x8"
274 #define DEFAULT_X11_FONT_7              "5x8"
275 #endif
276
277 /*
278  * Hack -- Mach-O (native binary format of OS X) is basically a Un*x
279  * but has Mac OS/Windows-like user interface
280  */
281 #ifdef MACH_O_CARBON
282 # ifdef PRIVATE_USER_PATH
283 #  undef PRIVATE_USER_PATH
284 # endif
285 # ifdef SAVEFILE_USE_UID
286 #  undef SAVEFILE_USE_UID
287 # endif
288 #endif
289
290 #ifndef HAVE_CONFIG_H
291 #define WORLD_SCORE
292 #endif /* HAVE_CONFIG_H */