|
Documentation
Friendly Request |
Please do not scrape documentation directly from this site. The Digital UNIX 4.0 Documentation CD is available on winworldpc.com. |
Click on the Compaq logo at the top of the left-most frame to return to this index.
Useful Stuff
Compiler macros?
You probably maybe possibly really want to use -std1 -isoc94 at all times maybe!
Preprocessor |
Description |
Compiler flag |
__DECC |
DEC C compiler |
-std0 |
__DECC_VER |
DEC C compiler |
-std0 |
__osf__ |
Platform is DEC OSF/1 |
(or -std -std0 -std1 ) |
__alpha |
Platform is Alpha |
(or -std -std0 -std1 ) |
__STDC__ |
Compiler conforms to an ISO C standard |
-isoc94 |
__STDC_VERSION__ |
ISO C standard compiler comforms to |
(or -std -std1 ) and -isoc94 |
For example, the following code requires the flags -std1 -isoc94
to be passed to cc .
#include <stdio.h>
int
main(void)
{
#if defined(__DECC)
printf("DEC C compiler\n");
#endif
#if defined(__DECC_VER)
printf("Version %d\n", __DECC_VER);
#endif
#if defined(__alpha)
printf("Alpha\n");
#endif
#if defined(__osf__)
printf("DEC OSF/1\n");
#endif
#if defined(__STDC__)
# if defined(__STDC_VERSION__)
printf("C Standard: %d\n", __STDC_VERSION__);
# endif
#endif
return 0;
}
|
|