This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Predefined macros?


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]