Xref: utzoo comp.std.c++:895 comp.std.c:4805 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!sdd.hp.com!spool.mu.edu!uunet!proto!joe From: joe@proto.com (Joe Huffman) Newsgroups: comp.std.c++,comp.std.c Subject: Re: Standard identification of compilers? Message-ID: <1991May07.161128.13786@proto.com> Date: 7 May 91 16:11:28 GMT References: Distribution: comp Organization: Prototronics @ Sandpoint, Idaho Lines: 20 cimshop!davidm@uunet.UU.NET (David S. Masterson) writes: >Does the proposed standard (C or C++) have a way of identifying whose compiler >is being used? I know its bad form to build code specific to a compiler when >that compiler conforms to a standard, but it seems that every compiler has its >little quirks that are specific to it. What I was wondering was if one could: > #if (__COMPILER__ == "BC++ v2.02") > ... > #endif I think your suggestion needs some modification... The test shown will generate a syntax error no matter what __COMPILER__ is defined to (an integer constant expression is expected). You might just compile a list of what the different vendors use for identification. Zortech uses __ZTC__ which expands to the version number in hex. For example: version 2.18 would have __ZTC__ equal to 0x218. -- joe@proto.com