This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

[libfortran] Patch for pr 15328


Patch for pr 15328:

In directory

gcc/libgfortran/io

.orig files refer to tree-ssa 20040513

===========================================

diff -c3 -p io.h.orig io.h
*** io.h.orig   Fri May 14 21:59:10 2004
--- io.h        Fri May 14 21:49:32 2004
*************** int is_seekable (stream *);
*** 456,461 ****
--- 456,464 ----
  #define empty_internal_buffer prefix(empty_internal_buffer)
  void empty_internal_buffer(stream *);
  
+ #define flush prefix(flush)
+ try flush (stream *);
+ 
  
  /* unit.c */
  
=================================================

diff -c3 -p transfer.c.orig transfer.c
*** transfer.c.orig     Fri May 14 22:05:29 2004
--- transfer.c  Fri May 14 21:51:28 2004
*************** finalize_transfer (void)
*** 1337,1344 ****
      {
        free_fnodes ();
  
!       if (advance_status == ADVANCE_NO)
!    	   return;
        next_record (1);
        current_unit->current_record = 0;
      }
--- 1337,1347 ----
      {
        free_fnodes ();
  
!       if (advance_status == ADVANCE_NO) 
!         {
!         flush(current_unit->s);
!         return;
!         }
        next_record (1);
        current_unit->current_record = 0;
      }

=================================================

diff -c3 -p unix.c.orig unix.c
*** unix.c.orig Fri May 14 21:58:55 2004
--- unix.c      Fri May 14 22:16:23 2004
*************** sys_exit (int code)
*** 264,270 ****
  
  /* fd_flush()-- Write bytes that need to be written */
  
! static try
  fd_flush (unix_stream * s)
  {
  
--- 264,270 ----
  
  /* fd_flush()-- Write bytes that need to be written */
  
! try
  fd_flush (unix_stream * s)
  {
  
*************** is_seekable (stream * s)
*** 1394,1399 ****
--- 1394,1405 ----
    return ((unix_stream *) s)->mmaped;
  }
  
+ try
+ flush (stream *s)
+ {
+   return fd_flush( (unix_stream *) s);
+ }
+ 
  
  /* How files are stored:  This is an operating-system specific issue,
     and therefore belongs here.  There are three cases to consider.

===============================================================

The thing that I don't particularly like is that I have to redefine
the fd_flush function as not static, else I get a relocation
error. But really, it should be static, so how should it be solved
(I'm sure it's really simple, grrr)?

--
Janne Blomqvist


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