OpenVMS update follow-up

This commit is contained in:
nhmall
2023-05-22 20:50:35 -04:00
parent 788ade31ca
commit 4761bf190e
9 changed files with 43 additions and 43 deletions

View File

@@ -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

View File

@@ -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 <types.h>
#include <unistd.h>
@@ -274,7 +259,7 @@ typedef int32_t off_t;
#include <time.h>
#ifndef VMS9
#ifndef VMSVSI
#if 0 /* <file.h> is missing for old gcc versions; skip it to save time */
#include <file.h>
#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

View File

@@ -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);

View File

@@ -10,7 +10,7 @@
#include "config.h"
#include <ctype.h>
#ifdef VMS9
#ifdef VMSVSI
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
@@ -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

View File

@@ -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 <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
@@ -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 <smg$routines.h>
#else
extern unsigned long smg$create_pasteboard(), smg$get_broadcast_message(),

View File

@@ -7,7 +7,7 @@
#include "hack.h"
#include "dlb.h"
#ifdef VMS9
#ifdef VMSVSI
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
@@ -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

View File

@@ -5,7 +5,7 @@
#include "config.h"
#undef exit
#ifdef VMS9
#ifdef VMSVSI
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
@@ -21,7 +21,7 @@ ATTRNORETURN void vms_abort(void);
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
#ifndef VMS9
#ifndef VMSVSI
extern void VDECL(lib$signal, (unsigned, ...));
#endif

View File

@@ -9,7 +9,7 @@
#include "wintty.h"
#include "tcap.h"
#ifdef VMS9
#ifdef VMSVSI
#include <lib$routines.h>
#include <smg$routines.h>
#include <starlet.h>
@@ -40,12 +40,12 @@
#include <signal.h>
#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();

View File

@@ -7,7 +7,7 @@
#include "hack.h"
#ifdef VMS9
#ifdef VMSVSI
#include <lib$routines.h>
#include <smg$routines.h>
#include <starlet.h>
@@ -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