Source:NetHack 3.6.1/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.1. To link to a particular line, write [[Source:NetHack 3.6.1/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.  /*-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.  #define USE_VARARGS
  151.  #else
  152.  #define NHSTDC
  153.  #define USE_STDARG
  154.  #define POSIX_TYPES
  155.  #define _DECC_V4_SOURCE /* avoid some incompatible V5.x changes */
  156.  #endif
  157.  #undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
  158.  #ifdef VAXC    /* DEC C in VAX C compatibility mode; 'signed' works   */
  159.  #define signed /* but causes diagnostic about VAX C not supporting it */
  160.  #endif
  161.  #else
  162.  #ifdef VAXC /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
  163.  #define signed
  164.  #ifdef ANCIENT_VAXC /* vaxc v2.2 and earlier [lots of warnings to come] */
  165.  #define KR1ED       /* simulate defined() */
  166.  #define USE_VARARGS
  167.  #else                       /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
  168.  #if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
  169.  #define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
  170.  #include <stddef.h>
  171.  #define UNWIDENED_PROTOTYPES
  172.  #endif
  173.  #define USE_STDARG
  174.  #endif
  175.  #endif              /*VAXC*/
  176.  #endif              /*__DECC*/
  177.  #ifdef VERYOLD_VMS  /* v4.5 or earlier; no longer available for testing */
  178.  #define USE_OLDARGS /* <varargs.h> is there, vprintf & vsprintf aren't */
  179.  #ifdef USE_VARARGS
  180.  #undef USE_VARARGS
  181.  #endif
  182.  #ifdef USE_STDARG
  183.  #undef USE_STDARG
  184.  #endif
  185.  #endif
  186.  #endif /*VMS*/
  187.  
  188.  #ifdef vax
  189.  /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
  190.  #ifdef ULTRIX_PROTO
  191.  #undef ULTRIX_PROTO
  192.  #endif
  193.  #ifdef ULTRIX_CC20
  194.  #undef ULTRIX_CC20
  195.  #endif
  196.  #endif
  197.  
  198.  #ifdef KR1ED /* For compilers which cannot handle defined() */
  199.  #define defined(x) (-x - 1 != -1)
  200.  /* Because:
  201.   * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
  202.   * #define FOO 1 or on command-line -DFOO
  203.   *	=> defined(1) => (-1 != - 1 - 1) => 1
  204.   * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
  205.   * for -DFOO, oh well.
  206.   *	=> defined(0) => (-1 != - 0 - 1) => 0
  207.   *
  208.   * But:
  209.   * defined("") => (-1 != - "" - 1)
  210.   *   [which is an unavoidable catastrophe.]
  211.   */
  212.  #endif
  213.  
  214.  #endif /* CONFIG1_H */