ANSI/K&R functions in same source

Doug Gwyn gwyn at smoke.brl.mil
Tue Jan 22 08:29:36 AEST 1991


In article <15895 at crdgw1.crd.ge.com> doel at kirkwood.crd.ge.com () writes:
>Is there a clean way to write functions which can be compiled immedaitely
>on ANSI & KR compilers while retaining function prototypes on the ANSI
>compilers?

/* to permit a single declaration to provide a prototype or not, depending: */
/* Example usage:	extern int myfunc PARAMS((int a, char *b));	*/
#if __STDC__
#define	PARAMS( a )	a
#else
#define	PARAMS( a )	()
#endif



More information about the Comp.lang.c mailing list