This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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: [fortran,patch] Creating a common header to the front-end and runtime library


>>>>> =?ISO-8859-1?Q?Fran=E7ois-Xavier Coudert?= writes:

FX> That's OK.  The io/io.h patchlet was missing from your mail, but I can
FX> safely assume from the ChangeLog that it's a one-liner ;-)

	Below is the final patch I am committing.

Bootstrapped successfully on powerpc-ibm-aix5.3.0.0 and
powerpc-ibm-aix5.2.0.0.

David


	* libgfortran.h: Include config.h first.
	* io/io.h (struct stream): Rename truncate to trunc.
	* io/unix.c (fd_open): Same.
	(open_internal): Same.

Index: libgfortran.h
===================================================================
--- libgfortran.h	(revision 128130)
+++ libgfortran.h	(working copy)
@@ -31,6 +31,9 @@
 #ifndef LIBGFOR_H
 #define LIBGFOR_H
 
+/* config.h MUST be first because it can affect system headers.  */
+#include "config.h"
+
 #include <stdio.h>
 #include <math.h>
 #include <stddef.h>
@@ -45,7 +48,6 @@
 
 #include "../gcc/fortran/libgfortran.h"
 
-#include "config.h"
 #include "c99_protos.h"
 
 #if HAVE_IEEEFP_H
Index: io/io.h
===================================================================
--- io/io.h	(revision 128130)
+++ io/io.h	(working copy)
@@ -54,7 +54,7 @@
   try (*sfree) (struct stream *);
   try (*close) (struct stream *);
   try (*seek) (struct stream *, gfc_offset);
-  try (*truncate) (struct stream *);
+  try (*trunc) (struct stream *);
   int (*read) (struct stream *, void *, size_t *);
   int (*write) (struct stream *, const void *, size_t *);
   try (*set) (struct stream *, int, size_t);
@@ -74,7 +74,7 @@
 #define salloc_w_at(s, len, where) ((s)->alloc_w_at)(s, len, where)
 
 #define sseek(s, pos) ((s)->seek)(s, pos)
-#define struncate(s) ((s)->truncate)(s)
+#define struncate(s) ((s)->trunc)(s)
 #define sread(s, buf, nbytes) ((s)->read)(s, buf, nbytes)
 #define swrite(s, buf, nbytes) ((s)->write)(s, buf, nbytes)
 
Index: io/unix.c
===================================================================
--- io/unix.c	(revision 128130)
+++ io/unix.c	(working copy)
@@ -828,7 +828,7 @@
   s->st.sfree = (void *) fd_sfree;
   s->st.close = (void *) fd_close;
   s->st.seek = (void *) fd_seek;
-  s->st.truncate = (void *) fd_truncate;
+  s->st.trunc = (void *) fd_truncate;
   s->st.read = (void *) fd_read;
   s->st.write = (void *) fd_write;
   s->st.set = (void *) fd_sset;
@@ -1042,7 +1042,7 @@
   s->st.sfree = (void *) mem_sfree;
   s->st.close = (void *) mem_close;
   s->st.seek = (void *) mem_seek;
-  s->st.truncate = (void *) mem_truncate;
+  s->st.trunc = (void *) mem_truncate;
   s->st.read = (void *) mem_read;
   s->st.write = (void *) mem_write;
   s->st.set = (void *) mem_set;


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