Commit d3fc4dbc by Matt Kraai Committed by Matt Kraai

README.Portability (Function prototypes): Document new variable-argument function macros.

	* README.Portability (Function prototypes): Document new
	variable-argument function macros.

From-SVN: r55150
parent 5fd3853a
2002-07-01 Matt Kraai <kraai@alumni.cmu.edu>
* README.Portability (Function prototypes): Document new
variable-argument function macros.
Mon Jul 1 19:55:17 2002 J"orn Rennecke <joern.rennecke@superh.com> Mon Jul 1 19:55:17 2002 J"orn Rennecke <joern.rennecke@superh.com>
* sh.c (langhooks.h): Include. * sh.c (langhooks.h): Include.
......
...@@ -139,32 +139,16 @@ void cpp_ice PARAMS ((cpp_reader *, const char *msgid, ...)); ...@@ -139,32 +139,16 @@ void cpp_ice PARAMS ((cpp_reader *, const char *msgid, ...));
void void
cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...)) cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...))
{ {
#ifndef ANSI_PROTOTYPES VA_OPEN (ap, msgid);
cpp_reader *pfile; VA_FIXEDARG (ap, cpp_reader *, pfile);
const char *msgid; VA_FIXEDARG (ap, const char *, msgid);
#endif
va_list ap;
VA_START (ap, msgid);
#ifndef ANSI_PROTOTYPES
pfile = va_arg (ap, cpp_reader *);
msgid = va_arg (ap, const char *);
#endif
... ...
va_end (ap); VA_CLOSE (ap);
} }
For the curious, here are the definitions of the above macros. See See ansidecl.h for the definitions of the above macros and more.
ansidecl.h for the definitions of the above macros and more.
#define PARAMS(paramlist) paramlist /* ISO C. */
#define VPARAMS(args) args
#define PARAMS(paramlist) () /* K+R C. */
#define VPARAMS(args) (va_alist) va_dcl
One aspect of using K+R style function declarations, is you cannot One aspect of using K+R style function declarations, is you cannot
have arguments whose types are char, short, or float, since without have arguments whose types are char, short, or float, since without
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment