public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug driver/31694]  New: __GFORTRAN__ preprocessor macro
@ 2007-04-25  7:42 fxcoudert at gcc dot gnu dot org
  2007-04-25  7:43 ` [Bug driver/31694] " fxcoudert at gcc dot gnu dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:42 UTC (permalink / raw)
  To: gcc-bugs

When preprocessing Fortran code (ie when cc1 is called with -lang-fortran) we
should define a __GFORTRAN__ macro. Here's a patch that does just that:

Index: c-common.h
===================================================================
--- c-common.h  (revision 124116)
+++ c-common.h  (working copy)
@@ -254,6 +254,9 @@
 #define c_dialect_cxx()                (c_language & clk_cxx)
 #define c_dialect_objc()       (c_language & clk_objc)

+/* FXC */
+extern bool lang_fortran;
+
 /* Information about a statement tree.  */

 struct stmt_tree_s GTY(()) {
Index: c-cppbuiltin.c
===================================================================
--- c-cppbuiltin.c      (revision 124116)
+++ c-cppbuiltin.c      (working copy)
@@ -569,6 +569,9 @@
   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__",
Index: c-opts.c
===================================================================
--- c-opts.c    (revision 124116)
+++ c-opts.c    (working copy)
@@ -73,7 +73,7 @@
 static bool verbose;

 /* If -lang-fortran seen.  */
-static bool lang_fortran = false;
+bool lang_fortran = false;

 /* Dependency output file.  */
 static const char *deps_file;


-- 
           Summary: __GFORTRAN__ preprocessor macro
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: driver
        AssignedTo: fxcoudert at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/31694] __GFORTRAN__ preprocessor macro
  2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
@ 2007-04-25  7:43 ` fxcoudert at gcc dot gnu dot org
  2007-04-25  7:43 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-04-25 08:42:29
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/31694] __GFORTRAN__ preprocessor macro
  2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
  2007-04-25  7:43 ` [Bug driver/31694] " fxcoudert at gcc dot gnu dot org
@ 2007-04-25  7:43 ` fxcoudert at gcc dot gnu dot org
  2007-04-25 16:12 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25  7:43 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-04-25 08:42:29         |2007-04-25 08:42:45
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/31694] __GFORTRAN__ preprocessor macro
  2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
  2007-04-25  7:43 ` [Bug driver/31694] " fxcoudert at gcc dot gnu dot org
  2007-04-25  7:43 ` fxcoudert at gcc dot gnu dot org
@ 2007-04-25 16:12 ` fxcoudert at gcc dot gnu dot org
  2007-05-07  5:48 ` fxcoudert at gcc dot gnu dot org
  2007-05-07  5:54 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-04-25 16:12 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
   Target Milestone|---                         |4.3.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/31694] __GFORTRAN__ preprocessor macro
  2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-04-25 16:12 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-07  5:48 ` fxcoudert at gcc dot gnu dot org
  2007-05-07  5:54 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-07  5:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-05-07 06:48 -------
Subject: Bug 31694

Author: fxcoudert
Date: Mon May  7 05:48:24 2007
New Revision: 124495

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=124495
Log:
        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.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-common.h
    trunk/gcc/c-cppbuiltin.c
    trunk/gcc/c-opts.c


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug driver/31694] __GFORTRAN__ preprocessor macro
  2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-05-07  5:48 ` fxcoudert at gcc dot gnu dot org
@ 2007-05-07  5:54 ` fxcoudert at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-05-07  5:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2007-05-07 06:53 -------
Fixed on mainline.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31694


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-05-07  5:54 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-25  7:42 [Bug driver/31694] New: __GFORTRAN__ preprocessor macro fxcoudert at gcc dot gnu dot org
2007-04-25  7:43 ` [Bug driver/31694] " fxcoudert at gcc dot gnu dot org
2007-04-25  7:43 ` fxcoudert at gcc dot gnu dot org
2007-04-25 16:12 ` fxcoudert at gcc dot gnu dot org
2007-05-07  5:48 ` fxcoudert at gcc dot gnu dot org
2007-05-07  5:54 ` fxcoudert at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).