Redefining keywords (was Re: effect of free()
Tom Neff
tneff at bfmny0.UU.NET
Tue Sep 19 05:30:03 AEST 1989
When one wants to use or not use reserved keywords conditionally
depending on the choice of platform, a portable approach is to use
lookalike non-reserved keywords which are #defined to the null string or
to the reserved keywords as needed, e.g.
#ifdef I86
#define NEAR near
#define FAR far
#else
#define NEAR
#define FAR
#endif
. . .
extern FAR char *idstring;
. . .
int NEAR *gettotal(int xflag)
This is far safer than trying to redefine "near" and "far" themselves.
I cannot sympathize with slightly lazy vendors here.
--
'We have luck only with women -- \\\ Tom Neff
not spacecraft!' *-((O tneff at bfmny0.UU.NET
-- R. Kremnev, builder of FOBOS \\\ uunet!bfmny0!tneff (UUCP)
More information about the Comp.lang.c
mailing list