summaryrefslogtreecommitdiff
path: root/libc/stdio/vasprintf.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/stdio/vasprintf.c
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/stdio/vasprintf.c')
-rw-r--r--libc/stdio/vasprintf.c22
1 files changed, 15 insertions, 7 deletions
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 <stdarg.h>
#include <bits/uClibc_va_copy.h>
+
#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