
Determining what canned preprocessor symbols are available
Quote:
> Does anybody know a quick way (other than looking in a manual) to
>determine what preprocessor symbols are available for a compiler?
>For instance, how would I easily determine that:
>__STDC__
>sparc
>sun
>unix
>are known by my (sun c) compiler? Thanks in advance from a rusty, but
>improving, old hacker.
Well, if you *think* you know the names of predefined macros ...
#include <stdio.h>
main()
{
#ifdef __STDC__
printf("__STDC__ defined\n");
#endif
#ifdef sparc
printf("sparc defined\n");
#endif
Quote:
}
If you don't have much of an idea have a search through the man pages -
there should be something somewhere ... since __STDC__ is almost certain
to be defined search for it - it'll probably be included with the other
predefined macros. Or search on cc (or gcc as the case may be) - it should
also state the macros.
_/_/_/_/
_/_| _/_| _/_| _/_/_/ _/_| _/_/_/
_/ _| _/ _| _/ _| _/ _/ _| _/ _/
_/ _|_/ _| _/_/_/_| _/ _/_/_/ _/_/_/_| _/ _/
_/ _| _| _/ _| _/_/_/_/ _/ _| _/_/_/