From 36ac7bee0f6b0be35eafd74e0fc865edd2352197 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 9 Apr 2008 19:51:18 +0000 Subject: Factor out the core of vprintf() into separate function vprintf_internal, so that: * vprintf() does locking and __STDIO_STREAM_TRANS_TO_WRITE thing, then calls vprintf_internal * vsnprintf, vdprintf.c, vasprintf.c use vprintf_internal directly This makes sprintf faster (since it doesn't do any locking) and stops it from pulling in fseek in static compile. --- libc/stdio/_stdio.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libc/stdio/_stdio.h') diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 74b891a03..e1fc26785 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -15,6 +15,7 @@ #include #include #include +#include #include #ifdef __UCLIBC_HAS_WCHAR__ #include @@ -430,6 +431,18 @@ extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n, FILE *__restrict stream) attribute_hidden; #endif +/**********************************************************************/ + +extern int _vfprintf_internal (FILE * __restrict stream, + register const char * __restrict format, + va_list arg) attribute_hidden; + +#ifdef __UCLIBC_HAS_WCHAR__ +extern int _vfwprintf_internal (FILE * __restrict stream, + register const wchar_t * __restrict format, + va_list arg) attribute_hidden; +#endif + /**********************************************************************/ /* Only use the macro below if you know fp is a valid FILE for a valid fd. * This is _not_ true for custom streams! */ -- cgit v1.2.3