From 4761bf190eec86f2fa519015de2de22e486f5249 Mon Sep 17 00:00:00 2001 From: nhmall Date: Mon, 22 May 2023 20:50:35 -0400 Subject: [PATCH] OpenVMS update follow-up --- include/config1.h | 15 ++++++++++++++- include/vmsconf.h | 35 +++++++++++------------------------ src/end.c | 4 ++-- sys/vms/vmsfiles.c | 4 ++-- sys/vms/vmsmail.c | 4 ++-- sys/vms/vmsmain.c | 4 ++-- sys/vms/vmsmisc.c | 4 ++-- sys/vms/vmstty.c | 8 ++++---- sys/vms/vmsunix.c | 8 ++++---- 9 files changed, 43 insertions(+), 43 deletions(-) diff --git a/include/config1.h b/include/config1.h index e79da0ecb..c4e14610c 100644 --- a/include/config1.h +++ b/include/config1.h @@ -145,6 +145,12 @@ #define _GNU_SOURCE #endif +#ifdef __vms +#ifndef VMS +#define VMS +#endif +#endif + #ifdef VMS /* really old compilers need special handling, detected here */ #undef UNIX #ifdef __DECC @@ -153,15 +159,21 @@ /* [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 +#else /* __DECC_VER not defined */ +#if __DECC_VER >= 70000000 +#define VMSVSI +#endif /* _DECC_VER >= 70000000 */ +#ifndef VMSVSI #define NHSTDC #define USE_STDARG #define POSIX_TYPES #ifndef _DECC_V4_SOURCE /* only def here if not already def'd on comd line */ #define _DECC_V4_SOURCE /* avoid some incompatible V5.x (and later) changes */ #endif +#endif /* !VMSVSI */ #endif /*__DECC_VER*/ #undef __HIDE_FORBIDDEN_NAMES /* need non-ANSI library support functions */ +#ifndef VMSVSI #ifdef VAXC /* DEC C in VAX C compatibility mode; 'signed' works */ #define signed /* but causes diagnostic about VAX C not supporting it */ #endif @@ -190,6 +202,7 @@ #undef USE_STDARG #endif #endif +#endif /* !VMSVSI */ #endif /*VMS*/ #ifdef vax diff --git a/include/vmsconf.h b/include/vmsconf.h index 6a28c11b7..b07b2f1f3 100644 --- a/include/vmsconf.h +++ b/include/vmsconf.h @@ -19,22 +19,6 @@ #define Local_WIZARD "NHWIZARD\0\0\0\0" #define Local_HACKDIR "DISK$USERS:[GAMES.NETHACK.3_7_X.PLAY]\0\0\0\0\0\0\0\0" -/* - * VMS9 uses a VSI C compiler and supports C99. - * It is the first version available on X86_64 so we can auto-detect it there. - */ -#ifdef __x86_64 -#define VMS9 -#endif -/* #define VMS9 */ - -#ifdef VMS9 -#ifndef __cplusplus -/* for version.c */ -typedef int64_t ssize_t; -#endif -#endif - /* * This section cleans up the stuff done in config.h so that it * shouldn't need to be modified. It's conservative so that if @@ -178,7 +162,7 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then /* config.h defines USE_ISAAC64; we'll use it on Alpha or IA64 but not VAX; it overrides RANDOM */ -#if !defined(VMS9) +#if !defined(VMSVSI) #if (defined(VAX) || defined(vax) || defined(__vax)) && defined(USE_ISAAC64) #undef ISAAC64 #endif @@ -207,6 +191,7 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then /* # define FILENAME_CMP strcmpi */ /* case insensitive */ #endif +#ifndef VMSVSI #if defined(VAXC) && !defined(ANCIENT_VAXC) #ifdef volatile #undef volatile @@ -231,10 +216,10 @@ PANICTRACE_GDB=2 #at conclusion of panic, show a call traceback and then #define ALLOCA_HACK /* used in util/panic.c */ #endif #endif +#endif /* !VMSVSI */ -#ifdef VMS9 +#ifdef VMSVSI #define NO_TERMCAP_HEADERS -#undef __HIDE_FORBIDDEN_NAMES /* C99 */ #include #include @@ -274,7 +259,7 @@ typedef int32_t off_t; #include -#ifndef VMS9 +#ifndef VMSVSI #if 0 /* is missing for old gcc versions; skip it to save time */ #include #else /* values needed from missing include file */ @@ -288,11 +273,13 @@ typedef int32_t off_t; #define tgetch vms_getchar +#ifndef VMSVSI #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 +#endif /* #include "system.h" */ @@ -311,7 +298,7 @@ typedef int32_t off_t; # endif #endif -#if !defined(VMS9) +#if !defined(VMSVSI) #ifndef __GNUC__ #ifndef bcopy #define bcopy(s, d, n) memcpy((d), (s), (n)) /* vaxcrtl */ @@ -330,16 +317,16 @@ typedef int32_t off_t; #else #define unlink(f0) remove(f0) /* vaxcrtl, decc$shr */ #endif -#endif /* VMS9 */ +#endif /* VMSVSI */ #define C$$TRANSLATE(n) c__translate(n) /* vmsfiles.c */ -#if !defined(VMS9) +#if !defined(VMSVSI) /* VMS global names are case insensitive... */ #define An vms_an #define The vms_the #define Shk_Your vms_shk_your -#endif /* VMS9 */ +#endif /* VMSVSI */ /* avoid global symbol in Alpha/VMS V1.5 STARLET library (link trouble) */ #define ospeed vms_ospeed diff --git a/src/end.c b/src/end.c index ad03e8586..c8ce83fc9 100644 --- a/src/end.c +++ b/src/end.c @@ -382,7 +382,7 @@ done_intr(int sig_unused UNUSED) done_stopprint++; (void) signal(SIGINT, SIG_IGN); #if defined(UNIX) || defined(VMS) -#ifndef VMS9 +#ifndef VMSVSI (void) signal(SIGQUIT, SIG_IGN); #endif #endif @@ -1391,7 +1391,7 @@ really_done(int how) #ifndef NO_SIGNAL (void) signal(SIGINT, (SIG_RET_TYPE) done_intr); #if defined(UNIX) || defined(VMS) || defined(__EMX__) -#ifndef VMS9 +#ifndef VMSVSI (void) signal(SIGQUIT, (SIG_RET_TYPE) done_intr); #endif sethanguphandler(done_hangup); diff --git a/sys/vms/vmsfiles.c b/sys/vms/vmsfiles.c index faf9c729f..9088a9d9c 100644 --- a/sys/vms/vmsfiles.c +++ b/sys/vms/vmsfiles.c @@ -10,7 +10,7 @@ #include "config.h" #include -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -34,7 +34,7 @@ int c__translate(int); #define C$$TRANSLATE(status) (errno = EVMSERR, vaxc$errno = (status)) #endif -#ifndef VMS9 +#ifndef VMSVSI extern unsigned long sys$parse(), sys$search(), sys$enter(), sys$remove(); extern int VDECL(lib$match_cond, (int, int, ...)); #endif diff --git a/sys/vms/vmsmail.c b/sys/vms/vmsmail.c index 0ef545762..15e31405e 100644 --- a/sys/vms/vmsmail.c +++ b/sys/vms/vmsmail.c @@ -11,7 +11,7 @@ unsigned long enable_broadcast_trapping(void); unsigned long disable_broadcast_trapping(void); struct mail_info *parse_next_broadcast(void); -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -46,7 +46,7 @@ extern size_t strspn(const char *, const char *); extern int VDECL(sscanf, (const char *, const char *, ...)); #endif -#ifdef VMS9 +#ifdef VMSVSI #include #else extern unsigned long smg$create_pasteboard(), smg$get_broadcast_message(), diff --git a/sys/vms/vmsmain.c b/sys/vms/vmsmain.c index afdadf7d0..549da2eac 100644 --- a/sys/vms/vmsmain.c +++ b/sys/vms/vmsmain.c @@ -7,7 +7,7 @@ #include "hack.h" #include "dlb.h" -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -395,7 +395,7 @@ byebye(void) void (*hup)(int) ; #ifdef SHELL extern unsigned long dosh_pid, mail_pid; -#ifndef VMS9 +#ifndef VMSVSI extern unsigned long sys$delprc(unsigned long *, const genericptr_t); #endif diff --git a/sys/vms/vmsmisc.c b/sys/vms/vmsmisc.c index 75d00f444..3cd8c3d24 100644 --- a/sys/vms/vmsmisc.c +++ b/sys/vms/vmsmisc.c @@ -5,7 +5,7 @@ #include "config.h" #undef exit -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -21,7 +21,7 @@ ATTRNORETURN void vms_abort(void); /* first arg should be unsigned long but has unsigned int */ -#ifndef VMS9 +#ifndef VMSVSI extern void VDECL(lib$signal, (unsigned, ...)); #endif diff --git a/sys/vms/vmstty.c b/sys/vms/vmstty.c index fd8e507c4..00ded425c 100644 --- a/sys/vms/vmstty.c +++ b/sys/vms/vmstty.c @@ -9,7 +9,7 @@ #include "wintty.h" #include "tcap.h" -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -40,12 +40,12 @@ #include -#ifndef VMS9 +#ifndef VMSVSI unsigned long lib$disable_ctrl(), lib$enable_ctrl(); unsigned long sys$assign(), sys$dassgn(), sys$qiow(); #endif #ifndef USE_QIO_INPUT -#ifndef VMS9 +#ifndef VMSVSI unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(), smg$read_keystroke(), smg$cancel_input(); #endif @@ -533,7 +533,7 @@ introff(void) #ifdef TIMED_DELAY -#ifndef VMS9 +#ifndef VMSVSI extern unsigned long lib$emul(const long *, const long *, const long *, long *); extern unsigned long sys$schdwk(), sys$hiber(); diff --git a/sys/vms/vmsunix.c b/sys/vms/vmsunix.c index 5031e45f0..0bcdae7b2 100644 --- a/sys/vms/vmsunix.c +++ b/sys/vms/vmsunix.c @@ -7,7 +7,7 @@ #include "hack.h" -#ifdef VMS9 +#ifdef VMSVSI #include #include #include @@ -33,7 +33,7 @@ extern int debuggable; /* defined in vmsmisc.c */ -#ifndef VMS9 +#ifndef VMSVSI extern void VDECL(lib$signal, (unsigned, ...)); extern unsigned long sys$setprv(); extern unsigned long lib$getdvi(), lib$getjpi(), lib$spawn(), lib$attach(); @@ -228,7 +228,7 @@ vms_define(const char *name, const char *value, int flag) static struct itm3 itm_lst[] = { { 0, LNM$_STRING, 0, 0 }, { 0, 0 } }; struct dsc nam_dsc, val_dsc, tbl_dsc; unsigned long result; -#ifndef VMS9 +#ifndef VMSVSI unsigned long sys$crelnm(), lib$set_logical(); #endif @@ -596,7 +596,7 @@ struct dsc { }; /* descriptor */ typedef unsigned long vmscond; /* vms condition value */ -#ifndef VMS9 +#ifndef VMSVSI vmscond lib$find_file(const struct dsc *, struct dsc *, genericptr *); vmscond lib$find_file_end(void **); #endif