ANSI/Non-ANIS Function Declaration Macros

Steve Simmons scs at itivax.iti.org
Fri Dec 8 12:20:34 AEST 1989


Currently I'm writing code that must compile with and without ANSI
C features.  Ideally this could be done with no slgging the code
with lots of #ifdef constructs like

#ifdef __STDC__
int	*foo( int const a )
#else
int	*foo( a )
int	a ;
#endif
{
	func body
}

While this works, it's got a weakness.  In having two separate declarations,
one can over time let them get out of sync.  It's also a pain to write.
Has anybody come up with a way of doing this so that I write the declarations
once and once only?  Bizarre constructs considered within limits.
-- 
Steve Simmons	       scs at iti.org         Industrial Technology Institute
	'"You're not a big name on Usenet until someone puts
	  you in their .sig file."		-- Anonymous'



More information about the Comp.lang.c mailing list