changes to build with VSI C compiler

The changes from past OpenVMS compilers are #ifdef'd VMS9
This commit is contained in:
nhmall
2023-05-22 14:43:10 -04:00
parent 2dfe4c2a27
commit 68b8e84aa3
10 changed files with 145 additions and 9 deletions

View File

@@ -10,6 +10,12 @@
#include "config.h"
#include <ctype.h>
#ifdef VMS9
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
#endif
/* lint supression due to lack of extern.h */
int vms_link(const char *, const char *);
int vms_unlink(const char *);
@@ -27,8 +33,11 @@ int c__translate(int);
#ifndef C$$TRANSLATE /* don't rely on VAXCRTL's internal routine */
#define C$$TRANSLATE(status) (errno = EVMSERR, vaxc$errno = (status))
#endif
#ifndef VMS9
extern unsigned long sys$parse(), sys$search(), sys$enter(), sys$remove();
extern int VDECL(lib$match_cond, (int, int, ...));
#endif
#define vms_success(sts) ((sts) & 1) /* odd, */
#define vms_failure(sts) (!vms_success(sts)) /* even */

View File

@@ -11,6 +11,12 @@ unsigned long enable_broadcast_trapping(void);
unsigned long disable_broadcast_trapping(void);
struct mail_info *parse_next_broadcast(void);
#ifdef VMS9
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
#endif
#ifdef MAIL
#include "wintype.h"
#include "winprocs.h"
@@ -39,8 +45,13 @@ extern size_t strspn(const char *, const char *);
#ifndef __DECC
extern int VDECL(sscanf, (const char *, const char *, ...));
#endif
#ifdef VMS9
#include <smg$routines.h>
#else
extern unsigned long smg$create_pasteboard(), smg$get_broadcast_message(),
smg$set_broadcast_trapping(), smg$disable_broadcast_trapping();
#endif
extern volatile int broadcasts; /* defining declaration in mail.c */

View File

@@ -7,6 +7,12 @@
#include "hack.h"
#include "dlb.h"
#ifdef VMS9
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
#endif
#include <signal.h>
static void whoami(void);
@@ -389,7 +395,9 @@ byebye(void)
void (*hup)(int) ;
#ifdef SHELL
extern unsigned long dosh_pid, mail_pid;
#ifndef VMS9
extern unsigned long sys$delprc(unsigned long *, const genericptr_t);
#endif
/* clean up any subprocess we've spawned that may still be hanging around
*/

View File

@@ -4,6 +4,13 @@
#include "config.h"
#undef exit
#ifdef VMS9
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
#endif
#include <ssdef.h>
#include <stsdef.h>
@@ -13,7 +20,10 @@ ATTRNORETURN void vms_exit(int);
ATTRNORETURN void vms_abort(void);
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
#ifndef VMS9
extern void VDECL(lib$signal, (unsigned, ...));
#endif
/* terminate, converting Unix-style exit code into VMS status code */
ATTRNORETURN void

View File

@@ -9,6 +9,13 @@
#include "wintty.h"
#include "tcap.h"
#ifdef VMS9
#include <lib$routines.h>
#include <smg$routines.h>
#include <starlet.h>
#include <elfdef.h>
#endif
#include <descrip.h>
#include <iodef.h>
#ifndef __GNUC__
@@ -32,11 +39,16 @@
#include <errno.h>
#include <signal.h>
#ifndef VMS9
unsigned long lib$disable_ctrl(), lib$enable_ctrl();
unsigned long sys$assign(), sys$dassgn(), sys$qiow();
#endif
#ifndef USE_QIO_INPUT
#ifndef VMS9
unsigned long smg$create_virtual_keyboard(), smg$delete_virtual_keyboard(),
smg$read_keystroke(), smg$cancel_input();
#endif
#else
static short parse_function_key(int);
#endif
@@ -171,16 +183,16 @@ vms_getchar(void)
} else if (kb_buf == ESC || kb_buf == CSI || kb_buf == SS3) {
switch (parse_function_key((int) kb_buf)) {
case SMG$K_TRM_UP:
key = gc.Cmd.move_N;
key = gc.Cmd.dirchars[2];
break;
case SMG$K_TRM_DOWN:
key = gc.Cmd.move_S;
key = gc.Cmd.dirchars[6];
break;
case SMG$K_TRM_LEFT:
key = gc.Cmd.move_W;
key = gc.Cmd.dirchars[0];
break;
case SMG$K_TRM_RIGHT:
key = gc.Cmd.move_E;
key = gc.Cmd.dirchars[4];
break;
default:
key = ESC;
@@ -521,9 +533,11 @@ introff(void)
#ifdef TIMED_DELAY
#ifndef VMS9
extern unsigned long lib$emul(const long *, const long *, const long *,
long *);
extern unsigned long sys$schdwk(), sys$hiber();
#endif
#define VMS_UNITS_PER_SECOND 10000000L /* hundreds of nanoseconds, 1e-7 */
/* constant for conversion from milliseconds to VMS delta time (negative) */
@@ -563,7 +577,21 @@ VA_DECL(const char *, s)
VA_END();
#ifndef SAVE_ON_FATAL_ERROR
/* prevent vmsmain's exit handler byebye() from calling hangup() */
sethanguphandler((void (*)(int) )) SIG_DFL;
/* sethanguphandler((void (*)(int) )) SIG_DFL; */
sethanguphandler((SIG_RET_TYPE) SIG_DFL);
#endif
exit(EXIT_FAILURE);
}
#ifdef ENHANCED_SYMBOLS
/*
* set in tty_start_screen() and allows
* OS-specific changes that may be
* required for support of utf8.
* Currently a placeholder for VMS.
*/
void
tty_utf8graphics_fixup(void)
{
}
#endif /* ENHANCED_SYMBOLS */

View File

@@ -7,6 +7,14 @@
#include "hack.h"
#ifdef VMS9
#include <lib$routines.h>
#include <smg$routines.h>
#include <starlet.h>
#define sys$imgsta SYS$IMGSTA
#include <unixio.h>
#endif
#include <descrip.h>
#include <dvidef.h>
#include <jpidef.h>
@@ -25,10 +33,13 @@
extern int debuggable; /* defined in vmsmisc.c */
#ifndef VMS9
extern void VDECL(lib$signal, (unsigned, ...));
extern unsigned long sys$setprv();
extern unsigned long lib$getdvi(), lib$getjpi(), lib$spawn(), lib$attach();
extern unsigned long smg$init_term_table_by_type(), smg$del_term_table();
#endif
#define vms_ok(sts) ((sts) & 1) /* odd => success */
/* this could be static; it's only used within this file;
@@ -216,7 +227,10 @@ 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, sys$crelnm(), lib$set_logical();
unsigned long result;
#ifndef VMS9
unsigned long sys$crelnm(), lib$set_logical();
#endif
/* set up string descriptors */
nam_dsc.mbz = val_dsc.mbz = tbl_dsc.mbz = 0;
@@ -581,8 +595,11 @@ struct dsc {
char *adr;
}; /* descriptor */
typedef unsigned long vmscond; /* vms condition value */
#ifndef VMS9
vmscond lib$find_file(const struct dsc *, struct dsc *, genericptr *);
vmscond lib$find_file_end(void **);
#endif
/* collect a list of character names from all save files for this player */
int