Source:NetHack 3.6.0/include/config1.h

From NetHackWiki
(Redirected from Source:Config1.h)
Jump to: navigation, search

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