Source:NetHack 3.4.3/include/config1.h

From NetHackWiki
Jump to: navigation, search

Below is the full text to include/config1.h from NetHack 3.4.3. To link to a particular line, write [[config1.h#line123]], for example.

  1. /*	SCCS Id: @(#)config1.h	3.4	1999/12/05	*/
  2. /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
  3. /* NetHack may be freely redistributed.  See license for details. */

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