vms update revisited
Redo the UCHAR_P handling fromdf84da3ec2(5 weeks ago) and02b21865fdfollowup. 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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user