|
|
DescriptionThe C and C++ compilers on Digital UNIX, Tru64, ULTRIX, and VMS. The ULTRIX C compiler is essentially the same as the BSD C compiler (pcc) and thus has no version macro, you must look out for the ultrix macro. Macros| Identification | __DECC | | | C compiler | | Version | __DECC_VER | VVRRTPPPP | (or
-std
-std0
-std1
) | VV = Version RR = Revision T = Type (9 = official) PPPP = Patch | | Identification | __DECCXX | | | C++ compiler | | Version | __DECCXX_VER | VVRRTPPPP | (or
-std
-std0
-std1
) | VV = Version RR = Revision T = Type (9 = official) PPPP = Patch | | Identification | __VAXC | | | VAX C compiler | | Identification | VAXC | | | VAX C compiler | | Identification | VAX11C | | | VAX C compiler on a VAX-11 or newer |
Examples| 5.8-009 | 50890009 | | 6.0-001 | 60090001 |
NotesWith OSF/1 you really want to be using the -std1 and -isoc94 compiler flags at all times. The -isoc94 compiler flag will make __STDC__ available, and the -std and -std1 flags will make __STDC_VERSION__ available. On ULTRIX it will be worth including sys/ansi_compat.h too so that preprocessor symbols are on a par with those on OSF/1. I am not sure if they will be similar to those on VMS. Example code 1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
| #include <stdio.h>
#include <sys/ansi_compat.h>
int
main()
{
#if defined(__DECC)
printf("DEC C compiler\n");
#elif defined(__DECCXX)
printf("DEC C++ compiler\n");
#elif defined(__VAXC)
printf("VAX C compiler\n");
#elif defined(__VAX11C)
/* I'd assume this is for ULTRIX on the VAX-11. */
printf("VAX-11 C compiler\n");
#else
# if defined(__ultrix)
printf("ULTRIX C compiler\n");
# endif
#else
printf("Unknown C compiler\n");
#endif
}
|
| |
|