"changed required for gcc-3.1"

[email protected] Wed, 24 Jul 2002 11:10:50 -0700
Newsgroups gmane.comp.lib.ivtools.patches
Message-ID <[email protected]>
Patch:    ivtools-020724-johnston-058
For:      ivtools-1.0.4
Author:   [email protected]
Subject:  changed required for gcc-3.1
Requires: 

This is an intermediate patch to ivtools-1.0.4.  To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:

	patch -p0 <ThisFile

Summary of Changes:

- changes required to compile ivtools with gcc-3.1.  Most all in the area
of migrating from use of an fstream constructor that accepted a FILE*
to use of a derivative class (__gnu_cxx::stdio_filebuf<char>) that does
the same.  Wrapped up the difference between 3.0.* and 3.1 by 
conditionally defining a fileptr_fstream in src/include/ivstd/fstream.h
to filebuf for 3.0.* and __gnu_cxx::stdio_filebuf<char> for 3.1.

Constant evolution of the behavior and API of filebuf has been the
single most challenging aspect of keeping ivtools compiling with gcc
and working for the past decade.  I really hope things will be stable
for the next decade.

Index: ComUtil/errsys.c
diff -c ComUtil/errsys.c:1.3 ComUtil/errsys.c:1.4
*** ComUtil/errsys.c:1.3	Wed Jan  9 15:18:12 2002
--- src/ComUtil/errsys.c	Wed Jul 24 11:00:01 2002
***************
*** 134,140 ****
  		MAX_ERROR_OPENS );
      
      /* Attempt to open error file */
!     errpath = getenv( "COMTERP_PATH" );
      if (errpath) {
  	strcpy( fullpath, errpath );
  	strcat( fullpath, "/" );
--- 134,140 ----
  		MAX_ERROR_OPENS );
      
      /* Attempt to open error file */
!     errpath = (char*)getenv( "COMTERP_PATH" );
      if (errpath) {
  	strcpy( fullpath, errpath );
  	strcat( fullpath, "/" );
Index: ComTerp/comhandler.c
diff -c ComTerp/comhandler.c:1.3 ComTerp/comhandler.c:1.4
*** ComTerp/comhandler.c:1.3	Wed Mar 20 11:45:54 2002
--- src/ComTerp/comhandler.c	Wed Jul 24 11:00:04 2002
***************
*** 127,133 ****
  #if __GNUG__<3
  	      filebuf obuf(1);
  #else
! 	      filebuf obuf(stdout, ios_base::out);
  #endif
  	      ostream ostr(&obuf);
  	      ostr << "timeexpr result:  ";
--- 127,133 ----
  #if __GNUG__<3
  	      filebuf obuf(1);
  #else
! 	      fileptr_filebuf obuf(stdout, ios_base::out);
  #endif
  	      ostream ostr(&obuf);
  	      ostr << "timeexpr result:  ";
***************
*** 196,202 ****
        ostr.flush();
        return 0;
  #else
!       filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
        ostream ostr(&obuf);
        ostr << "\n";
        ostr.flush();
--- 196,202 ----
        ostr.flush();
        return 0;
  #else
!       fileptr_filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
        ostream ostr(&obuf);
        ostr << "\n";
        ostr.flush();
***************
*** 221,227 ****
        ostr << "\n";
        ostr.flush();
  #else
!       filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
        ostream ostr(&obuf);
        ostr << "\n";
        ostr.flush();
--- 221,227 ----
        ostr << "\n";
        ostr.flush();
  #else
!       fileptr_filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
        ostream ostr(&obuf);
        ostr << "\n";
        ostr.flush();
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.5 ComTerp/comterp.c:1.6
*** ComTerp/comterp.c:1.5	Thu Mar 21 16:14:54 2002
--- src/ComTerp/comterp.c	Wed Jul 24 11:00:04 2002
***************
*** 291,297 ****
        filebuf fbufout;
        fbufout.attach(handler() ? Math::max(1, handler()->get_handle()) : fileno(stdout));
  #else
!       filebuf fbufout(handler() && handler()->wrfptr() 
  		      ? handler()->wrfptr() : stdout, 
  		      ios_base::out);
  #endif
--- 291,297 ----
        filebuf fbufout;
        fbufout.attach(handler() ? Math::max(1, handler()->get_handle()) : fileno(stdout));
  #else
!       fileptr_filebuf fbufout(handler() && handler()->wrfptr() 
  		      ? handler()->wrfptr() : stdout, 
  		      ios_base::out);
  #endif
***************
*** 884,890 ****
    } else
      fbuf.attach(fileno(stdout));
  #else
