Mercurial > octave-libgccjit
changeset 12941:9a498efac5f1 stable
use gnulib::fseek and gnulib::fopen
* file-io.cc (do_stream_open): Use gnulib::fopen instead of fopen.
* input.cc (get_input_from_file): Likewise.
* c-file-ptr-stream.h (c_file_ptr_buf::seek):
Use gnulib::fseek instead of fseek.
* bootstrap.conf (gnulib_modules):
Include fopen, fflush, fseek, and ftell in the list.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 09 Aug 2011 22:16:06 -0400 |
parents | 70e9ffbc4c76 |
children | 1be5f06d9fa7 0c74237b3479 |
files | build-aux/bootstrap.conf src/c-file-ptr-stream.cc src/file-io.cc src/input.cc |
diffstat | 4 files changed, 8 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/build-aux/bootstrap.conf Mon Aug 08 21:30:36 2011 -0700 +++ b/build-aux/bootstrap.conf Tue Aug 09 22:16:06 2011 -0400 @@ -25,6 +25,10 @@ fcntl filemode fnmatch + fopen + fflush + fseek + ftell getcwd gethostname getopt-gnu
--- a/src/c-file-ptr-stream.cc Mon Aug 08 21:30:36 2011 -0700 +++ b/src/c-file-ptr-stream.cc Tue Aug 09 22:16:06 2011 -0400 @@ -195,9 +195,7 @@ int c_file_ptr_buf::seek (long offset, int origin) { - // gnulib::fseek doesn't seem to work, so don't use it until problem - // can be properly diagnosed and fixed. - return f ? fseek (f, offset, origin) : -1; + return f ? gnulib::fseek (f, offset, origin) : -1; } long
--- a/src/file-io.cc Mon Aug 08 21:30:36 2011 -0700 +++ b/src/file-io.cc Tue Aug 09 22:16:06 2011 -0400 @@ -494,7 +494,7 @@ { tmode.erase (pos, 1); - FILE *fptr = ::fopen (fname.c_str (), tmode.c_str ()); + FILE *fptr = gnulib::fopen (fname.c_str (), tmode.c_str ()); int fd = fileno (fptr); @@ -509,7 +509,7 @@ else #endif { - FILE *fptr = ::fopen (fname.c_str (), tmode.c_str ()); + FILE *fptr = gnulib::fopen (fname.c_str (), tmode.c_str ()); retval = octave_stdiostream::create (fname, fptr, md, flt_fmt);
--- a/src/input.cc Mon Aug 08 21:30:36 2011 -0700 +++ b/src/input.cc Tue Aug 09 22:16:06 2011 -0400 @@ -428,7 +428,7 @@ FILE *instream = 0; if (name.length () > 0) - instream = fopen (name.c_str (), "rb"); + instream = gnulib::fopen (name.c_str (), "rb"); if (! instream && warn) warning ("%s: no such file or directory", name.c_str ());