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
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 tradstdc.h $NHDT-Date: 1596498565 2020/08/03 23:49:25 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.37 $ */
|
||||
/* NetHack 3.7 tradstdc.h $NHDT-Date: 1685522034 2023/05/31 08:33:54 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.54 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2006. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -172,77 +172,8 @@ typedef const char *vA;
|
||||
|
||||
#endif /* NEED_VARARGS */
|
||||
|
||||
#if defined(NHSTDC) || defined(MSDOS) || defined(MAC) \
|
||||
|| defined(ULTRIX_PROTO) || defined(__BEOS__)
|
||||
|
||||
/*
|
||||
* Used for robust ANSI parameter forward declarations:
|
||||
* int VDECL(sprintf, (char *, const char *, ...));
|
||||
*
|
||||
* VDECL() is used for functions with a variable number of arguments.
|
||||
* Separate macros are needed because ANSI will mix old-style declarations
|
||||
* with prototypes, except in the case of varargs
|
||||
*/
|
||||
|
||||
#if defined(MSDOS) || defined(USE_STDARG)
|
||||
#define VDECL(f, p) f p
|
||||
#else
|
||||
#define VDECL(f, p) f()
|
||||
#endif
|
||||
|
||||
/* generic pointer, always a macro; genericptr_t is usually a typedef */
|
||||
#define genericptr void *
|
||||
|
||||
#if (defined(ULTRIX_PROTO) && !defined(__GNUC__)) || defined(OS2_CSET2)
|
||||
/* Cover for Ultrix on a DECstation with 2.0 compiler, which coredumps on
|
||||
* typedef void * genericptr_t;
|
||||
* extern void a(void(*)(int, genericptr_t));
|
||||
* Using the #define is OK for other compiler versions too.
|
||||
*/
|
||||
/* And IBM CSet/2. The redeclaration of free hoses the compile. */
|
||||
#define genericptr_t genericptr
|
||||
#else
|
||||
#if !defined(NHSTDC) && !defined(MAC)
|
||||
#define const
|
||||
#define signed
|
||||
#define volatile
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Suppress `const' if necessary and not handled elsewhere.
|
||||
* Don't use `#if defined(xxx) && !defined(const)'
|
||||
* because some compilers choke on `defined(const)'.
|
||||
* This has been observed with Lattice, MPW, and High C.
|
||||
*/
|
||||
#if (defined(ULTRIX_PROTO) && !defined(NHSTDC)) || defined(apollo)
|
||||
/* the system header files don't use `const' properly */
|
||||
#ifndef const
|
||||
#define const
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#else /* NHSTDC */ /* a "traditional" C compiler */
|
||||
|
||||
#define VDECL(f, p) f()
|
||||
|
||||
#if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) \
|
||||
|| defined(__DECC) || defined(__BORLANDC__)
|
||||
#define genericptr void *
|
||||
#endif
|
||||
#ifndef genericptr
|
||||
#define genericptr char *
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Traditional C compilers don't have "signed", "const", or "volatile".
|
||||
*/
|
||||
#define signed
|
||||
#define const
|
||||
#define volatile
|
||||
|
||||
#endif /* NHSTDC */
|
||||
|
||||
#ifndef genericptr_t
|
||||
typedef genericptr genericptr_t; /* (void *) or (char *) */
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 vmsfiles.c $NHDT-Date: 1596498306 2020/08/03 23:45:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.12 $ */
|
||||
/* NetHack 3.7 vmsfiles.c $NHDT-Date: 1685522046 2023/05/31 08:34:06 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.19 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2007. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -36,13 +36,13 @@ int c__translate(int);
|
||||
|
||||
#ifndef VMSVSI
|
||||
extern unsigned long sys$parse(), sys$search(), sys$enter(), sys$remove();
|
||||
extern int VDECL(lib$match_cond, (int, int, ...));
|
||||
extern int lib$match_cond(int, int, ...);
|
||||
#endif
|
||||
|
||||
#define vms_success(sts) ((sts) & 1) /* odd, */
|
||||
#define vms_failure(sts) (!vms_success(sts)) /* even */
|
||||
|
||||
/* vms_link() -- create an additional directory for an existing file */
|
||||
/* vms_link() -- create an additional directory entry for an existing file */
|
||||
int
|
||||
vms_link(const char *file, const char *new)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 vmsmail.c $NHDT-Date: 1596498307 2020/08/03 23:45:07 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.11 $ */
|
||||
/* NetHack 3.7 vmsmail.c $NHDT-Date: 1685522048 2023/05/31 08:34:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.18 $ */
|
||||
/* Copyright (c) Robert Patrick Rankin, 1991. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
|
||||
@@ -43,7 +43,7 @@ extern int strncmpi(const char *, const char *, int);
|
||||
|
||||
extern size_t strspn(const char *, const char *);
|
||||
#ifndef __DECC
|
||||
extern int VDECL(sscanf, (const char *, const char *, ...));
|
||||
extern int sscanf(const char *, const char *, ...);
|
||||
#endif
|
||||
|
||||
#ifdef VMSVSI
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 vmsmisc.c $NHDT-Date: 1596498308 2020/08/03 23:45:08 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.12 $ */
|
||||
/* 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. */
|
||||
|
||||
@@ -22,7 +22,7 @@ ATTRNORETURN void vms_abort(void);
|
||||
/* first arg should be unsigned long but <lib$routines.h> has unsigned int */
|
||||
|
||||
#ifndef VMSVSI
|
||||
extern void VDECL(lib$signal, (unsigned, ...));
|
||||
extern void lib$signal(unsigned, ...);
|
||||
#endif
|
||||
|
||||
/* terminate, converting Unix-style exit code into VMS status code */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* NetHack 3.7 vmsunix.c $NHDT-Date: 1605493693 2020/11/16 02:28:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.24 $ */
|
||||
/* NetHack 3.7 vmsunix.c $NHDT-Date: 1685522050 2023/05/31 08:34:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.31 $ */
|
||||
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
|
||||
/*-Copyright (c) Robert Patrick Rankin, 2011. */
|
||||
/* NetHack may be freely redistributed. See license for details. */
|
||||
@@ -34,7 +34,7 @@
|
||||
extern int debuggable; /* defined in vmsmisc.c */
|
||||
|
||||
#ifndef VMSVSI
|
||||
extern void VDECL(lib$signal, (unsigned, ...));
|
||||
extern void 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();
|
||||
|
||||
Reference in New Issue
Block a user