!   filebuf fbuf(handler() && handler()->wrfptr() 
  	       ? handler()->wrfptr() : stdout, 
  	       ios_base::out);
  #endif
--- 884,890 ----
    } else
      fbuf.attach(fileno(stdout));
  #else
!   fileptr_filebuf fbuf(handler() && handler()->wrfptr() 
  	       ? handler()->wrfptr() : stdout, 
  	       ios_base::out);
  #endif
***************
*** 1111,1117 ****
  #if __GNUG__<3
  	        filebuf obuf(1);
  #else
! 	        filebuf obuf(stdout, ios_base::out);
  #endif
  		ostream ostr(&obuf);
  		ostr << "err\n";
--- 1111,1117 ----
  #if __GNUG__<3
  	        filebuf obuf(1);
  #else
! 	        fileptr_filebuf obuf(stdout, ios_base::out);
  #endif
  		ostream ostr(&obuf);
  		ostr << "err\n";
Index: ComTerp/comterpserv.c
diff -c ComTerp/comterpserv.c:1.1 ComTerp/comterpserv.c:1.2
*** ComTerp/comterpserv.c:1.1	Fri Nov  2 13:04:49 2001
--- src/ComTerp/comterpserv.c	Wed Jul 24 11:00:04 2002
***************
*** 154,160 ****
  #else
      char instr[BUFSIZ];
      FILE* ifptr = fdopen(fd, "r");
!     filebuf fbuf(ifptr, ios_base::in);
      istream in (&fbuf);
      in.get(instr, BUFSIZ, '\n');  // needs to be generalized with <vector.h>
  #endif
--- 154,160 ----
  #else
      char instr[BUFSIZ];
      FILE* ifptr = fdopen(fd, "r");
!     fileptr_filebuf fbuf(ifptr, ios_base::in);
      istream in (&fbuf);
      in.get(instr, BUFSIZ, '\n');  // needs to be generalized with <vector.h>
  #endif
***************
*** 198,204 ****
      fbuf.attach(fd);
  #else
      FILE* ofptr = fdopen(fd, "w");
!     filebuf fbuf(ofptr, ios_base::out);
  #endif
      ostream out(&fbuf);
      for (; outpos < bufsize-1 && s[outpos]; outpos++)
--- 198,204 ----
      fbuf.attach(fd);
  #else
      FILE* ofptr = fdopen(fd, "w");
!     fileptr_filebuf fbuf(ofptr, ios_base::out);
  #endif
      ostream out(&fbuf);
      for (; outpos < bufsize-1 && s[outpos]; outpos++)
***************
*** 290,296 ****
      filebuf ibuf;
      ibuf.open(filename, "r");
  #else
!     filebuf ibuf(fopen(filename, "r"), ios_base::in);
  #endif
      istream istr(&ibuf);
      ComValue* retval = nil;
--- 290,296 ----
      filebuf ibuf;
      ibuf.open(filename, "r");
  #else
!     fileptr_filebuf ibuf(fopen(filename, "r"), ios_base::in);
  #endif
      istream istr(&ibuf);
      ComValue* retval = nil;
***************
*** 314,320 ****
  	        filebuf obuf(handler() ? handler()->get_handle() : 1);
  #else
                  FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w"); 
! 	        filebuf obuf(ofptr, ios_base::out);
  #endif
  		ostream ostr(&obuf);
  		ostr.flush();
