Files
nethack/sys/vms/vmsmisc.c
PatR ecd3593163 github pull request #1030 - VDECL
The pull request from argrath would have moved the definition of
VDECL from tradstdc.h to vmsconf.h because some out of date references
to it in sys/vms/*.c were the only place it still appeared to be used.
Instead of applying that, remove those old references.

NetHack 3.7.x requires C99 so just remove VDECL since it was present
in order to support pre-ANSI compilers.  (There is at least one
comment that still mentions it though.)

This also gets rid of another chunk of tradstdc.h that was allowing
either pre-ANSI or nearly-ANSI compilers to deal with nethack's old
code.  I left the USE_STDARG/USE_VARARGS/USE_OLDARGS stuff in place
even though anything supporting C99 shouldn't need that.  Some or
all of the [UN]WIDENED_PROTOTYPES stuff is still there too.

Closes #1030
2023-05-31 01:34:11 -07:00

58 lines
1.5 KiB
C

/* NetHack 3.7 vmsmisc.c $NHDT-Date: 1685522049 2023/05/31 08:34:09 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.18 $ */
/* Copyright (c) 2011 by Robert Patrick Rankin */
/* NetHack may be freely redistributed. See license for details. */
#include "config.h"
#undef exit
#ifdef VMSVSI
#include <descrip.h>
#include <lib$routines.h>
#include <starlet.h>
#endif
#include <ssdef.h>
#include <stsdef.h>
int debuggable = 0; /* 1 if we can debug or show a call trace */
ATTRNORETURN void vms_exit(int);
ATTRNORETURN void vms_abort(void);
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
#ifndef VMSVSI
extern void lib$signal(unsigned, ...);
#endif
/* terminate, converting Unix-style exit code into VMS status code */
ATTRNORETURN void
vms_exit(int status)
{
/* convert non-zero to failure, zero to success */
exit(status ? (SS$_ABORT | STS$M_INHIB_MSG) : SS$_NORMAL);
/* NOT REACHED */
}
/* put the user into the debugger; used for abort() when in wizard mode */
ATTRNORETURN void
vms_abort(void)
{
if (debuggable)
lib$signal(SS$_DEBUG);
/* we'll get here if the debugger isn't available, or if the user
uses GO to resume execution instead of EXIT to quit */
vms_exit(2); /* don't return to caller (2==arbitrary non-zero) */
/* NOT REACHED */
}
/*
* Caveat: the VERYOLD_VMS configuration hasn't been tested in many years.
*/
#ifdef VERYOLD_VMS
#include "oldcrtl.c"
#endif
/*vmsmisc.c*/