File: compiler.c

package info (click to toggle)
c-cpp-reference 2.0.2-6
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 8,012 kB
  • ctags: 4,612
  • sloc: ansic: 26,960; sh: 11,014; perl: 1,854; cpp: 1,324; asm: 1,239; python: 258; makefile: 115; java: 77; awk: 34; csh: 9
file content (46 lines) | stat: -rwxr-xr-x 1,416 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
/*
**  Tests for popular PC compilers and versions
*/

#include <stdio.h>

void main(void)         /* Actually, void main() is non-ANSI/ISO  */
{
      int version;

#if defined(__ZTC__)
 #ifdef __SC__
      printf("Symantec C++ ver. %x.%x\n", __SC__ >> 8, __SC__ & 0xff);
 #else
      printf("Zortech C++ ver. %x.%xr%x\n",
            __ZTC__ >> 8, (__ZTC__ >> 4) & 0xf, __ZTC__ & 0xf);
 #endif
#elif defined(__WATCOMC__)
      printf("Watcom C/C++ ver. %d.%d\n",
            __WATCOMC__ / 100, __WATCOMC__ % 100);
#elif defined(__TURBOC__)
      version = __TURBOC__;
      if (0x295 > version)
      {
            printf("Borland Turbo C ver. %x.%02x\n",
                  version >> 8, version & 0xff);
      }
      else if (0x400 <= version)
      {
            printf("Borland C++ ver. %x.%x\n",
                  (version >> 8) - 1, (version & 0xff) >> 4);
      }
      else if (0x297 > version)
            printf("Borland Turbo C++ ver. 1.%02x\n", version - 0x295);
      else  printf("Borland C++ ver. 2.%02x\n", version - 0x297);
#elif defined(_QC)
      printf("Microsoft Quick C ver. %d.%d\n", _QC / 100, _QC % 100);
#elif defined(_MSC_VER)
      printf("Microsoft C(/C++) ver. %d.%d\n",
            _MSC_VER / 100, _MSC_VER % 100);
#elif defined(__POWERC)
      printf ("MIX Power C ver. %d\n", __POWERC);
#else
      puts("Unknown compiler!");
#endif
}