--- 314,320 ----
  	        filebuf obuf(handler() ? handler()->get_handle() : 1);
  #else
                  FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w"); 
! 	        fileptr_filebuf obuf(ofptr, ios_base::out);
  #endif
  		ostream ostr(&obuf);
  		ostr.flush();
***************
*** 335,341 ****
  	  filebuf obuf(handler() ? handler()->get_handle() : 1);
  #else
            FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w"); 
! 	  filebuf obuf(ofptr, ios_base::out);
  #endif
  	  ostream ostr(&obuf);
  	  ostr.flush();
--- 335,341 ----
  	  filebuf obuf(handler() ? handler()->get_handle() : 1);
  #else
            FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w"); 
! 	  fileptr_filebuf obuf(ofptr, ios_base::out);
  #endif
  	  ostream ostr(&obuf);
  	  ostr.flush();
Index: ComTerp/ctrlfunc.c
diff -c ComTerp/ctrlfunc.c:1.1 ComTerp/ctrlfunc.c:1.2
*** ComTerp/ctrlfunc.c:1.1	Fri Nov  2 13:04:49 2001
--- src/ComTerp/ctrlfunc.c	Wed Jul 24 11:00:04 2002
***************
*** 132,138 ****
      filebuf ofbuf;
      ofbuf.attach(socket.get_handle());
  #else
!     filebuf ofbuf(comterp()->handler() && comterp()->handler()->wrfptr() 
  		  ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
      ostream out(&ofbuf);
--- 132,138 ----
      filebuf ofbuf;
      ofbuf.attach(socket.get_handle());
  #else
!     fileptr_filebuf ofbuf(comterp()->handler() && comterp()->handler()->wrfptr() 
  		  ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
      ostream out(&ofbuf);
***************
*** 148,154 ****
        char* buf;
        in.gets(&buf);
  #else
!       filebuf ifbuf(comterp()->handler()->rdfptr(), ios_base::in);
        istream in(&ifbuf);
        char buf[BUFSIZ];
        in.get(buf, BUFSIZ);
--- 148,154 ----
        char* buf;
        in.gets(&buf);
  #else
!       fileptr_filebuf ifbuf(comterp()->handler()->rdfptr(), ios_base::in);
        istream in(&ifbuf);
        char buf[BUFSIZ];
        in.get(buf, BUFSIZ);
Index: ComTerp/debugfunc.c
diff -c ComTerp/debugfunc.c:1.2 ComTerp/debugfunc.c:1.3
*** ComTerp/debugfunc.c:1.2	Fri Nov 16 10:25:13 2001
--- src/ComTerp/debugfunc.c	Wed Jul 24 11:00:04 2002
***************
*** 95,101 ****
    } else
      fbufin.attach(fileno(stdin));
  #else
!   filebuf fbufin(comterp() && comterp()->handler() && comterp()->handler()->rdfptr() 
  		 ? comterp()->handler()->rdfptr() : stdin, ios_base::in);
  #endif
    istream in(&fbufin);
--- 95,101 ----
    } else
      fbufin.attach(fileno(stdin));
  #else
!   fileptr_filebuf fbufin(comterp() && comterp()->handler() && comterp()->handler()->rdfptr() 
  		 ? comterp()->handler()->rdfptr() : stdin, ios_base::in);
  #endif
    istream in(&fbufin);
***************
*** 107,113 ****
    } else
      fbufout.attach(fileno(stdout));
  #else
!   filebuf fbufout(comterp()->handler() && comterp()->handler()->wrfptr()
  		  ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
    ostream out(&fbufout);
--- 107,113 ----
    } else
      fbufout.attach(fileno(stdout));
  #else
