Re: Compiler identification macro?
From: Russell Hanneken (rghanneken_at_pobox.com)
Date: 04/30/04
- Next message: Leor Zolman: "Re: cin, iostream problems"
- Previous message: marbac: "Re: Does C++ have a standard symbol representing the value Pi?"
- In reply to: Carl Ribbegaardh: "Compiler identification macro?"
- Next in thread: Walter: "Re: Compiler identification macro?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 30 Apr 2004 03:03:59 GMT
Carl Ribbegaardh wrote:
> Is there any known list of compiler identification macros?
> I'm using VS 2003, g++ on windows, sun's cc and g++ on solaris. Is it
> possible to identify the compiler using macros?
It's possible, but exactly what macros you look for differs from system
to system. See, for example:
GCC: Common Predefined Macros (macros defined in every port of GCC)
http://gcc.gnu.org/onlinedocs/gcc-3.4.0/cpp/Common-Predefined-Macros.html#Common%20Predefined%20Macros
GCC: System-specific Predefined Macros (how to find system-specific GCC
macros)
http://gcc.gnu.org/onlinedocs/gcc-3.4.0/cpp/System-specific-Predefined-Macros.html#System-specific%20Predefined%20Macros
Microsoft: Predefined Macros
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclang/html/_predir_predefined_macros.asp
I usually look for _MSC_VER to identify Microsoft compilers.
Since the answer to your question differs from system to system, you'll
have better luck seeking answers on newsgroups devoted to your
platform/compiler (assuming you can't find the answers in the
documentation).
Regards,
Russell Hanneken
rghanneken@pobox.com
Remove the 'g' from my address to send me mail.
- Next message: Leor Zolman: "Re: cin, iostream problems"
- Previous message: marbac: "Re: Does C++ have a standard symbol representing the value Pi?"
- In reply to: Carl Ribbegaardh: "Compiler identification macro?"
- Next in thread: Walter: "Re: Compiler identification macro?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|