svn commit: trunk/uClibc/libc/stdio
vda at uclibc.org
vda at uclibc.org
Wed Apr 9 22:22:28 UTC 2008
Author: vda
Date: 2008-04-09 15:22:28 -0700 (Wed, 09 Apr 2008)
New Revision: 21686
Log:
fix breakage in old_vfprintf case
Modified:
trunk/uClibc/libc/stdio/vdprintf.c
trunk/uClibc/libc/stdio/vsnprintf.c
trunk/uClibc/libc/stdio/vswprintf.c
Changeset:
Modified: trunk/uClibc/libc/stdio/vdprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vdprintf.c 2008-04-09 21:51:33 UTC (rev 21685)
+++ trunk/uClibc/libc/stdio/vdprintf.c 2008-04-09 22:22:28 UTC (rev 21686)
@@ -11,6 +11,9 @@
#include "_stdio.h"
#include <stdarg.h>
+#ifdef __USE_OLD_VFPRINTF__
+libc_hidden_proto(vfprintf)
+#endif
libc_hidden_proto(fflush_unlocked)
libc_hidden_proto(vdprintf)
@@ -49,13 +52,17 @@
/* _vfprintf_internal doesn't do any locking, locking init is here
* only because of fflush_unlocked. TODO? */
-#ifdef __UCLIBC_HAS_THREADS__
+#if (defined(__STDIO_BUFFERS) || defined(__USE_OLD_VFPRINTF__)) && defined(__UCLIBC_HAS_THREADS__)
f.__user_locking = 1; /* Set user locking. */
__stdio_init_mutex(&f.__lock);
#endif
f.__nextopen = NULL;
+#ifdef __USE_OLD_VFPRINTF__
+ rv = vfprintf(&f, format, arg);
+#else
rv = _vfprintf_internal(&f, format, arg);
+#endif
#ifdef __STDIO_BUFFERS
/* If not buffering, then fflush is unnecessary. */
Modified: trunk/uClibc/libc/stdio/vsnprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vsnprintf.c 2008-04-09 21:51:33 UTC (rev 21685)
+++ trunk/uClibc/libc/stdio/vsnprintf.c 2008-04-09 22:22:28 UTC (rev 21686)
@@ -10,12 +10,18 @@
libc_hidden_proto(vsnprintf)
+#ifdef __USE_OLD_VFPRINTF__
+libc_hidden_proto(vfprintf)
+#endif
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning WISHLIST: Implement vsnprintf for non-buffered and no custom stream case.
#endif /* __UCLIBC_MJN3_ONLY__ */
#ifdef __STDIO_BUFFERS
+/* NB: __USE_OLD_VFPRINTF__ is not defined in this case */
+
int vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
Modified: trunk/uClibc/libc/stdio/vswprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vswprintf.c 2008-04-09 21:51:33 UTC (rev 21685)
+++ trunk/uClibc/libc/stdio/vswprintf.c 2008-04-09 22:22:28 UTC (rev 21686)
@@ -11,6 +11,10 @@
libc_hidden_proto(vswprintf)
+#ifdef __USE_OLD_VFPRINTF__
+libc_hidden_proto(vfwprintf)
+#endif
+
#ifndef __STDIO_BUFFERS
#warning Skipping vswprintf since no buffering!
#else /* __STDIO_BUFFERS */
@@ -38,6 +42,10 @@
__INIT_MBSTATE(&(f.__state));
#endif /* __STDIO_MBSTATE */
+#if defined(__USE_OLD_VFPRINTF__) && defined(__UCLIBC_HAS_THREADS__)
+ f.__user_locking = 1; /* Set user locking. */
+ __stdio_init_mutex(&f.__lock);
+#endif
f.__nextopen = NULL;
if (size > ((SIZE_MAX - (size_t) buf)/sizeof(wchar_t))) {
@@ -50,7 +58,11 @@
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_DISABLE_PUTC(&f);
+#ifdef __USE_OLD_VFPRINTF__
+ rv = vfwprintf(&f, format, arg);
+#else
rv = _vfwprintf_internal(&f, format, arg);
+#endif
/* NOTE: Return behaviour differs from snprintf... */
if (f.__bufpos == f.__bufend) {
More information about the uClibc-cvs
mailing list