This is the mail archive of the egcs@egcs.cygnus.com mailing list for the EGCS project. See the EGCS home page for more information.


[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index] [Subject Index] [Author Index] [Thread Index]

Re: Predefines?




> Are there predefined macros that allow conditional compilation based on
> whether EGCS is being used and on whether the EGCS is a version that
> supports namespaces?	

Yes, use __GNUC__ to get the major version (2) and __GNUC_MINOR__ to get
the minor version of gcc.  It is 7 for 2.7.x, 8 for 2.8.x, 90 for egcs
1.0.x, 91 for egcs 1.1.x, 92 for some post 1.1 snapshots, and 93 for the
current snapshots.  egcs 1.1 is the first release that supports namespaces
reasonably fully.

(We needed the 92/93 jump because we need to be able to test for the
presence of a new feature that affects bootstrapping).

There is no macro for the third number in the version.

It is conceivable that there will be a gcc 3.0 at some point, in which
case __GNUC__ would become 3 and __GNUC_MINOR__ would become 0.