Redo the UCHAR_P handling from
df84da3ec2f38460e137a4bdfb25148262d544c2
(5 weeks ago) and
02b21865fd288626db6984d963078afd0ec34716 followup.
The earlier #define was happening too late in the #include sequence;
tradstdc.h is processed before global.h+(vmsconf.h,unixconf.h,...).
Also, DEC C in 'common' mode complains about indented '#' starting a
line but not in column 1. Putting #pragma in column 2 was deliberate
in case of an ancient compiler which doesn't understand that directive.
Splitting the difference via non-indented '# pragma' may or may not
mollify the latter when it's bypassing conditionally excluded code.
-/* 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 $ */
+/* NetHack 3.6 tradstdc.h $NHDT-Date: 1555361295 2019/04/15 20:48:15 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.36 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2006. */
/* NetHack may be freely redistributed. See license for details. */
#endif
#endif
+/* this applies to both VMS and Digital Unix/HP Tru64 */
+#ifdef WIDENED_PROTOTYPES
+/* 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
+#endif
+#endif
+
/* These are used for arguments within FDECL/VDECL prototype declarations.
*/
#ifdef UNWIDENED_PROTOTYPES
-/* NetHack 3.6 unixconf.h $NHDT-Date: 1552074505 2019/03/08 19:48:25 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.41 $ */
+/* NetHack 3.6 unixconf.h $NHDT-Date: 1555361298 2019/04/15 20:48:18 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.42 $ */
/* 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
-#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: 1552074506 2019/03/08 19:48:26 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.29 $ */
+/* NetHack 3.6 vmsconf.h $NHDT-Date: 1555361299 2019/04/15 20:48:19 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.30 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
#endif
#endif
-/* tradstdc.h has't set this up yet, but config1.h might have */
-#ifndef UNWIDENED_PROTOTYPES
-/* 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
-#endif
-#endif
-
#ifdef __DECC
#define STRICT_REF_DEF /* used in lev_main.c */
#endif
#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
+# pragma message disable DOLLARID
#endif
#include "system.h"