From 2f8e3bd7bd87055806b1180fc5a5b4668b0c28cd Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Mon, 7 May 2007 05:48:24 +0000 Subject: [PATCH] re PR driver/31694 (__GFORTRAN__ preprocessor macro) PR driver/31694 * c-opts.c (lang_fortran): Make it non static. * c-common.h (lang_fortran): New prototype. * c-cppbuiltin.c (c_cpp_builtins): Create a __GFORTRAN__ if the -lang-fortran option was passed by the driver. From-SVN: r124495 --- gcc/ChangeLog | 8 ++++++++ gcc/c-common.h | 2 ++ gcc/c-cppbuiltin.c | 3 +++ gcc/c-opts.c | 2 +- 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1272b72af14..f523f3ac578 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2007-05-07 Francois-Xavier Coudert + + PR driver/31694 + * c-opts.c (lang_fortran): Make it non static. + * c-common.h (lang_fortran): New prototype. + * c-cppbuiltin.c (c_cpp_builtins): Create a __GFORTRAN__ if the + -lang-fortran option was passed by the driver. + 2007-05-06 Eric Botcazou * timevar.c (timevar_print): Test ENABLE_ASSERT_CHECKING instead diff --git a/gcc/c-common.h b/gcc/c-common.h index d4afaec4535..5e97211cb17 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -254,6 +254,8 @@ extern c_language_kind c_language; #define c_dialect_cxx() (c_language & clk_cxx) #define c_dialect_objc() (c_language & clk_objc) +extern bool lang_fortran; + /* Information about a statement tree. */ struct stmt_tree_s GTY(()) { diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c index c36b038bc77..cc19ce5dd7d 100644 --- a/gcc/c-cppbuiltin.c +++ b/gcc/c-cppbuiltin.c @@ -569,6 +569,9 @@ c_cpp_builtins (cpp_reader *pfile) if (flag_openmp) cpp_define (pfile, "_OPENMP=200505"); + if (lang_fortran) + cpp_define (pfile, "__GFORTRAN__=1"); + builtin_define_type_sizeof ("__SIZEOF_INT__", integer_type_node); builtin_define_type_sizeof ("__SIZEOF_LONG__", long_integer_type_node); builtin_define_type_sizeof ("__SIZEOF_LONG_LONG__", diff --git a/gcc/c-opts.c b/gcc/c-opts.c index e378f377a0c..a41362a9829 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -73,7 +73,7 @@ static bool deps_seen; static bool verbose; /* If -lang-fortran seen. */ -static bool lang_fortran = false; +bool lang_fortran = false; /* Dependency output file. */ static const char *deps_file; -- 2.30.2