Source:NetHack 3.6.5/include/config1.h

From NetHackWiki
Jump to navigation Jump to search

Below is the full text to config1.h from the source code of NetHack 3.6.5. To link to a particular line, write [[Source:NetHack 3.6.5/include/config1.h#line12]], for example.

The NetHack General Public License applies to screenshots, source code and other content from NetHack.

This content was modified from the original NetHack source code distribution (by splitting up NetHack content between wiki pages, and possibly further editing). See the page history for a list of who changed it, and on what dates.

1. /* NetHack 3.6	config1.h	$NHDT-Date: 1555702947 2019/04/19 19:42:27 $  $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.21 $ */
2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
3. /*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
4. /* NetHack may be freely redistributed.  See license for details. */
5. 
6. #ifndef CONFIG1_H
7. #define CONFIG1_H
8. 
9. /*
10.  * MS DOS - compilers
11.  *
12.  * Microsoft C auto-defines MSDOS,
13.  * Borland C   auto-defines __MSDOS__,
14.  * DJGPP       auto-defines MSDOS.
15.  */
16. 
17. /* #define MSDOS */ /* use if not defined by compiler or cases below */
18. 
19. #ifdef __MSDOS__ /* for Borland C */
20. #ifndef MSDOS
21. #define MSDOS
22. #endif
23. #endif
24. 
25. #ifdef __TURBOC__
26. #define __MSC /* increase Borland C compatibility in libraries */
27. #endif
28. 
29. #ifdef MSDOS
30. #undef UNIX
31. #endif
32. 
33. /*
34.  * Mac Stuff.
35.  */
36. #if defined(__APPLE__) && defined(__MACH__)
37. #define MACOSX
38. #endif
39. 
40. #ifdef macintosh /* Auto-defined symbol for MPW compilers (sc and mrc) */
41. #define MAC
42. #endif
43. 
44. #ifdef THINK_C /* Think C auto-defined symbol */
45. #define MAC
46. #define NEED_VARARGS
47. #endif
48. 
49. #ifdef __MWERKS__ /* defined by Metrowerks' Codewarrior compiler */
50. #ifndef __BEOS__  /* BeOS */
51. #define MAC
52. #endif
53. #define NEED_VARARGS
54. #define USE_STDARG
55. #endif
56. 
57. #if defined(MAC) || defined(__BEOS__)
58. #define DLB
59. #undef UNIX
60. #endif
61. 
62. #ifdef __BEOS__
63. #define NEED_VARARGS
64. #endif
65. 
66. /*
67.  * Amiga setup.
68.  */
69. #ifdef AZTEC_C   /* Manx auto-defines this */
70. #ifdef MCH_AMIGA /* Manx auto-defines this for AMIGA */
71. #ifndef AMIGA
72. #define AMIGA    /* define for Commodore-Amiga */
73. #endif           /* (SAS/C auto-defines AMIGA) */
74. #define AZTEC_50 /* define for version 5.0 of manx */
75. #endif
76. #endif
77. #ifdef __SASC_60
78. #define NEARDATA __near /* put some data close */
79. #else
80. #ifdef _DCC
81. #define NEARDATA __near /* put some data close */
82. #else
83. #define NEARDATA
84. #endif
85. #endif
86. #ifdef AMIGA
87. #define NEED_VARARGS
88. #undef UNIX
89. #define DLB
90. #define HACKDIR "NetHack:"
91. #define NO_MACRO_CPATH
92. #endif
93. 
94. /*
95.  * Atari auto-detection
96.  */
97. 
98. #ifdef atarist
99. #undef UNIX
100. #ifndef TOS
101. #define TOS
102. #endif
103. #else
104. #ifdef __MINT__
105. #undef UNIX
106. #ifndef TOS
107. #define TOS
108. #endif
109. #endif
110. #endif
111. 
112. /*
113.  * Windows NT Autodetection
114.  */
115. #ifdef _WIN32_WCE
116. #define WIN_CE
117. #ifndef WIN32
118. #define WIN32
119. #endif
120. #endif
121. 
122. #if defined(_WIN32) && !defined(WIN32)
123. #define WIN32
124. #endif
125. 
126. #ifdef WIN32
127. #undef UNIX
128. #undef MSDOS
129. #define NHSTDC
130. #define USE_STDARG
131. #define NEED_VARARGS
132. 
133. #ifndef WIN_CE
134. #define STRNCMPI
135. #define STRCMPI
136. #endif
137. 
138. #endif
139. 
140. #if defined(__linux__) && defined(__GNUC__) && !defined(_GNU_SOURCE)
141. /* ensure _GNU_SOURCE is defined before including any system headers */
142. #define _GNU_SOURCE
143. #endif
144. 
145. #ifdef VMS /* really old compilers need special handling, detected here */
146. #undef UNIX
147. #ifdef __DECC
148. #ifndef __DECC_VER /* buggy early versions want widened prototypes */
149. #define NOTSTDC    /* except when typedefs are involved            */
150.         /* [25 or so years later...  That was probably uchar widening to */
151.         /* 'unsigned int' rather than anything to do with typedefs.  pr] */
152. #define USE_VARARGS
153. #else
154. #define NHSTDC
155. #define USE_STDARG
156. #define POSIX_TYPES
157. #ifndef _DECC_V4_SOURCE /* only def here if not already def'd on comd line */
158. #define _DECC_V4_SOURCE /* avoid some incompatible V5.x (and later) changes */
159. #endif
160. #endif /*__DECC_VER*/
161. #undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
162. #ifdef VAXC    /* DEC C in VAX C compatibility mode; 'signed' works   */
163. #define signed /* but causes diagnostic about VAX C not supporting it */
164. #endif
165. #else /*!__DECC*/
166. #ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
167. #define signed
168. #ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier [lots of warnings to come] */
169. #define KR1ED       /* simulate defined() */
170. #define USE_VARARGS
171. #else                       /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
172. #if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
173. #define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
174. #include <stddef.h>
175. #define UNWIDENED_PROTOTYPES
176. #endif
177. #define USE_STDARG
178. #endif
179. #endif              /*VAXC*/
180. #endif              /*__DECC*/
181. #ifdef VERYOLD_VMS  /* v4.5 or earlier; no longer available for testing */
182. #define USE_OLDARGS /* <varargs.h> is there, vprintf & vsprintf aren't */
183. #ifdef USE_VARARGS
184. #undef USE_VARARGS
185. #endif
186. #ifdef USE_STDARG
187. #undef USE_STDARG
188. #endif
189. #endif
190. #endif /*VMS*/
191. 
192. #ifdef vax
193. /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
194. #ifdef ULTRIX_PROTO
195. #undef ULTRIX_PROTO
196. #endif
197. #ifdef ULTRIX_CC20
198. #undef ULTRIX_CC20
199. #endif
200. #endif
201. 
202. #ifdef KR1ED /* For compilers which cannot handle defined() */
203. #define defined(x) (-x - 1 != -1)
204. /* Because:
205.  * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
206.  * #define FOO 1 or on command-line -DFOO
207.  *      => defined(1) => (-1 != - 1 - 1) => 1
208.  * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
209.  * for -DFOO, oh well.
210.  *      => defined(0) => (-1 != - 0 - 1) => 0
211.  *
212.  * But:
213.  * defined("") => (-1 != - "" - 1)
214.  *   [which is an unavoidable catastrophe.]
215.  */
216. #endif
217. 
218. #endif /* CONFIG1_H */