Source:NetHack 5.0.0/include/config1.h
Jump to navigation
Jump to search
Below is the full text to config1.h from the source code of NetHack 5.0.0. To link to a particular line, write [[Source:NetHack 5.0.0/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 5.0 config1.h $NHDT-Date: 1596498530 2020/08/03 23:48:50 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.23 $ */ 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. #ifndef CROSSCOMPILE 32. #define SHORT_FILENAMES 33. #endif 34. /* this is not fully-implemented yet for msdos */ 35. #ifdef ENHANCED_SYMBOLS 36. #undef ENHANCED_SYMBOLS 37. #endif 38. #endif 39. 40. /* 41. * Mac Stuff. 42. */ 43. #if defined(__APPLE__) && defined(__MACH__) 44. #define MACOS 45. #endif 46. 47. #ifdef macintosh /* Auto-defined symbol for MPW compilers (sc and mrc) */ 48. #define MACOS9 49. #endif 50. 51. #ifdef THINK_C /* Think C auto-defined symbol */ 52. #define MACOS9 53. #define NEED_VARARGS 54. #endif 55. 56. #ifdef __MWERKS__ /* defined by Metrowerks' Codewarrior compiler */ 57. #ifndef __BEOS__ /* BeOS */ 58. #define MACOS9 59. #endif 60. #define NEED_VARARGS 61. #define USE_STDARG 62. #endif 63. 64. #if defined(MACOS9) || defined(__BEOS__) 65. #define DLB 66. #undef UNIX 67. #endif 68. 69. #ifdef __BEOS__ 70. #define NEED_VARARGS 71. #endif 72. 73. /* 74. * Amiga setup. 75. */ 76. #ifdef AZTEC_C /* Manx auto-defines this */ 77. #ifdef MCH_AMIGA /* Manx auto-defines this for AMIGA */ 78. #ifndef AMIGA 79. #define AMIGA /* define for Commodore-Amiga */ 80. #endif /* (SAS/C auto-defines AMIGA) */ 81. #define AZTEC_50 /* define for version 5.0 of manx */ 82. #endif 83. #endif 84. #ifdef __SASC_60 85. #define NEARDATA __near /* put some data close */ 86. #else 87. #ifdef _DCC 88. #define NEARDATA __near /* put some data close */ 89. #else 90. #define NEARDATA 91. #endif 92. #endif 93. #ifdef AMIGA 94. #define NEED_VARARGS 95. #undef UNIX 96. #define DLB 97. #define HACKDIR "NetHack:" 98. 99. #endif 100. 101. /* 102. * Atari auto-detection 103. */ 104. 105. #ifdef atarist 106. #undef UNIX 107. #ifndef TOS 108. #define TOS 109. #endif 110. #else 111. #ifdef __MINT__ 112. #undef UNIX 113. #ifndef TOS 114. #define TOS 115. #endif 116. #endif 117. #endif 118. 119. /* 120. * Windows NT Autodetection 121. */ 122. #ifdef _WIN32_WCE 123. #define WIN_CE 124. #ifndef WIN32 125. #define WIN32 126. #endif 127. #endif 128. 129. #if defined(_WIN32) && !defined(WIN32) 130. #define WIN32 131. #endif 132. 133. #ifdef WIN32 134. #undef UNIX 135. #undef MSDOS 136. #define NHSTDC 137. #define USE_STDARG 138. #define NEED_VARARGS 139. 140. #ifndef WIN_CE 141. #define STRNCMPI 142. #define STRCMPI 143. #endif 144. 145. #endif 146. 147. #if defined(__linux__) && defined(__GNUC__) && !defined(_GNU_SOURCE) 148. /* ensure _GNU_SOURCE is defined before including any system headers */ 149. #define _GNU_SOURCE 150. #endif 151. 152. #ifdef __vms 153. #ifndef VMS 154. #define VMS 155. #endif 156. #endif 157. 158. #ifdef VMS /* really old compilers need special handling, detected here */ 159. #undef UNIX 160. #ifdef __DECC 161. #ifndef __DECC_VER /* buggy early versions want widened prototypes */ 162. #define NOTSTDC /* except when typedefs are involved */ 163. /* [25 or so years later... That was probably uchar widening to */ 164. /* 'unsigned int' rather than anything to do with typedefs. pr] */ 165. #define USE_VARARGS 166. #else /* __DECC_VER not defined */ 167. #if __DECC_VER >= 70000000 168. #define VMSVSI 169. #endif /* _DECC_VER >= 70000000 */ 170. #ifndef VMSVSI 171. #define NHSTDC 172. #define USE_STDARG 173. #define POSIX_TYPES 174. #ifndef _DECC_V4_SOURCE /* only def here if not already def'd on comd line */ 175. #define _DECC_V4_SOURCE /* avoid some incompatible V5.x (and later) changes */ 176. #endif 177. #endif /* !VMSVSI */ 178. #endif /*__DECC_VER*/ 179. #undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */ 180. #ifndef VMSVSI 181. #ifdef VAXC /* DEC C in VAX C compatibility mode; 'signed' works */ 182. #define signed /* but causes diagnostic about VAX C not supporting it */ 183. #endif 184. #else /*!__DECC*/ 185. #ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */ 186. #define signed 187. #ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier [lots of warnings to come] */ 188. #define KR1ED /* simulate defined() */ 189. #define USE_VARARGS 190. #else /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */ 191. #if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/ 192. #define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */ 193. #include <stddef.h> 194. #define UNWIDENED_PROTOTYPES 195. #endif 196. #define USE_STDARG 197. #endif 198. #endif /*VAXC*/ 199. #endif /*__DECC*/ 200. #ifdef VERYOLD_VMS /* v4.5 or earlier; no longer available for testing */ 201. #define USE_OLDARGS /* <varargs.h> is there, vprintf & vsprintf aren't */ 202. #ifdef USE_VARARGS 203. #undef USE_VARARGS 204. #endif 205. #ifdef USE_STDARG 206. #undef USE_STDARG 207. #endif 208. #endif 209. #endif /* !VMSVSI */ 210. #endif /*VMS*/ 211. 212. #ifdef vax 213. /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */ 214. #ifdef ULTRIX_PROTO 215. #undef ULTRIX_PROTO 216. #endif 217. #ifdef ULTRIX_CC20 218. #undef ULTRIX_CC20 219. #endif 220. #endif 221. 222. #ifdef KR1ED /* For compilers which cannot handle defined() */ 223. #define defined(x) (-x - 1 != -1) 224. /* Because: 225. * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1 226. * #define FOO 1 or on command-line -DFOO 227. * => defined(1) => (-1 != - 1 - 1) => 1 228. * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1 229. * for -DFOO, oh well. 230. * => defined(0) => (-1 != - 0 - 1) => 0 231. * 232. * But: 233. * defined("") => (-1 != - "" - 1) 234. * [which is an unavoidable catastrophe.] 235. */ 236. #endif 237. 238. #endif /* CONFIG1_H */