|
|
If you need to differentiate between different development systems in your source code, you can test for the manifest constants shown in the code fragment below. These constants are all pre-defined by the native compilers on the respective systems indicated:
#if defined(_SCO_DS) printf("OpenServer standard compiler\n"); #elif defined(__USLC__) printf("UnixWare UDK 7 compiler\n"); #elif defined(__UNIXWARE__) printf("UnixWare GNU compiler\n"); #elif defined(M_UNIX) printf("ODT 3 or earlier compiler\n"); #else printf("Other compiler\n"); #endif
For UnixWare 7, a new constant has been added, __SCO_VERSION__, which contains a constructed integer value: major (1+ digit), minor (2 digits), year (4 digits), month (2 digits). For example, the UnixWare 7 C compiler has a __SCO_VERSION__ value of 302199801.