!   fileptr_filebuf fbufout(comterp()->handler() && comterp()->handler()->wrfptr()
  		  ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
    ostream out(&fbufout);
Index: ComTerp/helpfunc.c
diff -c ComTerp/helpfunc.c:1.1 ComTerp/helpfunc.c:1.2
*** ComTerp/helpfunc.c:1.1	Fri Nov  2 13:04:49 2001
--- src/ComTerp/helpfunc.c	Wed Jul 24 11:00:04 2002
***************
*** 136,142 ****
    ostream outs( comterp()->handler() ? ((streambuf*)&fbuf) : (streambuf*)&sbuf );
    ostream *out = &outs;
  #else
!   filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
  	       ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #if 1
    ostream outs(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf);
--- 136,142 ----
    ostream outs( comterp()->handler() ? ((streambuf*)&fbuf) : (streambuf*)&sbuf );
    ostream *out = &outs;
  #else
!   fileptr_filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
  	       ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #if 1
    ostream outs(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf);
Index: ComTerp/iofunc.c
diff -c ComTerp/iofunc.c:1.1 ComTerp/iofunc.c:1.2
*** ComTerp/iofunc.c:1.1	Fri Nov  2 13:04:49 2001
--- src/ComTerp/iofunc.c	Wed Jul 24 11:00:04 2002
***************
*** 78,89 ****
    streambuf* strmbuf = nil;
    if (stringflag.is_false() && strflag.is_false() &&
        symbolflag.is_false() && symflag.is_false()) {
!     filebuf * fbuf = nil;
      if (comterp()->handler()) {
!       fbuf = new filebuf(comterp()->handler() && comterp()->handler()->wrfptr() 
  			 ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
      } else
!       fbuf = new filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
      strmbuf = fbuf;
    } else
      strmbuf = new strstreambuf();
--- 78,89 ----
    streambuf* strmbuf = nil;
    if (stringflag.is_false() && strflag.is_false() &&
        symbolflag.is_false() && symflag.is_false()) {
!     fileptr_filebuf * fbuf = nil;
      if (comterp()->handler()) {
!       fbuf = new fileptr_filebuf(comterp()->handler() && comterp()->handler()->wrfptr() 
  			 ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
      } else
!       fbuf = new fileptr_filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
      strmbuf = fbuf;
    } else
      strmbuf = new strstreambuf();
Index: ComTerp/postfunc.c
diff -c ComTerp/postfunc.c:1.1 ComTerp/postfunc.c:1.2
*** ComTerp/postfunc.c:1.1	Fri Nov  2 13:04:49 2001
--- src/ComTerp/postfunc.c	Wed Jul 24 11:00:04 2002
***************
*** 54,60 ****
    } else
      fbuf.attach(fileno(stdout));
  #else
!   filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
  	       ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
    ostream out(&fbuf);
--- 54,60 ----
    } else
      fbuf.attach(fileno(stdout));
  #else
!   fileptr_filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
  	       ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
  #endif
    ostream out(&fbuf);
Index: Time/timeglyph.c
diff -c Time/timeglyph.c:1.1 Time/timeglyph.c:1.2
*** Time/timeglyph.c:1.1	Fri Nov  2 13:05:27 2001
--- src/Time/timeglyph.c	Wed Jul 24 11:00:10 2002
***************
*** 56,62 ****
      time_->attach(this);
      WidgetKit& kit_ = *WidgetKit::instance();
      const LayoutKit& layout_ = *LayoutKit::instance();
-     Style* s = kit_.style();
  
      Date date(time_->time()->date());
      StringList* wdaylist = new StringList(7);
--- 56,61 ----
Index: OverlayUnidraw/ovcatalog.c
diff -c OverlayUnidraw/ovcatalog.c:1.2 OverlayUnidraw/ovcatalog.c:1.3
*** OverlayUnidraw/ovcatalog.c:1.2	Wed Feb 20 11:54:04 2002
--- src/OverlayUnidraw/ovcatalog.c	Wed Jul 24 11:00:26 2002
***************
*** 212,218 ****
  	  name = nil;
  	}
  	if (!_valid && !ParamList::urltest(name)) return false;
!         filebuf fbuf(stdin_flag ? stdin : fptr, ios_base::in);
  #endif
  	
          if (_valid || ParamList::urltest(name)) {
--- 212,218 ----
  	  name = nil;
  	}
  	if (!_valid && !ParamList::urltest(name)) return false;
