config1.h

Go to the documentation of this file.
00001 /*      SCCS Id: @(#)config1.h  3.4     1999/12/05      */
00002 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
00003 /* NetHack may be freely redistributed.  See license for details. */
00004 
00005 #ifndef CONFIG1_H
00006 #define CONFIG1_H
00007 
00008 /*
00009  * MS DOS - compilers
00010  *
00011  * Microsoft C auto-defines MSDOS,
00012  * Borland C   auto-defines __MSDOS__,
00013  * DJGPP       auto-defines MSDOS.
00014  */
00015 
00016 /* #define MSDOS */     /* use if not defined by compiler or cases below */
00017 
00018 #ifdef __MSDOS__        /* for Borland C */
00019 # ifndef MSDOS
00020 # define MSDOS
00021 # endif
00022 #endif
00023 
00024 #ifdef __TURBOC__
00025 # define __MSC          /* increase Borland C compatibility in libraries */
00026 #endif
00027 
00028 #ifdef MSDOS
00029 # undef UNIX
00030 #endif
00031 
00032 /*
00033  * Mac Stuff.
00034  */
00035 #ifdef macintosh        /*      Auto-defined symbol for MPW compilers (sc and mrc) */
00036 # define MAC
00037 #endif
00038 
00039 #ifdef THINK_C          /* Think C auto-defined symbol */
00040 # define MAC
00041 # define NEED_VARARGS
00042 #endif
00043 
00044 #ifdef __MWERKS__       /* defined by Metrowerks' Codewarrior compiler */
00045 # ifndef __BEOS__       /* BeOS */
00046 #  define MAC
00047 # endif
00048 # define NEED_VARARGS
00049 # define USE_STDARG
00050 #endif
00051 
00052 #if defined(MAC) || defined(__BEOS__)
00053 # define DLB
00054 # undef UNIX
00055 #endif
00056 
00057 #ifdef __BEOS__
00058 # define NEED_VARARGS
00059 #endif
00060 
00061 
00062 /*
00063  * Amiga setup.
00064  */
00065 #ifdef AZTEC_C  /* Manx auto-defines this */
00066 # ifdef MCH_AMIGA       /* Manx auto-defines this for AMIGA */
00067 #  ifndef AMIGA
00068 #define AMIGA           /* define for Commodore-Amiga */
00069 #  endif                /* (SAS/C auto-defines AMIGA) */
00070 #define AZTEC_50        /* define for version 5.0 of manx */
00071 # endif
00072 #endif
00073 #ifdef __SASC_60
00074 # define NEARDATA __near /* put some data close */
00075 #else
00076 # ifdef _DCC
00077 # define NEARDATA __near /* put some data close */
00078 # else
00079 # define NEARDATA
00080 # endif
00081 #endif
00082 #ifdef AMIGA
00083 # define NEED_VARARGS
00084 # undef UNIX
00085 # define DLB
00086 # define HACKDIR "NetHack:"
00087 # define NO_MACRO_CPATH
00088 #endif
00089 
00090 /*
00091  * Atari auto-detection
00092  */
00093 
00094 #ifdef atarist
00095 # undef UNIX
00096 # ifndef TOS
00097 # define TOS
00098 # endif
00099 #else
00100 # ifdef __MINT__
00101 #  undef UNIX
00102 #  ifndef TOS
00103 #  define TOS
00104 #  endif
00105 # endif
00106 #endif
00107 
00108 /*
00109  * Windows NT Autodetection
00110  */
00111 #ifdef _WIN32_WCE
00112 #define WIN_CE
00113 # ifndef WIN32
00114 # define WIN32
00115 # endif
00116 #endif
00117 
00118 #ifdef WIN32
00119 # undef UNIX
00120 # undef MSDOS
00121 # define NHSTDC
00122 # define USE_STDARG
00123 # define NEED_VARARGS
00124 
00125 #ifndef WIN_CE
00126 # define STRNCMPI
00127 # define STRCMPI
00128 #endif
00129 
00130 #endif
00131 
00132 
00133 #if defined(__linux__) && defined(__GNUC__) && !defined(_GNU_SOURCE)
00134 /* ensure _GNU_SOURCE is defined before including any system headers */
00135 # define _GNU_SOURCE
00136 #endif
00137 
00138 #ifdef VMS      /* really old compilers need special handling, detected here */
00139 # undef UNIX
00140 # ifdef __DECC
00141 #  ifndef __DECC_VER    /* buggy early versions want widened prototypes */
00142 #   define NOTSTDC      /* except when typedefs are involved            */
00143 #   define USE_VARARGS
00144 #  else
00145 #   define NHSTDC
00146 #   define USE_STDARG
00147 #   define POSIX_TYPES
00148 #   define _DECC_V4_SOURCE      /* avoid some incompatible V5.x changes */
00149 #  endif
00150 #  undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */
00151 # else
00152 #  ifdef VAXC   /* must use CC/DEFINE=ANCIENT_VAXC for vaxc v2.2 or older */
00153 #   ifdef ANCIENT_VAXC  /* vaxc v2.2 and earlier [lots of warnings to come] */
00154 #    define KR1ED       /* simulate defined() */
00155 #    define USE_VARARGS
00156 #   else                /* vaxc v2.3,2.4,or 3.x, or decc in vaxc mode */
00157 #     if defined(USE_PROTOTYPES) /* this breaks 2.2 (*forces* use of ANCIENT)*/
00158 #      define __STDC__ 0 /* vaxc is not yet ANSI compliant, but close enough */
00159 #      define signed    /* well, almost close enough */
00160 #include <stddef.h>
00161 #      define UNWIDENED_PROTOTYPES
00162 #     endif
00163 #     define USE_STDARG
00164 #   endif
00165 #  endif /*VAXC*/
00166 # endif /*__DECC*/
00167 # ifdef VERYOLD_VMS     /* v4.5 or earlier; no longer available for testing */
00168 #  define USE_OLDARGS   /* <varargs.h> is there, vprintf & vsprintf aren't */
00169 #  ifdef USE_VARARGS
00170 #   undef USE_VARARGS
00171 #  endif
00172 #  ifdef USE_STDARG
00173 #   undef USE_STDARG
00174 #  endif
00175 # endif
00176 #endif /*VMS*/
00177 
00178 #ifdef vax
00179 /* just in case someone thinks a DECstation is a vax. It's not, it's a mips */
00180 # ifdef ULTRIX_PROTO
00181 #  undef ULTRIX_PROTO
00182 # endif
00183 # ifdef ULTRIX_CC20
00184 #  undef ULTRIX_CC20
00185 # endif
00186 #endif
00187 
00188 #ifdef KR1ED            /* For compilers which cannot handle defined() */
00189 #define defined(x) (-x-1 != -1)
00190 /* Because:
00191  * #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
00192  * #define FOO 1 or on command-line -DFOO
00193  *      => defined(1) => (-1 != - 1 - 1) => 1
00194  * if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
00195  * for -DFOO, oh well.
00196  *      => defined(0) => (-1 != - 0 - 1) => 0
00197  *
00198  * But:
00199  * defined("") => (-1 != - "" - 1)
00200  *   [which is an unavoidable catastrophe.]
00201  */
00202 #endif
00203 
00204 #endif  /* CONFIG1_H */