[patch] Have cc1 define a __GFORTRAN__ macro when -lang-fortran is used

François-Xavier Coudert fxcoudert@gmail.com
Wed Apr 25 17:22:00 GMT 2007


Hi all,

Attached patch makes cc1 define the __GFORTRAN__ macro as equal to 1
when it is passed the -lang-fortran option. This option is used when
the driver decides (or is told ) to preprocess a Fortran file. The
changes are minimal: we already had a lang_fortran variable that says
whether -lang-fortran was passed, so we simply need to make it visible
from c-cppbuiltin.c, where we actually define the macro.

The patch is bootstrapped with C and Fortran on i686-linux. An earlier
version regtested fine, and this regression-test for this one is
almost done.

OK for mainline?



2007-04-25  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>

        PR driver/31694
        * gcc/c-opts.c (lang_fortran): Make it non static.
        * gcc/c-common.h (lang_fortran): New prototype.
        * gcc/c-cppbuiltin.c (c_cpp_builtins): Create a __GFORTRAN__
        if the -lang-fortran option was passed by the driver.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfortran_macro.diff
Type: text/x-patch
Size: 1277 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070425/393e68d3/attachment.bin>


More information about the Gcc-patches mailing list