!         fileptr_filebuf fbuf(stdin_flag ? stdin : fptr, ios_base::in);
  #endif
  	
          if (_valid || ParamList::urltest(name)) {
Index: OverlayUnidraw/ovfile.c
diff -c OverlayUnidraw/ovfile.c:1.1 OverlayUnidraw/ovfile.c:1.2
*** OverlayUnidraw/ovfile.c:1.1	Fri Nov  2 13:07:02 2001
--- src/OverlayUnidraw/ovfile.c	Wed Jul 24 11:00:26 2002
***************
*** 224,230 ****
  	ifstream ifs;
  	ifs.rdbuf()->attach(fileno(fptr));
  #else
! 	filebuf fbuf(fptr, ios_base::in);
  	istream ifs(&fbuf);
  #endif
  	OverlayComp* child = (OverlayComp*) impcmd.Import(ifs);
--- 224,230 ----
  	ifstream ifs;
  	ifs.rdbuf()->attach(fileno(fptr));
  #else
! 	fileptr_filebuf fbuf(fptr, ios_base::in);
  	istream ifs(&fbuf);
  #endif
  	OverlayComp* child = (OverlayComp*) impcmd.Import(ifs);
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.9 OverlayUnidraw/ovimport.c:1.10
*** OverlayUnidraw/ovimport.c:1.9	Tue Jul 16 11:36:28 2002
--- src/OverlayUnidraw/ovimport.c	Wed Jul 24 11:00:26 2002
***************
*** 599,605 ****
      ifs->rdbuf()->attach(_fd);
  #else
      FILE* ifptr = fdopen(_fd, "r");
!     filebuf* fbuf = new filebuf(ifptr, ios_base::in);
      istream* ifs = new istream(fbuf);
  #endif
      _helper.add_stream(ifs);
--- 599,605 ----
      ifs->rdbuf()->attach(_fd);
  #else
      FILE* ifptr = fdopen(_fd, "r");
!     fileptr_filebuf* fbuf = new fileptr_filebuf(ifptr, ios_base::in);
      istream* ifs = new istream(fbuf);
  #endif
      _helper.add_stream(ifs);
***************
*** 1085,1091 ****
  	  ifstream* ifs = new ifstream;
            ifs->rdbuf()->attach(fileno(fptr));
  #else
! 	  filebuf* fbuf = new filebuf(fptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  #endif
  	  inptr_ = ifs;
--- 1085,1091 ----
  	  ifstream* ifs = new ifstream;
            ifs->rdbuf()->attach(fileno(fptr));
  #else
! 	  fileptr_filebuf* fbuf = new fileptr_filebuf(fptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  #endif
  	  inptr_ = ifs;
***************
*** 1391,1397 ****
        ifstream* in = new ifstream;
        in->rdbuf()->attach(fileno(fptr));
  #else
!       filebuf* fbuf = new filebuf(fptr, ios_base::in);
        istream* in = new istream(fbuf);
  #endif
        helper_->add_stream(in);
--- 1391,1397 ----
        ifstream* in = new ifstream;
        in->rdbuf()->attach(fileno(fptr));
  #else
!       fileptr_filebuf* fbuf = new fileptr_filebuf(fptr, ios_base::in);
        istream* in = new istream(fbuf);
  #endif
        helper_->add_stream(in);
***************
*** 1480,1486 ****
  	  ifstream* ifs = new ifstream;
            ifs->rdbuf()->attach(fileno(gunzip_fptr));
  #else
! 	  filebuf* fbuf = new filebuf(gunzip_fptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  #endif
            helper.add_stream(ifs);
--- 1480,1486 ----
  	  ifstream* ifs = new ifstream;
            ifs->rdbuf()->attach(fileno(gunzip_fptr));
  #else
! 	  fileptr_filebuf* fbuf = new fileptr_filebuf(gunzip_fptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  #endif
            helper.add_stream(ifs);
***************
*** 1494,1500 ****
            ifs->rdbuf()->attach(newfd);
  #else
  	  FILE* ifptr = fdopen(newfd, "r");
! 	  filebuf* fbuf = new filebuf(ifptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  	  helper.add_file(ifptr);
  #endif
--- 1494,1500 ----
            ifs->rdbuf()->attach(newfd);
  #else
  	  FILE* ifptr = fdopen(newfd, "r");
! 	  fileptr_filebuf* fbuf = new fileptr_filebuf(ifptr, ios_base::in);
  	  istream* ifs = new istream(fbuf);
  	  helper.add_file(ifptr);
  #endif
***************
*** 1542,1548 ****
  #else
  	  FILE* ifptr = fdopen(new_fd, "r");
  	  helper.add_file(ifptr);
! 	  filebuf fbuf(ifptr, ios_base::in);
  	  istream new_in(&fbuf);
  #endif
  	  comp = catalog->ReadPostScript(new_in);
--- 1542,1548 ----
  #else
  	  FILE* ifptr = fdopen(new_fd, "r");
  	  helper.add_file(ifptr);
! 	  fileptr_filebuf fbuf(ifptr, ios_base::in);
  	  istream new_in(&fbuf);
  #endif
  	  comp = catalog->ReadPostScript(new_in);
***************
*** 1578,1584 ****
  	    ifstream new_in;
              new_in.rdbuf()->attach(fileno(pptr));
  #else
! 	    filebuf fbuf(pptr, ios_base::in);
  	    istream new_in(&fbuf);
  #endif
  	    comp = PNM_Image(new_in);
--- 1578,1584 ----
  	    ifstream new_in;
              new_in.rdbuf()->attach(fileno(pptr));
  #else
! 	    fileptr_filebuf fbuf(pptr, ios_base::in);
  	    istream new_in(&fbuf);
  #endif
  	    comp = PNM_Image(new_in);
***************
*** 1642,1648 ****
  	    ifstream* new_in = new ifstream;
              new_in->rdbuf()->attach(fileno(pptr));
  #else
! 	    filebuf* fbuf = new filebuf(pptr, ios_base::in);
  	    istream* new_in = new istream(fbuf);
  #endif
              helper.add_stream(new_in);
--- 1642,1648 ----
  	    ifstream* new_in = new ifstream;
              new_in->rdbuf()->attach(fileno(pptr));
  #else
! 	    fileptr_filebuf* fbuf = new fileptr_filebuf(pptr, ios_base::in);
  	    istream* new_in = new istream(fbuf);
  #endif
              helper.add_stream(new_in);
***************
*** 1672,1678 ****
  	    ifstream new_in;
              new_in.rdbuf()->attach(fileno(pptr));
  #else
! 	    filebuf fbuf(pptr, ios_base::in);
  	    istream new_in(&fbuf);
  #endif
  	    comp = PNM_Image(new_in);
--- 1672,1678 ----
  	    ifstream new_in;
              new_in.rdbuf()->attach(fileno(pptr));
  #else
! 	    fileptr_filebuf fbuf(pptr, ios_base::in);
  	    istream new_in(&fbuf);
  #endif
  	    comp = PNM_Image(new_in);
***************
*** 2443,2449 ****
      in2.rdbuf()->attach(outfd);
  #else
      FILE* infptr = fdopen(outfd, "r");
!     filebuf fbuf(infptr, ios_base::in);
      istream in2(&fbuf);
  #endif
  
--- 2443,2449 ----
      in2.rdbuf()->attach(outfd);
  #else
      FILE* infptr = fdopen(outfd, "r");
!     fileptr_filebuf fbuf(infptr, ios_base::in);
      istream in2(&fbuf);
  #endif
  
Index: ComUnidraw/unifunc.c
diff -c ComUnidraw/unifunc.c:1.3 ComUnidraw/unifunc.c:1.4
*** ComUnidraw/unifunc.c:1.3	Tue May  7 13:26:26 2002
--- src/ComUnidraw/unifunc.c	Wed Jul 24 11:00:29 2002
***************
*** 464,470 ****
  	}
  	else 
  #endif
! 	  pfbuf = new filebuf(stdout, output);
      }
  
      else {
--- 464,470 ----
  	}
  	else 
  #endif
! 	  pfbuf = new fileptr_filebuf(stdout, output);
      }
  
      else {
***************
*** 487,493 ****
              pfbuf = new filebuf(comterp()->handler()->rdfptr(), output);
          } else
  #endif
!             pfbuf = new filebuf(stdout, output);
      }
  
  #endif
--- 487,493 ----
              pfbuf = new filebuf(comterp()->handler()->rdfptr(), output);
          } else
  #endif
!             pfbuf = new fileptr_filebuf(stdout, output);
      }
  
  #endif
