This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Predefined macros?
- From: Martin Dickopp <firefly-mail at gmx dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 17 Sep 2002 19:33:25 +0200
- Subject: Re: Predefined macros?
- References: <16f201c25e6c$797b5540$2200000a@opus800>
On Tue, Sep 17, 2002 at 12:05:50PM -0500, Dave Williss wrote:
> Are there any predefined macro constants that I can use in ifdefs to
> determine which version of gcc is doing the compiling?
Yes: __GNUC__ and __GNUC_MINOR__
For example, you can use
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
to check for gcc 2.95 or later.
Martin