Path: utzoo!attcan!uunet!portal!cup.portal.com!Devin_E_Ben-Hur
From: Devin_E_Ben-Hur@cup.portal.com
Newsgroups: comp.lang.c
Subject: Re: Curious about function prototypes...
Message-ID: <6519@cup.portal.com>
Date: 15 Jun 88 00:43:43 GMT
References: <654@orion.cf.uci.edu> <8073@brl-smoke.ARPA> <273@spsspyr.UUCP>
Organization: The Portal System (TM)
Lines: 25
XPortal-User-Id: 1.1001.3645

Someone asked about how to use the pre-processor to support pre-dpANS
function definitions.  Try this (admittedly ugly) scheme:

#ifdef __STDC__

#define _PROTO1_(t1,a1)	(t1 a1)
#define _FNCDF1_(t1,a1)	(t1 a1)
#define _PROTO2_(t1,a1,t2,a2)	(t1 a1, t2 a2)
#define _FNCDF2_(t1,a1,t2,a2)	(t1 a1, t2 a2)
/* ... _xxxxxN_ */

#else

#define _PROTO1_(t1,a1)	()
#define _FNCDF1_(t1,a1)	(a1) t1 a1;
#define _PROTO2_(t1,a1,t2,a2)	()
#define _FNCDF2_(t1,a1,t2,a2)	(a1,a2) t1 a1; t2 a2;
/* ... _xxxxxN_ */

#endif

extern int foo _PROTO2_(int,an_integer, char *,a_char_ptr);

int foo _FNCDF2_(int,an_integer, char *,a_char_ptr)
{ /* ... */ }