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.
2000-08-14 Brent Verner <brent@rcfile.org>
#endif
// Don't set the orientation of the stream when initializing.
_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);
}
#endif
// Don't set the orientation of the stream when initializing.
_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);
// In addition, need to allocate the buffer...
_IO_wsetp(this, _wide_data->_IO_buf_base, _wide_data->_IO_buf_base);
// Setup codecvt bits...
- _wide_data->_codecvt = __c_libio_codecvt;
+ _codecvt = &__c_libio_codecvt;
// Do the same for narrow bits...
if (_IO_write_base == NULL)
;;
# This must be Linux ELF.
-linux*)
+linux-gnu*)
case "$host_cpu" in
alpha* | i*86 | powerpc* | sparc* | ia64* )
lt_cv_deplibs_check_method=pass_all ;;
#include <sys/types.h>
#include <fcntl.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. */
#ifndef HAVE_GETPAGESIZE
+# ifdef HAVE_UNISTD_H
+# include <unistd.h>
+# endif
/* Assume that all systems that can run configure have sys/param.h. */
# ifndef HAVE_SYS_PARAM_H
/*
* First, make a file with some known garbage in it.
*/
- data = (char*)malloc(pagesize);
+ data = malloc(pagesize);
if (!data)
exit(1);
for (i = 0; i < pagesize; ++i)
fd = open("conftestmmap", O_RDWR);
if (fd < 0)
exit(1);
- data2 = (char*)malloc(2 * pagesize);
+ data2 = malloc(2 * pagesize);
if (!data2)
exit(1);
data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1);
*/
for (i = 0; i < pagesize; ++i)
*(data2 + i) = *(data2 + i) + 1;
- data3 = (char*)malloc(pagesize);
+ data3 = malloc(pagesize);
if (!data3)
exit(1);
if (read(fd, data3, pagesize) != pagesize)
}
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
ac_cv_func_mmap_fixed_mapped=yes
else
if test $ac_cv_header_locale_h = yes; then
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
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 18324 "configure"
+#line 18321 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
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*
ac_cv_val_LC_MESSAGES=yes
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>
* genops.c (_IO_unbuffer_write): Don't call _IO_SETBUF if the
## 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.
## Process this file with automake to produce Makefile.in.
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
-#includes =
libio_headers = \
libio.h libioP.h iolibio.h
if GLIBCPP_NEED_LIBIO
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
LIBIO_SRCS =
endif
LINK = $(LIBTOOL) --mode=link "$(CCLD)" $(CFLAGS) $(AM_CFLAGS) $(LDFLAGS) -o $@
-#includes =
-
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_WLIBIO_TRUE@LIBIO_WSRCS = wfiledoalloc.c wfileops.c wgenops.c
@GLIBCPP_NEED_WLIBIO_FALSE@LIBIO_WSRCS =
@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@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@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@wfileops.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@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_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_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@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@iofwide.lo \
@GLIBCPP_NEED_WLIBIO_FALSE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_TRUE@iofclose.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@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@wfiledoalloc.lo \
@GLIBCPP_NEED_WLIBIO_TRUE@@GLIBCPP_NEED_LIBIO_TRUE@@GLIBCPP_NEED_XTRA_LIBIO_FALSE@wfileops.lo \
char *p;
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)
{
couldbetty = 0;
return NULL;
}
- cc = &fp->_wide_data->_codecvt;
+ cc = fp->_codecvt = &fp->_wide_data->_codecvt;
/* The functions are always the same. */
*cc = __libio_codecvt;
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
|| (fp->_vtable_offset == 0
&& fp->_mode > 0 && (fp->_wide_data->_IO_write_ptr
- > fp->_wide_data->_IO_write_base)))
+ > fp->_wide_data->_IO_write_base))
#endif
+ )
&& _IO_OVERFLOW (fp, EOF) == EOF)
result = EOF;
return result;
new_buf = (char *) malloc (new_size);
if (new_buf == NULL)
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);
- _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;
}
# include <shlib-compat.h>
#else
# define SHLIB_COMPAT(a, b, c) 0
+# define _IO_new_fclose fclose
#endif
int
#if _LIBC
/* This stream has a wide orientation. This means we have to free
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)
{
versioned_symbol (libc, _IO_new_fclose, _IO_fclose, GLIBC_2_1);
strong_alias (_IO_new_fclose, __new_fclose)
versioned_symbol (libc, __new_fclose, fclose, GLIBC_2_1);
-#else
-int fclose (_IO_FILE *) __attribute__ ((alias("_IO_new_fclose")));
#endif
#endif
#ifdef _LIBC
# include <shlib-compat.h>
+#else
+# define _IO_new_fopen fopen
#endif
_IO_FILE *
strong_alias (_IO_new_fopen, __new_fopen)
versioned_symbol (libc, _IO_new_fopen, _IO_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
# include <iconv/gconv_int.h>
#endif
+
/* Prototypes of libio's codecvt functions. */
static enum __codecvt_result do_out (struct _IO_codecvt *codecvt,
__mbstate_t *statep,
};
-/* static struct __gconv_trans_data libio_translit =*/
#ifdef _LIBC
-struct __gconv_trans_data libio_translit =
+static struct __gconv_trans_data libio_translit =
{
.__trans_fct = __gconv_transliterate
};
#endif
+
/* Return orientation of stream. If mode is nonzero try to change
the orientation first. */
#undef _IO_fwide
/* Set the orientation appropriately. */
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_write_ptr = fp->_wide_data->_IO_write_base;
#ifdef _LIBC
- /* The functions are always the same. */
- *cc = __libio_codecvt;
-
/* Get the character conversion functions based on the currently
selected locale for LC_CTYPE. */
{
__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.__steps = fcts.towc;
cc->__cd_out.__cd.__data[0].__flags = __GCONV_IS_LAST;
cc->__cd_out.__cd.__data[0].__statep = &fp->_wide_data->_IO_state;
- /* XXX For now no transliteration. */
-#ifdef _LIBC
+ /* And now the transliteration. */
cc->__cd_out.__cd.__data[0].__trans = &libio_translit;
-#else
- cc->__cd_out.__cd.__data[0].__trans = NULL;
-#endif
}
#else
# ifdef _GLIBCPP_USE_WCHAR_T
{
/* Determine internal and external character sets.
-
XXX For now we make our life easy: we assume a fixed internal
encoding (as most sane systems have; hi HP/UX!). If somebody
cares about systems which changing internal charsets they
weak_alias (_IO_fwide, fwide)
#endif
+
static enum __codecvt_result
do_out (struct _IO_codecvt *codecvt, __mbstate_t *statep,
const wchar_t *from_start, const wchar_t *from_end,
}
#else
# ifdef _GLIBCPP_USE_WCHAR_T
-
size_t res;
const char *from_start_copy = (const char *) from_start;
size_t from_len = from_end - from_start;
size_t to_len = to_end - to_start;
res = iconv (codecvt->__cd_out, NULL, NULL, &to_start_copy, &to_len);
-
+
if (res == 0)
result = __codecvt_ok;
else if (to_len < codecvt->__codecvt_do_max_length (codecvt))
res = iconv (codecvt->__cd_in, &from_start_copy, &from_len,
&to_start_copy, &to_len);
-
+
if (res == 0)
result = __codecvt_ok;
else if (to_len == 0)
res = iconv (codecvt->__cd_in, &from_start_copy, &from_len,
&to_start, &max);
-
+
result = from_start_copy - (char *) from_start;
# else
/* Decide what to do. */
return MB_CUR_MAX;
#endif
}
-
-
-
-
-
-
-
_IO_iconv_t __cd_in;
_IO_iconv_t __cd_out;
};
-#endif
/* Extra data for wide character streams. */
struct _IO_wide_data
#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
__mbstate_t _IO_state;
__mbstate_t _IO_last_state;
- struct _IO_codecvt _codecvt;
#endif
+ struct _IO_codecvt _codecvt;
wchar_t _shortbuf[1];
struct _IO_jump_t *_wide_vtable;
#endif
};
+#endif
struct _IO_FILE {
int _flags; /* High-order word is _IO_MAGIC; rest is flags. */
#endif
#endif /* _IO_STDIO_H */
-
-
# define _IO_JUMPS_OFFSET 1
#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_CHECK_WIDE(THIS) (((struct _IO_FILE *) (THIS))->_wide_data != NULL)
#if _IO_JUMPS_OFFSET
# 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))
#else
# define _IO_JUMPS_FUNC(THIS) _IO_JUMPS ((struct _IO_FILE_plus *) (THIS))
# ifdef _IO_USE_OLD_IO_FILE
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _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 }
# else
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _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,\
NULL, WDP, 0 }
# else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _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 }
# endif
# if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _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, \
NULL, WDP, 0 }
# else
# define FILEBUF_LITERAL(CHAIN, FLAGS, FD, WDP) \
{ _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 }
# endif
General Public License. */
#include "libioP.h"
+#include "stdio.h"
#undef stdin
#undef stdout
#undef stderr
-_IO_FILE *stdin = (_IO_FILE *) &_IO_2_1_stdin_;
-_IO_FILE *stdout = (_IO_FILE *) &_IO_2_1_stdout_;
-_IO_FILE *stderr = (_IO_FILE *) &_IO_2_1_stderr_;
+_IO_FILE *stdin = (FILE *) &_IO_2_1_stdin_;
+_IO_FILE *stdout = (FILE *) &_IO_2_1_stdout_;
+_IO_FILE *stderr = (FILE *) &_IO_2_1_stderr_;
#undef _IO_stdin
#undef _IO_stdout
const wchar_t *data;
_IO_size_t to_do;
{
- struct _IO_codecvt *cc = &fp->_wide_data->_codecvt;
+ struct _IO_codecvt *cc = fp->_codecvt;
if (to_do > 0)
{
if (fp->_wide_data->_IO_read_ptr < fp->_wide_data->_IO_read_end)
return *fp->_wide_data->_IO_read_ptr;
- cd = &fp->_wide_data->_codecvt;
+ cd = fp->_codecvt;
/* Maybe there is something left in the external buffer. */
if (fp->_IO_read_ptr < fp->_IO_read_end)
{
/* We have to find out how many bytes we have to go back in the
external buffer. */
- struct _IO_codecvt *cv = &fp->_wide_data->_codecvt;
+ struct _IO_codecvt *cv = fp->_codecvt;
_IO_off64_t new_pos;
int clen = (*cv->__codecvt_do_encoding) (cv);
/* Adjust for read-ahead (bytes is buffer). To do this we must
find out which position in the external buffer corresponds to
the current position in the internal buffer. */
- cv = &fp->_wide_data->_codecvt;
+ cv = fp->_codecvt;
clen = (*cv->__codecvt_do_encoding) (cv);
if (clen > 0)
# define __wmemcpy(dst, src, n) wmemcpy (dst, src, n)
#endif
+
static int save_for_wbackup __P ((_IO_FILE *fp, wchar_t *end_p))
#ifdef _LIBC
internal_function