Index: FrameUnidraw/framecatalog.c
diff -c FrameUnidraw/framecatalog.c:1.2 FrameUnidraw/framecatalog.c:1.3
*** FrameUnidraw/framecatalog.c:1.2	Fri Mar  1 14:10:46 2002
--- src/FrameUnidraw/framecatalog.c	Wed Jul 24 11:00:31 2002
***************
*** 64,70 ****
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
--- 64,70 ----
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new fileptr_filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
***************
*** 74,80 ****
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = fptr ? new filebuf(fptr, input) : nil;
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
--- 74,80 ----
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = fptr ? new fileptr_filebuf(fptr, input) : nil;
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
Index: GraphUnidraw/graphcatalog.c
diff -c GraphUnidraw/graphcatalog.c:1.2 GraphUnidraw/graphcatalog.c:1.3
*** GraphUnidraw/graphcatalog.c:1.2	Fri Jun 28 12:46:41 2002
--- src/GraphUnidraw/graphcatalog.c	Wed Jul 24 11:00:33 2002
***************
*** 84,90 ****
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
--- 84,90 ----
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new fileptr_filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
***************
*** 94,100 ****
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = new filebuf(fptr, input);
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
--- 94,100 ----
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = new fileptr_filebuf(fptr, input);
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
Index: DrawServ/drawcatalog.c
diff -c DrawServ/drawcatalog.c:1.3 DrawServ/drawcatalog.c:1.4
*** DrawServ/drawcatalog.c:1.3	Fri Jun 28 12:46:43 2002
--- src/DrawServ/drawcatalog.c	Wed Jul 24 11:00:35 2002
***************
*** 69,75 ****
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
--- 69,75 ----
  #if __GNUG__<3
  	    _valid = fbuf.attach(fileno(stdin)) != 0;
  #else
