summaryrefslogtreecommitdiff
path: root/libc/stdio/vsnprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdio/vsnprintf.c')
-rw-r--r--libc/stdio/vsnprintf.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/libc/stdio/vsnprintf.c b/libc/stdio/vsnprintf.c
index 6fcc84f2b..dc8cfe036 100644
--- a/libc/stdio/vsnprintf.c
+++ b/libc/stdio/vsnprintf.c
@@ -8,13 +8,15 @@
#include "_stdio.h"
#include <stdarg.h>
+libc_hidden_proto(vfprintf)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning WISHLIST: Implement vsnprintf for non-buffered and no custom stream case.
#endif /* __UCLIBC_MJN3_ONLY__ */
#ifdef __STDIO_BUFFERS
-int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
+int vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
@@ -57,7 +59,7 @@ int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
__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,7 +68,8 @@ int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
}
return rv;
}
-strong_alias(__vsnprintf,vsnprintf)
+libc_hidden_proto(vsnprintf)
+libc_hidden_def(vsnprintf)
#elif defined(__USE_OLD_VFPRINTF__)
@@ -76,7 +79,7 @@ typedef struct {
unsigned char *bufpos;
} __FILE_vsnprintf;
-int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
+int vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
__FILE_vsnprintf f;
@@ -114,7 +117,7 @@ int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
#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;
@@ -123,7 +126,8 @@ int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
}
return rv;
}
-strong_alias(__vsnprintf,vsnprintf)
+libc_hidden_proto(vsnprintf)
+libc_hidden_def(vsnprintf)
#elif defined(__UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__)
@@ -165,7 +169,7 @@ static ssize_t snpf_write(register void *cookie, const char *buf,
#undef COOKIE
-int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
+int vsnprintf(char *__restrict buf, size_t size,
const char * __restrict format, va_list arg)
{
FILE f;
@@ -199,11 +203,12 @@ int attribute_hidden __vsnprintf(char *__restrict buf, size_t size,
#endif
f.__nextopen = NULL;
- rv = __vfprintf(&f, format, arg);
+ rv = vfprintf(&f, format, arg);
return rv;
}
-strong_alias(__vsnprintf,vsnprintf)
+libc_hidden_proto(vsnprintf)
+libc_hidden_def(vsnprintf)
#else
#warning Skipping vsnprintf since no buffering, no custom streams, and not old vfprintf!