diff options
author | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2005-02-09 09:00:28 +0000 |
---|---|---|
committer | Peter Kjellerstedt <peter.kjellerstedt@axis.com> | 2005-02-09 09:00:28 +0000 |
commit | fc89d0247d082ad0e56b3a2847c10817e6a44c3f (patch) | |
tree | 63fde98c72aca60cf28a8be885622b78c4c2a1cd /libc/stdio/vasprintf.c | |
parent | 439fc76c8d321d10018aad3a9a5d9562906c58ad (diff) |
Define va_copy for pre-C99 compilers (code taken from vfprintf.c).
Diffstat (limited to 'libc/stdio/vasprintf.c')
-rw-r--r-- | libc/stdio/vasprintf.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/libc/stdio/vasprintf.c b/libc/stdio/vasprintf.c index 21ef8e145..1ef75df94 100644 --- a/libc/stdio/vasprintf.c +++ b/libc/stdio/vasprintf.c @@ -17,6 +17,19 @@ #warning Skipping vasprintf since no vsnprintf! #else +/* Deal with pre-C99 compilers. */ + +#ifndef va_copy + +#ifdef __va_copy +#define va_copy(A,B) __va_copy(A,B) +#else +#warning Neither va_copy (C99/SUSv3) nor __va_copy is defined. Using a simple copy instead. But you should really check that this is appropriate... +#define va_copy(A,B) A = B +#endif + +#endif /* va_copy */ + int vasprintf(char **__restrict buf, const char * __restrict format, va_list arg) { |