]> granicus.if.org Git - nethack/commitdiff
vms update revisited
authorPatR <rankin@nethack.org>
Mon, 15 Apr 2019 20:48:27 +0000 (13:48 -0700)
committerPatR <rankin@nethack.org>
Mon, 15 Apr 2019 20:48:27 +0000 (13:48 -0700)
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.

include/tradstdc.h
include/unixconf.h
include/vmsconf.h

index 8817872353835788616c4485bf4f9a3193295fef..12a0d4afe2cb5d528596acb0fa09ed33cfba2b9e 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */
@@ -320,6 +320,22 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
 #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
index b7c5cabe005eb22de269e56e03486952c1bd6614..c126d6839b9621db112c55b22be148b24610eece 100644 (file)
@@ -1,4 +1,4 @@
-/* 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
index bebe6b468f670258817f427791027bf263a5c3eb..a815e704a81f966ec40f08f8cc748504581e4d62 100644 (file)
@@ -1,4 +1,4 @@
-/* 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. */
@@ -192,22 +192,6 @@ PANICTRACE_GDB=2  #at conclusion of panic, show a call traceback and then
 #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
@@ -262,7 +246,7 @@ typedef __mode_t mode_t;
 #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"