TITLE: identifying compiler support level with __cplusplus (Newsgroups: comp.std.c++, 16 Mar 97) UNKNOWN: >> C++ compilers use to #define __cplusplus which can be used by source code >> to check whether a C or C++ compiler is in use. Will that be part of the >> C++ standard? >> >> [Yes. See 16.8[cpp.predefined]/1 in the draft working paper. >> -moderator (fjh).] PALMER: "Sean L. Palmer" > >What about draft/standard revision identification? > >#if __cplusplus >= 19970211 //Feb '97 standard or later? >#endif HENDERSON: fjh@mundook.cs.mu.OZ.AU (Fergus Henderson) See 16.8[cpp.predefined]/1! If you read that, you will see that the Feb 97 draft requires that __cplusplus be defined as `199711L'. So you should use #if __cplusplus >= 199711 //Feb '97 standard or later? ... #endif PALMER: >And a standard way for compiler vendors to identify themselves and their >compiler version? HENDERSON: Compilers already have ways of doing that. PALMER: >#elif __compiler == __gnu HENDERSON: Why would that be any better than #elif __GNUC__