svn commit: trunk/uClibc/libc/stdio
psm at uclibc.org
psm at uclibc.org
Fri Dec 9 13:52:17 UTC 2005
Author: psm
Date: 2005-12-09 05:52:08 -0800 (Fri, 09 Dec 2005)
New Revision: 12778
Log:
Implement all needed hidden *printf and correct vasprintf, thx blindvt
Modified:
trunk/uClibc/libc/stdio/_stdio.h
trunk/uClibc/libc/stdio/fprintf.c
trunk/uClibc/libc/stdio/old_vfprintf.c
trunk/uClibc/libc/stdio/printf.c
trunk/uClibc/libc/stdio/snprintf.c
trunk/uClibc/libc/stdio/sprintf.c
trunk/uClibc/libc/stdio/vasprintf.c
trunk/uClibc/libc/stdio/vdprintf.c
trunk/uClibc/libc/stdio/vfprintf.c
trunk/uClibc/libc/stdio/vprintf.c
trunk/uClibc/libc/stdio/vsnprintf.c
trunk/uClibc/libc/stdio/vsprintf.c
trunk/uClibc/libc/stdio/vswprintf.c
trunk/uClibc/libc/stdio/vwprintf.c
trunk/uClibc/libc/stdio/wprintf.c
Changeset:
Modified: trunk/uClibc/libc/stdio/_stdio.h
===================================================================
--- trunk/uClibc/libc/stdio/_stdio.h 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/_stdio.h 2005-12-09 13:52:08 UTC (rev 12778)
@@ -19,6 +19,17 @@
#include <string.h>
#include <unistd.h>
+extern int __vfprintf (FILE *__restrict __s, __const char *__restrict __format,
+ __gnuc_va_list __arg) attribute_hidden;
+
+extern int __vsnprintf (char *__restrict __s, size_t __maxlen,
+ __const char *__restrict __format, __gnuc_va_list __arg)
+ __THROW __attribute__ ((__format__ (__printf__, 3, 0))) attribute_hidden;
+
+extern int __vfwprintf (__FILE *__restrict __s,
+ __const wchar_t *__restrict __format,
+ __gnuc_va_list __arg) attribute_hidden;
+
#ifdef __UCLIBC_HAS_WCHAR__
#include <wchar.h>
#endif
Modified: trunk/uClibc/libc/stdio/fprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/fprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/fprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -8,14 +8,15 @@
#include "_stdio.h"
#include <stdarg.h>
-int fprintf(FILE * __restrict stream, const char * __restrict format, ...)
+int attribute_hidden __fprintf(FILE * __restrict stream, const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vfprintf(stream, format, arg);
+ rv = __vfprintf(stream, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__fprintf,fprintf)
Modified: trunk/uClibc/libc/stdio/old_vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/old_vfprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/old_vfprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -341,7 +341,7 @@
/* u_radix[i] <-> u_spec[i+2] for unsigned entries only */
static const char u_radix[] = "\x02\x08\x10\x10\x10\x0a";
-int vfprintf(FILE * __restrict op, register const char * __restrict fmt,
+int attribute_hidden __vfprintf(FILE * __restrict op, register const char * __restrict fmt,
va_list ap)
{
union {
@@ -711,3 +711,4 @@
return i;
}
+strong_alias(__vfprintf,vfprintf)
Modified: trunk/uClibc/libc/stdio/printf.c
===================================================================
--- trunk/uClibc/libc/stdio/printf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/printf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -8,14 +8,15 @@
#include "_stdio.h"
#include <stdarg.h>
-int printf(const char * __restrict format, ...)
+int attribute_hidden __printf(const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vfprintf(stdout, format, arg);
+ rv = __vfprintf(stdout, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__printf,printf)
Modified: trunk/uClibc/libc/stdio/snprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/snprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/snprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -12,16 +12,17 @@
#warning Skipping snprintf since no vsnprintf!
#else
-int snprintf(char *__restrict buf, size_t size,
+int attribute_hidden __snprintf(char *__restrict buf, size_t size,
const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vsnprintf(buf, size, format, arg);
+ rv = __vsnprintf(buf, size, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__snprintf,snprintf)
#endif
Modified: trunk/uClibc/libc/stdio/sprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/sprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/sprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -12,16 +12,17 @@
#warning Skipping sprintf since no vsnprintf!
#else
-int sprintf(char *__restrict buf, const char * __restrict format, ...)
+int attribute_hidden __sprintf(char *__restrict buf, const char * __restrict format, ...)
{
va_list arg;
int rv;
va_start(arg, format);
- rv = vsnprintf(buf, SIZE_MAX, format, arg);
+ rv = __vsnprintf(buf, SIZE_MAX, format, arg);
va_end(arg);
return rv;
}
+strong_alias(__sprintf,sprintf)
#endif
Modified: trunk/uClibc/libc/stdio/vasprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vasprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vasprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -32,7 +32,7 @@
*buf = NULL;
if ((f = open_memstream(buf, &size)) != NULL) {
- rv = vfprintf(f, format, arg);
+ rv = __vfprintf(f, format, arg);
fclose(f);
if (rv < 0) {
free(*buf);
@@ -54,14 +54,14 @@
int rv;
va_copy(arg2, arg);
- rv = vsnprintf(NULL, 0, format, arg2);
+ rv = __vsnprintf(NULL, 0, format, arg2);
va_end(arg2);
*buf = NULL;
if (rv >= 0) {
if ((*buf = malloc(++rv)) != NULL) {
- if ((rv = vsnprintf(*buf, rv, format, arg)) < 0) {
+ if ((rv = __vsnprintf(*buf, rv, format, arg)) < 0) {
free(*buf);
*buf = NULL;
}
@@ -73,7 +73,7 @@
return rv;
#endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */
+}
strong_alias(__vasprintf,vasprintf)
-}
#endif
Modified: trunk/uClibc/libc/stdio/vdprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vdprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vdprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -47,7 +47,7 @@
#endif
f.__nextopen = NULL;
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
#ifdef __STDIO_BUFFERS
/* If not buffering, then fflush is unnecessary. */
Modified: trunk/uClibc/libc/stdio/vfprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vfprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vfprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -1195,6 +1195,7 @@
#ifdef L_vfprintf
+#define HIDDEN_VFPRINTF __vfprintf
#define VFPRINTF vfprintf
#define FMT_TYPE char
#define OUTNSTR _outnstr
@@ -1227,6 +1228,7 @@
#else /* L_vfprintf */
+#define HIDDEN_VFPRINTF __vfwprintf
#define VFPRINTF vfwprintf
#define FMT_TYPE wchar_t
#define OUTNSTR _outnwcs
@@ -1844,7 +1846,7 @@
return 0;
}
-int VFPRINTF (FILE * __restrict stream,
+int attribute_hidden HIDDEN_VFPRINTF (FILE * __restrict stream,
register const FMT_TYPE * __restrict format,
va_list arg)
{
@@ -1921,5 +1923,6 @@
return count;
}
+strong_alias(HIDDEN_VFPRINTF,VFPRINTF)
#endif
/**********************************************************************/
Modified: trunk/uClibc/libc/stdio/vprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -10,5 +10,5 @@
int vprintf(const char * __restrict format, va_list arg)
{
- return vfprintf(stdout, format, arg);
+ return __vfprintf(stdout, format, arg);
}
Modified: trunk/uClibc/libc/stdio/vsnprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vsnprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vsnprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -14,7 +14,7 @@
#ifdef __STDIO_BUFFERS
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
@@ -57,7 +57,7 @@
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_ENABLE_PUTC(&f);
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
if (size) {
if (f.__bufpos == f.__bufend) {
--f.__bufpos;
@@ -66,6 +66,7 @@
}
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#elif defined(__USE_OLD_VFPRINTF__)
@@ -75,7 +76,7 @@
unsigned char *bufpos;
} __FILE_vsnprintf;
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
__FILE_vsnprintf f;
@@ -113,7 +114,7 @@
#endif
f.f.__nextopen = NULL;
- rv = vfprintf((FILE *) &f, format, arg);
+ rv = __vfprintf((FILE *) &f, format, arg);
if (size) {
if (f.bufpos == f.bufend) {
--f.bufpos;
@@ -122,6 +123,7 @@
}
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#elif defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__)
@@ -163,7 +165,7 @@
#undef COOKIE
-int vsnprintf(char *__restrict buf, size_t size,
+int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
@@ -197,10 +199,11 @@
#endif
f.__nextopen = NULL;
- rv = vfprintf(&f, format, arg);
+ rv = __vfprintf(&f, format, arg);
return rv;
}
+strong_alias(__vsnprintf,vsnprintf)
#else
#warning Skipping vsnprintf since no buffering, no custom streams, and not old vfprintf!
Modified: trunk/uClibc/libc/stdio/vsprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vsprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vsprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -15,7 +15,7 @@
int vsprintf(char *__restrict buf, const char * __restrict format,
va_list arg)
{
- return vsnprintf(buf, SIZE_MAX, format, arg);
+ return __vsnprintf(buf, SIZE_MAX, format, arg);
}
#endif
Modified: trunk/uClibc/libc/stdio/vswprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vswprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vswprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -52,7 +52,7 @@
__STDIO_STREAM_DISABLE_GETC(&f);
__STDIO_STREAM_DISABLE_PUTC(&f);
- rv = vfwprintf(&f, format, arg);
+ rv = __vfwprintf(&f, format, arg);
/* NOTE: Return behaviour differs from snprintf... */
if (f.__bufpos == f.__bufend) {
Modified: trunk/uClibc/libc/stdio/vwprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vwprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/vwprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -11,5 +11,5 @@
int vwprintf(const wchar_t * __restrict format, va_list arg)
{
- return vfwprintf(stdout, format, arg);
+ return __vfwprintf(stdout, format, arg);
}
Modified: trunk/uClibc/libc/stdio/wprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/wprintf.c 2005-12-09 02:28:54 UTC (rev 12777)
+++ trunk/uClibc/libc/stdio/wprintf.c 2005-12-09 13:52:08 UTC (rev 12778)
@@ -15,7 +15,7 @@
int rv;
va_start(arg, format);
- rv = vfwprintf(stdout, format, arg);
+ rv = __vfwprintf(stdout, format, arg);
va_end(arg);
return rv;
More information about the uClibc-cvs
mailing list