-/* NetHack 3.6 config1.h $NHDT-Date: 1432512781 2015/05/25 00:13:01 $ $NHDT-Branch: master $:$NHDT-Revision: 1.17 $ */
+/* NetHack 3.6 config1.h $NHDT-Date: 1552007489 2019/03/08 01:11:29 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.20 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Kenneth Lorber, Kensington, Maryland, 2015. */
/* NetHack may be freely redistributed. See license for details. */
#undef UNIX
#ifdef __DECC
#ifndef __DECC_VER /* buggy early versions want widened prototypes */
-#define NOTSTDC /* except when typedefs are involved */
+#define NOTSTDC /* except when typedefs are involved */
+ /* [25 or so years later... That was probably uchar widening to */
+ /* 'unsigned int' rather than anything to do with typedefs. pr] */
#define USE_VARARGS
#else
#define NHSTDC
/* Because:
* #define FOO => FOO={} => defined( ) => (-1 != - - 1) => 1
* #define FOO 1 or on command-line -DFOO
- * => defined(1) => (-1 != - 1 - 1) => 1
+ * => defined(1) => (-1 != - 1 - 1) => 1
* if FOO isn't defined, FOO=0. But some compilers default to 0 instead of 1
* for -DFOO, oh well.
- * => defined(0) => (-1 != - 0 - 1) => 0
+ * => defined(0) => (-1 != - 0 - 1) => 0
*
* But:
* defined("") => (-1 != - "" - 1)
-/* NetHack 3.6 tradstdc.h $NHDT-Date: 1545270756 2018/12/20 01:52:36 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.34 $ */
+/* NetHack 3.6 tradstdc.h $NHDT-Date: 1552007504 2019/03/08 01:11:44 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.35 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2006. */
/* NetHack may be freely redistributed. See license for details. */
#endif
/*
- * According to ANSI, prototypes for old-style declarations must widen the
- * arguments to int. However, the MSDOS compilers accept shorter arguments
- * (char, short, etc.) in prototypes and do typechecking with them. Therefore
- * this mess to allow the better typechecking while also allowing some
- * prototypes for the ANSI compilers so people quit trying to fix the
- * prototypes to match the standard and thus lose the typechecking.
+ * According to ANSI C, prototypes for old-style function definitions like
+ * int func(arg) short arg; { ... }
+ * must specify widened arguments (char and short to int, float to double),
+ * int func(int);
+ * same as how narrow arguments get passed when there is no prototype info.
+ * However, various compilers accept shorter arguments (char, short, etc.)
+ * in prototypes and do typechecking with them. Therefore this mess to
+ * allow the better typechecking while also allowing some prototypes for
+ * the ANSI compilers so people quit trying to fix the prototypes to match
+ * the standard and thus lose the typechecking.
*/
#if defined(MSDOS) && !defined(__GO32__)
#define UNWIDENED_PROTOTYPES
#ifdef WIDENED_PROTOTYPES
#define CHAR_P int
#define SCHAR_P int
+#ifndef UCHAR_P
#define UCHAR_P int
+#endif
#define XCHAR_P int
#define SHORT_P int
#define BOOLEAN_P int
-/* NetHack 3.6 unixconf.h $NHDT-Date: 1550532737 2019/02/18 23:32:17 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.39 $ */
+/* NetHack 3.6 unixconf.h $NHDT-Date: 1552007506 2019/03/08 01:11:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.40 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
#endif
#endif
+/* Digital Unix/HP Tru64 -- see vmsconf.h for explanation */
+#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
+#define UCHAR_P unsigned int
+#else
+#define UCHAR_P int
+#endif
+
/*
* BSD/ULTRIX systems are normally the only ones that can suspend processes.
* Suspending NetHack processes cleanly should be easy to add to other systems
-/* NetHack 3.6 vmsconf.h $NHDT-Date: 1432512780 2015/05/25 00:13:00 $ $NHDT-Branch: master $:$NHDT-Revision: 1.22 $ */
+/* NetHack 3.6 vmsconf.h $NHDT-Date: 1552007507 2019/03/08 01:11:47 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.28 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
#define RANDOM /* use sys/share/random.c instead of vaxcrtl rand */
+/* config.h defines USE_ISAAC64; we'll use it on Alpha or IA64 but not VAX;
+ it overrides RANDOM */
+#if (defined(VAX) || defined(vax) || defined(__vax)) && defined(USE_ISAAC64)
+#undef ISAAC64
+#endif
+
#define FCMASK 0660 /* file creation mask */
/*
#endif
#endif
+/* ANSI C uses "value preserving rules", where 'unsigned char' and
+ 'unsigned short' promote to 'int' if signed int is big enough to hold
+ all possible values, rather than traditional "sign preserving rules"
+ where 'unsigned char' and 'unsigned short' promote to 'unsigned int'.
+ However, the ANSI C rules aren't binding on non-ANSI compilers.
+ When DEC C (aka Compaq C, then HP C) is in non-standard 'common' mode
+ it supports prototypes that expect widened types, but it uses the old
+ sign preserving rules for how to widen narrow unsigned types. (In its
+ default 'relaxed' mode, __STDC__ is 1 and uchar widens to 'int'.) */
+#if defined(__DECC) && (!defined(__STDC__) || !__STDC__)
+#define UCHAR_P unsigned int
+#else
+#define UCHAR_P int
+#endif
+
#ifdef __DECC
#define STRICT_REF_DEF /* used in lev_main.c */
#endif
#define tgetch vms_getchar
+#if defined(__DECC_VER) && (__DECC_VER >= 50000000)
+ /* for cc/Standard=ANSI89, suppress notification that '$' in identifiers
+ is an extension; sys/vms/*.c needs it regardless of strict ANSI mode */
+ #pragma message disable DOLLARID
+#endif
+
#include "system.h"
#define index strchr
# if defined(RANDOM)
# define Rand() random()
/* VMS V7 adds these entry points to DECC$SHR; stick with the nethack-supplied
- code to avoid having to deal with version-specific conditionalized builds
- */
+ code to avoid having to deal with version-specific conditionalized builds */
# define random nh_random
# define srandom nh_srandom
# define initstate nh_initstate
#define link(f1, f2) vms_link(f1, f2) /* vmsfiles.c */
#define open(f, k, m) vms_open(f, k, m) /* vmsfiles.c */
#define fopen(f, m) vms_fopen(f, m) /* vmsfiles.c */
-/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
+/* #define unlink(f0) vms_unlink(f0) /* vmsfiles.c */
#ifdef VERYOLD_VMS
#define unlink(f0) delete (f0) /* vaxcrtl */
#else