aboutsummaryrefslogtreecommitdiff
path: root/libio/genops.c
diff options
context:
space:
mode:
Diffstat (limited to 'libio/genops.c')
-rw-r--r--libio/genops.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/libio/genops.c b/libio/genops.c
index 381c45fa5d..b1ae5afc50 100644
--- a/libio/genops.c
+++ b/libio/genops.c
@@ -285,8 +285,10 @@ int
__underflow (fp)
_IO_FILE *fp;
{
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
+#endif
if (fp->_mode == 0)
_IO_fwide (fp, -1);
@@ -315,8 +317,10 @@ int
__uflow (fp)
_IO_FILE *fp;
{
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
if (fp->_vtable_offset == 0 && _IO_fwide (fp, -1) != -1)
return EOF;
+#endif
if (fp->_mode == 0)
_IO_fwide (fp, -11);
@@ -580,6 +584,7 @@ _IO_no_init (fp, flags, orientation, wd, jmp)
_IO_lock_init (*fp->_lock);
#endif
fp->_mode = orientation;
+#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
if (orientation >= 0)
{
fp->_wide_data = wd;
@@ -597,6 +602,7 @@ _IO_no_init (fp, flags, orientation, wd, jmp)
fp->_wide_data->_wide_vtable = jmp;
}
+#endif
}
int
@@ -749,9 +755,12 @@ _IO_flush_all ()
struct _IO_FILE *fp;
for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
if (((fp->_mode < 0 && fp->_IO_write_ptr > fp->_IO_write_base)
+#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;
@@ -775,7 +784,9 @@ _IO_unbuffer_write ()
for (fp = (_IO_FILE *) _IO_list_all; fp; fp = fp->_chain)
if (! (fp->_flags & _IO_UNBUFFERED)
&& (! (fp->_flags & _IO_NO_WRITES)
- || (fp->_flags & _IO_IS_APPENDING)))
+ || (fp->_flags & _IO_IS_APPENDING))
+ /* Iff stream is un-orientated, it wasn't used. */
+ && fp->_mode != 0)
_IO_SETBUF (fp, NULL, 0);
}
@@ -1021,7 +1032,7 @@ _IO_default_write (fp, data, n)
return 0;
}
-size_t
+int
_IO_default_showmanyc (fp)
_IO_FILE *fp;
{