Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2013-06-19 19:58:50 +0400
committerCorinna Vinschen <corinna@vinschen.de>2013-06-19 19:58:50 +0400
commit82c19d335abd0ee957ad5c3167755a545521504a (patch)
tree6f334addf726d1047c0130a107ab1dcf75e1890b /newlib/libc
parent04f8f69cb711ae5ec609eda786b64bb0726fd5b4 (diff)
* acconfig.h (_UNBUF_STREAM_OPT): Undefine.
* newlib.hin (_UNBUF_STREAM_OPT): Undefine. * configure.in (--enable-newlib-unbuf-stream-opt): New option. * configure: Regenerate. * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on unbuffered stream files. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise. * README: Add description about the option. * newlib.hin (_UNBUF_STREAM_OPT): Undefine. * configure.in (--enable-newlib-unbuf-stream-opt): New option. * configure: Regenerate. * libc/stdio/vfprintf.c (_VFPRINTF_R): Don't do optimization on unbuffered stream files. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Likewise. * README: Add description about the option.
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/stdio/vfprintf.c4
-rw-r--r--newlib/libc/stdio/vfwprintf.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/stdio/vfprintf.c b/newlib/libc/stdio/vfprintf.c
index e5fcb0331..dd9c22a6d 100644
--- a/newlib/libc/stdio/vfprintf.c
+++ b/newlib/libc/stdio/vfprintf.c
@@ -447,6 +447,7 @@ int __sfputs_r (struct _reent *, FILE *, _CONST char *buf, size_t);
int __sprint_r (struct _reent *, FILE *, register struct __suio *);
#endif /* !INTEGER_ONLY */
+#ifdef _UNBUF_STREAM_OPT
/*
* Helper function for `fprintf to unbuffered unix file': creates a
* temporary buffer. We only work on write-only files; this avoids
@@ -492,6 +493,7 @@ _DEFUN(__sbprintf, (rptr, fp, fmt, ap),
#endif
return (ret);
}
+#endif /* _UNBUF_STREAM_OPT */
#endif /* !STRING_ONLY */
@@ -865,12 +867,14 @@ _DEFUN(_VFPRINTF_R, (data, fp, fmt0, ap),
return (EOF);
}
+#ifdef _UNBUF_STREAM_OPT
/* optimise fprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
fp->_file >= 0) {
_newlib_flockfile_exit (fp);
return (__sbprintf (data, fp, fmt0, ap));
}
+#endif
#else /* STRING_ONLY */
/* Create initial buffer if we are called by asprintf family. */
if (fp->_flags & __SMBF && !fp->_bf._base)
diff --git a/newlib/libc/stdio/vfwprintf.c b/newlib/libc/stdio/vfwprintf.c
index 5860147ec..4788add23 100644
--- a/newlib/libc/stdio/vfwprintf.c
+++ b/newlib/libc/stdio/vfwprintf.c
@@ -166,6 +166,7 @@ int _EXFUN(__SPRINT, (struct _reent *, FILE *, register struct __suio *));
int _EXFUN(__SPRINT, (struct _reent *, FILE *, _CONST char *, size_t));
#endif
#ifndef STRING_ONLY
+#ifdef _UNBUF_STREAM_OPT
/*
* Helper function for `fprintf to unbuffered unix file': creates a
* temporary buffer. We only work on write-only files; this avoids
@@ -209,6 +210,7 @@ _DEFUN(__sbwprintf, (rptr, fp, fmt, ap),
#endif
return (ret);
}
+#endif /* _UNBUF_STREAM_OPT */
#endif /* !STRING_ONLY */
@@ -599,12 +601,14 @@ _DEFUN(_VFWPRINTF_R, (data, fp, fmt0, ap),
return (EOF);
}
+#ifdef _UNBUF_STREAM_OPT
/* optimise fwprintf(stderr) (and other unbuffered Unix files) */
if ((fp->_flags & (__SNBF|__SWR|__SRW)) == (__SNBF|__SWR) &&
fp->_file >= 0) {
_newlib_flockfile_exit (fp);
return (__sbwprintf (data, fp, fmt0, ap));
}
+#endif
#else /* STRING_ONLY */
/* Create initial buffer if we are called by asprintf family. */
if (fp->_flags & __SMBF && !fp->_bf._base)