Commit d04703d6 by Benjamin Kosnik

C/C++ io merge/sync.


2000-08-14  Benjamin Kosnik  <bkoz@purist.soma.redhat.com>

	C/C++ io merge/sync.
	* libio/fileops.c
	* libio/genops.c
	* libio/iofclose.c
	* libio/iofopen.c
	* libio/iofwide.c
	* libio/libio.h
	* libio/libioP.h
	* libio/stdio.c
	* libio/wfileops.c
	* libio/wgenops.c
	* config/c_io_libio.cc (__basic_file): Add hacky casts to
	((struct _IO_FILE_plus *) in ctors.
	(__basic_file<wchar_t>): Adjust _wide_data->_codecvt to just _codecvt.
	* libio/Makefile.am: Fix copyright. Remove cleanup.c.
	* libio/cleanup.c: Remove.
	* libio/filedoalloc.c (_IO_file_doallocate): Don't call
	_IO_cleanup_registration_needed, even if not libc.

	* testsuite/27_io/stringstream.cc (test02): Fix.

From-SVN: r35694
parent 9f34e6e8
2000-08-14 Benjamin Kosnik <bkoz@purist.soma.redhat.com> 2000-08-14 Benjamin Kosnik <bkoz@purist.soma.redhat.com>
C/C++ io merge/sync.
* libio/fileops.c
* libio/genops.c
* libio/iofclose.c
* libio/iofopen.c
* libio/iofwide.c
* libio/libio.h
* libio/libioP.h
* libio/stdio.c
* libio/wfileops.c
* libio/wgenops.c
* config/c_io_libio.cc (__basic_file): Add hacky casts to
((struct _IO_FILE_plus *) in ctors.
(__basic_file<wchar_t>): Adjust _wide_data->_codecvt to just _codecvt.
* libio/Makefile.am: Fix copyright. Remove cleanup.c.
* libio/cleanup.c: Remove.
* libio/filedoalloc.c (_IO_file_doallocate): Don't call
_IO_cleanup_registration_needed, even if not libc.
* testsuite/27_io/stringstream.cc (test02): Fix. * testsuite/27_io/stringstream.cc (test02): Fix.
2000-08-14 Brent Verner <brent@rcfile.org> 2000-08-14 Brent Verner <brent@rcfile.org>
......
...@@ -206,7 +206,7 @@ namespace std { ...@@ -206,7 +206,7 @@ namespace std {
#endif #endif
// Don't set the orientation of the stream when initializing. // Don't set the orientation of the stream when initializing.
_IO_no_init(this, 0, 0, &_M_wfile, 0); _IO_no_init(this, 0, 0, &_M_wfile, 0);
_IO_JUMPS(this) = &_IO_file_jumps; _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_file_jumps;
_IO_file_init((_IO_FILE_plus*)this); _IO_file_init((_IO_FILE_plus*)this);
} }
...@@ -268,7 +268,7 @@ namespace std { ...@@ -268,7 +268,7 @@ namespace std {
#endif #endif
// Don't set the orientation of the stream when initializing. // Don't set the orientation of the stream when initializing.
_IO_no_init(this, 0, 0, &_M_wfile, &_IO_wfile_jumps); _IO_no_init(this, 0, 0, &_M_wfile, &_IO_wfile_jumps);
_IO_JUMPS(this) = &_IO_wfile_jumps; _IO_JUMPS((_IO_FILE_plus *) this) = &_IO_wfile_jumps;
_IO_file_init((_IO_FILE_plus*)this); _IO_file_init((_IO_FILE_plus*)this);
// In addition, need to allocate the buffer... // In addition, need to allocate the buffer...
...@@ -281,7 +281,7 @@ namespace std { ...@@ -281,7 +281,7 @@ namespace std {
_IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base); _IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base);
// Setup codecvt bits... // Setup codecvt bits...
_wide_data->_codecvt = __c_libio_codecvt; _codecvt = &__c_libio_codecvt;
// Do the same for narrow bits... // Do the same for narrow bits...
if (_IO_write_base == NULL) if (_IO_write_base == NULL)
......
...@@ -1863,7 +1863,7 @@ irix5* | irix6*) ...@@ -1863,7 +1863,7 @@ irix5* | irix6*)
;; ;;
# This must be Linux ELF. # This must be Linux ELF.
linux*) linux-gnu*)
case "$host_cpu" in case "$host_cpu" in
alpha* | i*86 | powerpc* | sparc* | ia64* ) alpha* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;; lt_cv_deplibs_check_method=pass_all ;;
...@@ -18136,15 +18136,12 @@ else ...@@ -18136,15 +18136,12 @@ else
#include <sys/types.h> #include <sys/types.h>
#include <fcntl.h> #include <fcntl.h>
#include <sys/mman.h> #include <sys/mman.h>
#include <stdlib.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
/* This mess was copied from the GNU getpagesize.h. */ /* This mess was copied from the GNU getpagesize.h. */
#ifndef HAVE_GETPAGESIZE #ifndef HAVE_GETPAGESIZE
# ifdef HAVE_UNISTD_H
# include <unistd.h>
# endif
/* Assume that all systems that can run configure have sys/param.h. */ /* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H # ifndef HAVE_SYS_PARAM_H
...@@ -18199,7 +18196,7 @@ main() ...@@ -18199,7 +18196,7 @@ main()
/* /*
* First, make a file with some known garbage in it. * First, make a file with some known garbage in it.
*/ */
data = (char*)malloc(pagesize); data = malloc(pagesize);
if (!data) if (!data)
exit(1); exit(1);
for (i = 0; i < pagesize; ++i) for (i = 0; i < pagesize; ++i)
...@@ -18220,7 +18217,7 @@ main() ...@@ -18220,7 +18217,7 @@ main()
fd = open("conftestmmap", O_RDWR); fd = open("conftestmmap", O_RDWR);
if (fd < 0) if (fd < 0)
exit(1); exit(1);
data2 = (char*)malloc(2 * pagesize); data2 = malloc(2 * pagesize);
if (!data2) if (!data2)
exit(1); exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
...@@ -18238,7 +18235,7 @@ main() ...@@ -18238,7 +18235,7 @@ main()
*/ */
for (i = 0; i < pagesize; ++i) for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1; *(data2 + i) = *(data2 + i) + 1;
data3 = (char*)malloc(pagesize); data3 = malloc(pagesize);
if (!data3) if (!data3)
exit(1); exit(1);
if (read(fd, data3, pagesize) != pagesize) if (read(fd, data3, pagesize) != pagesize)
...@@ -18252,7 +18249,7 @@ main() ...@@ -18252,7 +18249,7 @@ main()
} }
EOF EOF
if { (eval echo configure:18256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null if { (eval echo configure:18253: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then then
ac_cv_func_mmap_fixed_mapped=yes ac_cv_func_mmap_fixed_mapped=yes
else else
...@@ -18315,19 +18312,19 @@ fi ...@@ -18315,19 +18312,19 @@ fi
if test $ac_cv_header_locale_h = yes; then if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
echo "configure:18319: checking for LC_MESSAGES" >&5 echo "configure:18316: checking for LC_MESSAGES" >&5
if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then if eval "test \"`echo '$''{'ac_cv_val_LC_MESSAGES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6 echo $ac_n "(cached) $ac_c" 1>&6
else else
cat > conftest.$ac_ext <<EOF cat > conftest.$ac_ext <<EOF
#line 18324 "configure" #line 18321 "configure"
#include "confdefs.h" #include "confdefs.h"
#include <locale.h> #include <locale.h>
int main() { int main() {
return LC_MESSAGES return LC_MESSAGES
; return 0; } ; return 0; }
EOF EOF
if { (eval echo configure:18331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then if { (eval echo configure:18328: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest* rm -rf conftest*
ac_cv_val_LC_MESSAGES=yes ac_cv_val_LC_MESSAGES=yes
else else
......
2000-08-14 Benjamin Kosnik <bkoz@gnu.org>
* *: Merge with mainline glibc sources.
* filedoalloc.c (_IO_file_doallocate): Don't call
_IO_cleanup_registration_needed, even if not libc.
* iofwide.c (_IO_fwide): Correct placement of defines.
* cleanup.c: Remove.
2000-08-04 benjamin kosnik <bkoz@haight.constant.com> 2000-08-04 benjamin kosnik <bkoz@haight.constant.com>
* genops.c (_IO_unbuffer_write): Don't call _IO_SETBUF if the * genops.c (_IO_unbuffer_write): Don't call _IO_SETBUF if the
......
## Makefile for the libio subdirectory of the GNU C++ Standard library. ## Makefile for the libio subdirectory of the GNU C++ Standard library.
## ##
## Copyright (C) 1999, 2000 Cygnus Solutions ## Copyright (C) 1999, 2000 Free Software Foundation, Inc.
## ##
## This file is part of the libstdc++ version 3 distribution. ## This file is part of the libstdc++ version 3 distribution.
## Process this file with automake to produce Makefile.in. ## Process this file with automake to produce Makefile.in.
...@@ -64,14 +64,14 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \ ...@@ -64,14 +64,14 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) \
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@ LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
#includes =
libio_headers = \ libio_headers = \
libio.h libioP.h iolibio.h libio.h libioP.h iolibio.h
if GLIBCPP_NEED_LIBIO if GLIBCPP_NEED_LIBIO
LIBIO_SRCS = \ LIBIO_SRCS = \
filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c c_codecvt.c filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c
# filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c c_codecvt.c
else else
LIBIO_SRCS = LIBIO_SRCS =
endif endif
......
...@@ -142,11 +142,10 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) ...@@ -142,11 +142,10 @@ LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS)
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@ LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
#includes =
libio_headers = libio.h libioP.h iolibio.h libio_headers = libio.h libioP.h iolibio.h
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c c_codecvt.c # filedoalloc.c genops.c fileops.c stdfiles.c cleanup.c c_codecvt.c
@GLIBCPP_NEED_LIBIO_TRUE@LIBIO_SRCS = filedoalloc.c genops.c fileops.c stdfiles.c c_codecvt.c
@GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS = @GLIBCPP_NEED_LIBIO_FALSE@LIBIO_SRCS =
@GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c @GLIBCPP_NEED_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c
@GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS = @GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS =
...@@ -174,7 +173,6 @@ libio_la_LDFLAGS = ...@@ -174,7 +173,6 @@ libio_la_LDFLAGS =
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@c_codecvt.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@c_codecvt.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfiledoalloc.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfileops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfileops.lo \
...@@ -193,7 +191,6 @@ libio_la_LDFLAGS = ...@@ -193,7 +191,6 @@ libio_la_LDFLAGS =
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@c_codecvt.lo @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@c_codecvt.lo
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@libio_la_OBJECTS = \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_FALSE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \
...@@ -205,7 +202,6 @@ libio_la_LDFLAGS = ...@@ -205,7 +202,6 @@ libio_la_LDFLAGS =
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@genops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@c_codecvt.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@c_codecvt.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \ @GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.lo \
...@@ -224,7 +220,6 @@ libio_la_LDFLAGS = ...@@ -224,7 +220,6 @@ libio_la_LDFLAGS =
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@genops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@fileops.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@stdfiles.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@cleanup.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@c_codecvt.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@c_codecvt.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfiledoalloc.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfileops.lo \ @GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfileops.lo \
......
...@@ -75,15 +75,6 @@ _IO_file_doallocate (fp) ...@@ -75,15 +75,6 @@ _IO_file_doallocate (fp)
char *p; char *p;
struct _G_stat64 st; struct _G_stat64 st;
#ifndef _LIBC
/* If _IO_cleanup_registration_needed is non-zero, we should call the
function it points to. This is to make sure _IO_cleanup gets called
on exit. We call it from _IO_file_doallocate, since that is likely
to get called by any program that does buffered I/O. */
if (_IO_cleanup_registration_needed)
(*_IO_cleanup_registration_needed) ();
#endif
if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0) if (fp->_fileno < 0 || _IO_SYSSTAT (fp, &st) < 0)
{ {
couldbetty = 0; couldbetty = 0;
......
...@@ -305,7 +305,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64) ...@@ -305,7 +305,7 @@ _IO_new_file_fopen (fp, filename, mode, is32not64)
return NULL; return NULL;
} }
cc = &fp->_wide_data->_codecvt; cc = fp->_codecvt = &fp->_wide_data->_codecvt;
/* The functions are always the same. */ /* The functions are always the same. */
*cc = __libio_codecvt; *cc = __libio_codecvt;
......
...@@ -758,8 +758,9 @@ _IO_flush_all () ...@@ -758,8 +758,9 @@ _IO_flush_all ()
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
|| (fp->_vtable_offset == 0 || (fp->_vtable_offset == 0
&& fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr && fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
> fp->_wide_data->_IO_write_base))) > fp->_wide_data->_IO_write_base))
#endif #endif
)
&& _IO_OVERFLOW (fp, EOF) == EOF) && _IO_OVERFLOW (fp, EOF) == EOF)
result = EOF; result = EOF;
return result; return result;
...@@ -983,9 +984,11 @@ _IO_default_pbackfail (fp, c) ...@@ -983,9 +984,11 @@ _IO_default_pbackfail (fp, c)
new_buf = (char *) malloc (new_size); new_buf = (char *) malloc (new_size);
if (new_buf == NULL) if (new_buf == NULL)
return EOF; return EOF;
memcpy (new_buf + old_size, fp->_IO_read_base, old_size); memcpy (new_buf + (new_size - old_size), fp->_IO_read_base,
old_size);
free (fp->_IO_read_base); free (fp->_IO_read_base);
_IO_setg (fp, new_buf, new_buf + old_size, new_buf + new_size); _IO_setg (fp, new_buf, new_buf + (new_size - old_size),
new_buf + new_size);
fp->_IO_backup_base = fp->_IO_read_ptr; fp->_IO_backup_base = fp->_IO_read_ptr;
} }
......
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
# include <shlib-compat.h> # include <shlib-compat.h>
#else #else
# define SHLIB_COMPAT(a, b, c) 0 # define SHLIB_COMPAT(a, b, c) 0
# define _IO_new_fclose fclose
#endif #endif
int int
...@@ -63,7 +64,7 @@ _IO_new_fclose (fp) ...@@ -63,7 +64,7 @@ _IO_new_fclose (fp)
#if _LIBC #if _LIBC
/* This stream has a wide orientation. This means we have to free /* This stream has a wide orientation. This means we have to free
the conversion functions. */ the conversion functions. */
struct _IO_codecvt *cc = &fp->_wide_data->_codecvt; struct _IO_codecvt *cc = fp->_codecvt;
if (cc->__cd_in.__cd.__steps->__shlib_handle != NULL) if (cc->__cd_in.__cd.__steps->__shlib_handle != NULL)
{ {
...@@ -93,6 +94,4 @@ _IO_new_fclose (fp) ...@@ -93,6 +94,4 @@ _IO_new_fclose (fp)
versioned_symbol (libc, _IO_new_fclose, _IO_fclose, GLIBC_2_1); versioned_symbol (libc, _IO_new_fclose, _IO_fclose, GLIBC_2_1);
strong_alias (_IO_new_fclose, __new_fclose) strong_alias (_IO_new_fclose, __new_fclose)
versioned_symbol (libc, __new_fclose, fclose, GLIBC_2_1); versioned_symbol (libc, __new_fclose, fclose, GLIBC_2_1);
#else
int fclose (_IO_FILE *) __attribute__ ((alias("_IO_new_fclose")));
#endif #endif
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
#endif #endif
#ifdef _LIBC #ifdef _LIBC
# include <shlib-compat.h> # include <shlib-compat.h>
#else
# define _IO_new_fopen fopen
#endif #endif
_IO_FILE * _IO_FILE *
...@@ -71,7 +73,4 @@ _IO_new_fopen (filename, mode) ...@@ -71,7 +73,4 @@ _IO_new_fopen (filename, mode)
strong_alias (_IO_new_fopen, __new_fopen) strong_alias (_IO_new_fopen, __new_fopen)
versioned_symbol (libc, _IO_new_fopen, _IO_fopen, GLIBC_2_1); versioned_symbol (libc, _IO_new_fopen, _IO_fopen, GLIBC_2_1);
versioned_symbol (libc, __new_fopen, fopen, GLIBC_2_1); versioned_symbol (libc, __new_fopen, fopen, GLIBC_2_1);
#else
int fopen (const char *,const char *)
__attribute__ ((alias("_IO_new_fopen")));
#endif #endif
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
# include <iconv/gconv_int.h> # include <iconv/gconv_int.h>
#endif #endif
/* Prototypes of libio's codecvt functions. */ /* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt, static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__mbstate_t *statep, __mbstate_t *statep,
...@@ -76,14 +77,14 @@ struct _IO_codecvt __libio_codecvt = ...@@ -76,14 +77,14 @@ struct _IO_codecvt __libio_codecvt =
}; };
/* static struct __gconv_trans_data libio_translit =*/
#ifdef _LIBC #ifdef _LIBC
struct __gconv_trans_data libio_translit = static struct __gconv_trans_data libio_translit =
{ {
.__trans_fct = __gconv_transliterate .__trans_fct = __gconv_transliterate
}; };
#endif #endif
/* Return orientation of stream. If mode is nonzero try to change /* Return orientation of stream. If mode is nonzero try to change
the orientation first. */ the orientation first. */
#undef _IO_fwide #undef _IO_fwide
...@@ -103,15 +104,12 @@ _IO_fwide (fp, mode) ...@@ -103,15 +104,12 @@ _IO_fwide (fp, mode)
/* Set the orientation appropriately. */ /* Set the orientation appropriately. */
if (mode > 0) if (mode > 0)
{ {
struct _IO_codecvt *cc = &fp->_wide_data->_codecvt; struct _IO_codecvt *cc = fp->_codecvt;
fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end; fp->_wide_data->_IO_read_ptr = fp->_wide_data->_IO_read_end;
fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_base; fp->_wide_data->_IO_write_ptr = fp->_wide_data->_IO_write_base;
#ifdef _LIBC #ifdef _LIBC
/* The functions are always the same. */
*cc = __libio_codecvt;
/* Get the character conversion functions based on the currently /* Get the character conversion functions based on the currently
selected locale for LC_CTYPE. */ selected locale for LC_CTYPE. */
{ {
...@@ -123,6 +121,9 @@ _IO_fwide (fp, mode) ...@@ -123,6 +121,9 @@ _IO_fwide (fp, mode)
__wcsmbs_clone_conv (&fcts); __wcsmbs_clone_conv (&fcts);
/* The functions are always the same. */
*cc = __libio_codecvt;
cc->__cd_in.__cd.__nsteps = 1; /* Only one step allowed. */ cc->__cd_in.__cd.__nsteps = 1; /* Only one step allowed. */
cc->__cd_in.__cd.__steps = fcts.towc; cc->__cd_in.__cd.__steps = fcts.towc;
...@@ -142,18 +143,13 @@ _IO_fwide (fp, mode) ...@@ -142,18 +143,13 @@ _IO_fwide (fp, mode)
cc->__cd_out.__cd.__data[0].__flags = __GCONV_IS_LAST; cc->__cd_out.__cd.__data[0].__flags = __GCONV_IS_LAST;
cc->__cd_out.__cd.__data[0].__statep = &fp->_wide_data->_IO_state; cc->__cd_out.__cd.__data[0].__statep = &fp->_wide_data->_IO_state;
/* XXX For now no transliteration. */ /* And now the transliteration. */
#ifdef _LIBC
cc->__cd_out.__cd.__data[0].__trans = &libio_translit; cc->__cd_out.__cd.__data[0].__trans = &libio_translit;
#else
cc->__cd_out.__cd.__data[0].__trans = NULL;
#endif
} }
#else #else
# ifdef _GLIBCPP_USE_WCHAR_T # ifdef _GLIBCPP_USE_WCHAR_T
{ {
/* Determine internal and external character sets. /* Determine internal and external character sets.
XXX For now we make our life easy: we assume a fixed internal XXX For now we make our life easy: we assume a fixed internal
encoding (as most sane systems have; hi HP/UX!). If somebody encoding (as most sane systems have; hi HP/UX!). If somebody
cares about systems which changing internal charsets they cares about systems which changing internal charsets they
...@@ -195,6 +191,7 @@ _IO_fwide (fp, mode) ...@@ -195,6 +191,7 @@ _IO_fwide (fp, mode)
weak_alias (_IO_fwide, fwide) weak_alias (_IO_fwide, fwide)
#endif #endif
static enum __codecvt_result static enum __codecvt_result
do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end, const wchar_t *from_start, const wchar_t *from_end,
...@@ -239,7 +236,6 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -239,7 +236,6 @@ do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
} }
#else #else
# ifdef _GLIBCPP_USE_WCHAR_T # ifdef _GLIBCPP_USE_WCHAR_T
size_t res; size_t res;
const char *from_start_copy = (const char *) from_start; const char *from_start_copy = (const char *) from_start;
size_t from_len = from_end - from_start; size_t from_len = from_end - from_start;
...@@ -309,7 +305,7 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -309,7 +305,7 @@ do_unshift (struct _IO_codecvt *codecvt, __mbstate_t *statep,
size_t to_len = to_end - to_start; size_t to_len = to_end - to_start;
res = iconv (codecvt->__cd_out, NULL, NULL, &to_start_copy, &to_len); res = iconv (codecvt->__cd_out, NULL, NULL, &to_start_copy, &to_len);
if (res == 0) if (res == 0)
result = __codecvt_ok; result = __codecvt_ok;
else if (to_len < codecvt->__codecvt_do_max_length (codecvt)) else if (to_len < codecvt->__codecvt_do_max_length (codecvt))
...@@ -376,7 +372,7 @@ do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -376,7 +372,7 @@ do_in (struct _IO_codecvt *codecvt, __mbstate_t *statep,
res = iconv (codecvt->__cd_in, &from_start_copy, &from_len, res = iconv (codecvt->__cd_in, &from_start_copy, &from_len,
&to_start_copy, &to_len); &to_start_copy, &to_len);
if (res == 0) if (res == 0)
result = __codecvt_ok; result = __codecvt_ok;
else if (to_len == 0) else if (to_len == 0)
...@@ -455,7 +451,7 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep, ...@@ -455,7 +451,7 @@ do_length (struct _IO_codecvt *codecvt, __mbstate_t *statep,
res = iconv (codecvt->__cd_in, &from_start_copy, &from_len, res = iconv (codecvt->__cd_in, &from_start_copy, &from_len,
&to_start, &max); &to_start, &max);
result = from_start_copy - (char *) from_start; result = from_start_copy - (char *) from_start;
# else # else
/* Decide what to do. */ /* Decide what to do. */
...@@ -476,10 +472,3 @@ do_max_length (struct _IO_codecvt *codecvt) ...@@ -476,10 +472,3 @@ do_max_length (struct _IO_codecvt *codecvt)
return MB_CUR_MAX; return MB_CUR_MAX;
#endif #endif
} }
...@@ -227,7 +227,6 @@ struct _IO_codecvt ...@@ -227,7 +227,6 @@ struct _IO_codecvt
_IO_iconv_t __cd_in; _IO_iconv_t __cd_in;
_IO_iconv_t __cd_out; _IO_iconv_t __cd_out;
}; };
#endif
/* Extra data for wide character streams. */ /* Extra data for wide character streams. */
struct _IO_wide_data struct _IO_wide_data
...@@ -249,8 +248,8 @@ struct _IO_wide_data ...@@ -249,8 +248,8 @@ struct _IO_wide_data
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T #if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
__mbstate_t _IO_state; __mbstate_t _IO_state;
__mbstate_t _IO_last_state; __mbstate_t _IO_last_state;
struct _IO_codecvt _codecvt;
#endif #endif
struct _IO_codecvt _codecvt;
wchar_t _shortbuf[1]; wchar_t _shortbuf[1];
...@@ -258,6 +257,7 @@ struct _IO_wide_data ...@@ -258,6 +257,7 @@ struct _IO_wide_data
struct _IO_jump_t *_wide_vtable; struct _IO_jump_t *_wide_vtable;
#endif #endif
}; };
#endif
struct _IO_FILE { struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */ int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
...@@ -496,5 +496,3 @@ extern void _IO_free_wbackup_area (_IO_FILE *) __THROW; ...@@ -496,5 +496,3 @@ extern void _IO_free_wbackup_area (_IO_FILE *) __THROW;
#endif #endif
#endif /* _IO_STDIO_H */ #endif /* _IO_STDIO_H */
...@@ -69,13 +69,13 @@ extern "C" { ...@@ -69,13 +69,13 @@ extern "C" {
# define _IO_JUMPS_OFFSET 1 # define _IO_JUMPS_OFFSET 1
#endif #endif
#define _IO_JUMPS(THIS) ((struct _IO_FILE_plus *) (THIS))->vtable #define _IO_JUMPS(THIS) (THIS)->vtable
#define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable #define _IO_WIDE_JUMPS(THIS) ((struct _IO_FILE *) (THIS))->_wide_data->_wide_vtable
#define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL) #define _IO_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL)
#if _IO_JUMPS_OFFSET #if _IO_JUMPS_OFFSET
# define _IO_JUMPS_FUNC(THIS) \ # define _IO_JUMPS_FUNC(THIS) \
(*(struct _IO_jump_t **) ((char *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \ (*(struct _IO_jump_t **) ((void *) &_IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) \
+ (THIS)->_vtable_offset)) + (THIS)->_vtable_offset))
#else #else
# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS)) # define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS))
...@@ -714,19 +714,19 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list)); ...@@ -714,19 +714,19 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list));
# ifdef _IO_USE_OLD_IO_FILE # ifdef _IO_USE_OLD_IO_FILE
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock } 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock }
# else # else
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\ 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\
NULL, WDP, 0 } NULL, WDP, 0 }
# else # else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\ 0, _IO_pos_BAD, 0, 0, { 0 }, &_IO_stdfile_##FD##_lock, _IO_pos_BAD,\
0 } 0 }
# endif # endif
...@@ -741,13 +741,13 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list)); ...@@ -741,13 +741,13 @@ extern int _IO_vscanf __P ((const char *, _IO_va_list));
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T # if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \ 0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \
NULL, WDP, 0 } NULL, WDP, 0 }
# else # else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \ # define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \ { _IO_MAGIC+_IO_LINKED+_IO_IS_FILEBUF+FLAGS, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (_IO_FILE *) CHAIN, FD, \
0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \ 0, _IO_pos_BAD, 0, 0, { 0 }, 0, _IO_pos_BAD, \
0 } 0 }
# endif # endif
......
...@@ -24,13 +24,14 @@ ...@@ -24,13 +24,14 @@
General Public License. */ General Public License. */
#include "libioP.h" #include "libioP.h"
#include "stdio.h"
#undef stdin #undef stdin
#undef stdout #undef stdout
#undef stderr #undef stderr
_IO_FILE *stdin = (_IO_FILE *) &_IO_2_1_stdin_; _IO_FILE *stdin = (FILE *) &_IO_2_1_stdin_;
_IO_FILE *stdout = (_IO_FILE *) &_IO_2_1_stdout_; _IO_FILE *stdout = (FILE *) &_IO_2_1_stdout_;
_IO_FILE *stderr = (_IO_FILE *) &_IO_2_1_stderr_; _IO_FILE *stderr = (FILE *) &_IO_2_1_stderr_;
#undef _IO_stdin #undef _IO_stdin
#undef _IO_stdout #undef _IO_stdout
......
...@@ -76,7 +76,7 @@ _IO_wdo_write (fp, data, to_do) ...@@ -76,7 +76,7 @@ _IO_wdo_write (fp, data, to_do)
const wchar_t *data; const wchar_t *data;
_IO_size_t to_do; _IO_size_t to_do;
{ {
struct _IO_codecvt *cc = &fp->_wide_data->_codecvt; struct _IO_codecvt *cc = fp->_codecvt;
if (to_do > 0) if (to_do > 0)
{ {
...@@ -150,7 +150,7 @@ _IO_wfile_underflow (fp) ...@@ -150,7 +150,7 @@ _IO_wfile_underflow (fp)
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end) if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr; return *fp->_wide_data->_IO_read_ptr;
cd = &fp->_wide_data->_codecvt; cd = fp->_codecvt;
/* Maybe there is something left in the external buffer. */ /* Maybe there is something left in the external buffer. */
if (fp->_IO_read_ptr < fp->_IO_read_end) if (fp->_IO_read_ptr < fp->_IO_read_end)
...@@ -379,7 +379,7 @@ _IO_wfile_sync (fp) ...@@ -379,7 +379,7 @@ _IO_wfile_sync (fp)
{ {
/* We have to find out how many bytes we have to go back in the /* We have to find out how many bytes we have to go back in the
external buffer. */ external buffer. */
struct _IO_codecvt *cv = &fp->_wide_data->_codecvt; struct _IO_codecvt *cv = fp->_codecvt;
_IO_off64_t new_pos; _IO_off64_t new_pos;
int clen = (*cv->__codecvt_do_encoding) (cv); int clen = (*cv->__codecvt_do_encoding) (cv);
...@@ -483,7 +483,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode) ...@@ -483,7 +483,7 @@ _IO_wfile_seekoff (fp, offset, dir, mode)
/* Adjust for read-ahead (bytes is buffer). To do this we must /* Adjust for read-ahead (bytes is buffer). To do this we must
find out which position in the external buffer corresponds to find out which position in the external buffer corresponds to
the current position in the internal buffer. */ the current position in the internal buffer. */
cv = &fp->_wide_data->_codecvt; cv = fp->_codecvt;
clen = (*cv->__codecvt_do_encoding) (cv); clen = (*cv->__codecvt_do_encoding) (cv);
if (clen > 0) if (clen > 0)
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
# define __wmemcpy(dst, src, n) wmemcpy (dst, src, n) # define __wmemcpy(dst, src, n) wmemcpy (dst, src, n)
#endif #endif
static int save_for_wbackup __P ((_IO_FILE *fp, wchar_t *end_p)) static int save_for_wbackup __P ((_IO_FILE *fp, wchar_t *end_p))
#ifdef _LIBC #ifdef _LIBC
internal_function internal_function
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment