From: nhmall Date: Sun, 31 Jan 2021 19:15:08 +0000 (-0500) Subject: FDECL and NDECL X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e53fcf094054c74cc13377a9b6565f42dbf15835;p=nethack FDECL and NDECL --- diff --git a/include/tradstdc.h b/include/tradstdc.h index 3827195f5..09decb4b1 100644 --- a/include/tradstdc.h +++ b/include/tradstdc.h @@ -180,30 +180,17 @@ typedef const char *vA; * Used for robust ANSI parameter forward declarations: * int VDECL(sprintf, (char *, const char *, ...)); * - * NDECL() is used for functions with zero arguments; - * FDECL() is used for functions with a fixed number of arguments; * 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 */ -#define NDECL(f) f(void) - -#define FDECL(f, p) f p - #if defined(MSDOS) || defined(USE_STDARG) #define VDECL(f, p) f p #else #define VDECL(f, p) f() #endif -/* - * Used for definitions of functions which take no arguments to force - * an explicit match with the NDECL prototype. Needed in some cases - * (MS Visual C 2005) for functions called through pointers. - */ -#define VOID_ARGS void - /* generic pointer, always a macro; genericptr_t is usually a typedef */ #define genericptr void * @@ -238,12 +225,8 @@ typedef const char *vA; #else /* NHSTDC */ /* a "traditional" C compiler */ -#define NDECL(f) f() -#define FDECL(f, p) f() #define VDECL(f, p) f() -#define VOID_ARGS /*empty*/ - #if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) \ || defined(__DECC) || defined(__BORLANDC__) #define genericptr void * @@ -335,7 +318,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #endif #endif -/* These are used for arguments within FDECL/VDECL prototype declarations. +/* These are used for arguments within VDECL prototype declarations. */ #ifdef UNWIDENED_PROTOTYPES #define CHAR_P char @@ -360,7 +343,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ #define ALIGNTYP_P int #else /* Neither widened nor unwidened prototypes. Argument list expansion - * by FDECL/VDECL always empty; all xxx_P vanish so defs aren't needed. */ + * by VDECL always empty; all xxx_P vanish so defs aren't needed. */ #endif #endif @@ -393,14 +376,8 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */ * include files have prototypes and the compiler also complains that * prototyped and unprototyped declarations don't match. */ -#undef NDECL -#undef FDECL #undef VDECL -#define NDECL(f) f() -#define FDECL(f, p) f() #define VDECL(f, p) f() -#undef VOID_ARGS -#define VOID_ARGS /*empty*/ #endif #endif