From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/stdio/vasprintf.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'libc/stdio/vasprintf.c') diff --git a/libc/stdio/vasprintf.c b/libc/stdio/vasprintf.c index ca110cbd1..1c184583b 100644 --- a/libc/stdio/vasprintf.c +++ b/libc/stdio/vasprintf.c @@ -5,12 +5,11 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define open_memstream __open_memstream - #include "_stdio.h" #include #include + #ifdef __UCLIBC_MJN3_ONLY__ /* Do the memstream stuff inline to avoid fclose and the openlist? */ #warning CONSIDER: avoid open_memstream call? @@ -20,7 +19,15 @@ #warning Skipping vasprintf since no vsnprintf! #else -int attribute_hidden __vasprintf(char **__restrict buf, const char * __restrict format, +#ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ +libc_hidden_proto(open_memstream) +libc_hidden_proto(fclose) +libc_hidden_proto(vfprintf) +#else +libc_hidden_proto(vsnprintf) +#endif + +int vasprintf(char **__restrict buf, const char * __restrict format, va_list arg) { #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ @@ -32,7 +39,7 @@ int attribute_hidden __vasprintf(char **__restrict buf, const char * __restrict *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 +61,14 @@ int attribute_hidden __vasprintf(char **__restrict buf, const char * __restrict 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; } @@ -74,6 +81,7 @@ int attribute_hidden __vasprintf(char **__restrict buf, const char * __restrict #endif /* __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ */ } -strong_alias(__vasprintf,vasprintf) +libc_hidden_proto(vasprintf) +libc_hidden_def(vasprintf) #endif -- cgit v1.2.3