#defines with variable # arguments
John Young
jgy at hropus.UUCP
Sat May 14 08:21:54 AEST 1988
>
> > Are there any versions of cpp which allow one to define macros which
> > accept variable numbers of arguments?
I think that some of the AT&T CPLU compilers(cpp's) allow this,
you just overdeclare the arguments:
#define Dprintf(a,b,c,d,e,f,g,h,i) {if (Debug) printf(a,b,c,d,e,f,g,h,i);}
and compile. You will get a warning about each source line which uses
the wrong number of arguments.
More information about the Comp.unix.wizards
mailing list