FDECL and NDECL
This commit is contained in:
+2
-25
@@ -180,30 +180,17 @@ typedef const char *vA;
|
|||||||
* Used for robust ANSI parameter forward declarations:
|
* Used for robust ANSI parameter forward declarations:
|
||||||
* int VDECL(sprintf, (char *, const char *, ...));
|
* 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.
|
* VDECL() is used for functions with a variable number of arguments.
|
||||||
* Separate macros are needed because ANSI will mix old-style declarations
|
* Separate macros are needed because ANSI will mix old-style declarations
|
||||||
* with prototypes, except in the case of varargs
|
* 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)
|
#if defined(MSDOS) || defined(USE_STDARG)
|
||||||
#define VDECL(f, p) f p
|
#define VDECL(f, p) f p
|
||||||
#else
|
#else
|
||||||
#define VDECL(f, p) f()
|
#define VDECL(f, p) f()
|
||||||
#endif
|
#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 */
|
/* generic pointer, always a macro; genericptr_t is usually a typedef */
|
||||||
#define genericptr void *
|
#define genericptr void *
|
||||||
|
|
||||||
@@ -238,12 +225,8 @@ typedef const char *vA;
|
|||||||
|
|
||||||
#else /* NHSTDC */ /* a "traditional" C compiler */
|
#else /* NHSTDC */ /* a "traditional" C compiler */
|
||||||
|
|
||||||
#define NDECL(f) f()
|
|
||||||
#define FDECL(f, p) f()
|
|
||||||
#define VDECL(f, p) f()
|
#define VDECL(f, p) f()
|
||||||
|
|
||||||
#define VOID_ARGS /*empty*/
|
|
||||||
|
|
||||||
#if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) \
|
#if defined(AMIGA) || defined(HPUX) || defined(POSIX_TYPES) \
|
||||||
|| defined(__DECC) || defined(__BORLANDC__)
|
|| defined(__DECC) || defined(__BORLANDC__)
|
||||||
#define genericptr void *
|
#define genericptr void *
|
||||||
@@ -335,7 +318,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* These are used for arguments within FDECL/VDECL prototype declarations.
|
/* These are used for arguments within VDECL prototype declarations.
|
||||||
*/
|
*/
|
||||||
#ifdef UNWIDENED_PROTOTYPES
|
#ifdef UNWIDENED_PROTOTYPES
|
||||||
#define CHAR_P char
|
#define CHAR_P char
|
||||||
@@ -360,7 +343,7 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
|||||||
#define ALIGNTYP_P int
|
#define ALIGNTYP_P int
|
||||||
#else
|
#else
|
||||||
/* Neither widened nor unwidened prototypes. Argument list expansion
|
/* 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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -393,14 +376,8 @@ typedef genericptr genericptr_t; /* (void *) or (char *) */
|
|||||||
* include files have prototypes and the compiler also complains that
|
* include files have prototypes and the compiler also complains that
|
||||||
* prototyped and unprototyped declarations don't match.
|
* prototyped and unprototyped declarations don't match.
|
||||||
*/
|
*/
|
||||||
#undef NDECL
|
|
||||||
#undef FDECL
|
|
||||||
#undef VDECL
|
#undef VDECL
|
||||||
#define NDECL(f) f()
|
|
||||||
#define FDECL(f, p) f()
|
|
||||||
#define VDECL(f, p) f()
|
#define VDECL(f, p) f()
|
||||||
#undef VOID_ARGS
|
|
||||||
#define VOID_ARGS /*empty*/
|
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user