Predefined macros?

Martin Dickopp firefly-mail@gmx.net
Tue Sep 17 10:47:00 GMT 2002


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



More information about the Gcc-help mailing list