! 	    pfbuf = new fileptr_filebuf(stdin, input);
  	    _valid = 1;
  #endif
  	    name = nil;
***************
*** 79,85 ****
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = new filebuf(fptr, input);
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
--- 79,85 ----
  #if __GNUG__<3
  	    _valid = fptr ? fbuf.attach(fileno(fptr)) != 0 : false;
  #else
! 	    pfbuf = new fileptr_filebuf(fptr, input);
  	    _valid = fptr ? 1 : 0;
  #endif
  	    if (compressed) {
Index: include_std/fstream.h
diff -c include_std/fstream.h:1.1 include_std/fstream.h:1.2
*** include_std/fstream.h:1.1	Fri Nov  2 13:07:50 2001
--- src/include/ivstd/fstream.h	Wed Jul 24 11:00:42 2002
***************
*** 4,9 ****
--- 4,15 ----
  #if __GNUG__>=3
  #define input ios_base::in
  #define output ios_base::out
+ #if __GNUG__>3 || __GNUG__==3 && __GNUC_MINOR__>0
+ #include <ext/stdio_filebuf.h>
+ #define fileptr_filebuf __gnu_cxx::stdio_filebuf<char>
+ #else
+ #define fileptr_filebuf filebuf
+ #endif
  #else
  #define input "r"
  #define output "w"
*** /dev/null	 Wed Jul 24 11:00:48 PDT 2002
--- patches/ivtools-020724-johnston-058
*************** patches/ivtools-020724-johnston-058
*** 0 ****
--- 1 ----
+ ivtools-020724-johnston-058


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf