[uClibc-cvs] r9827 - in trunk/uClibc/libc/stdio: .

uclibc at mail.uclibc.org uclibc at mail.uclibc.org
Wed Feb 9 09:00:29 UTC 2005


Author: pkj
Date: 2005-02-09 02:00:28 -0700 (Wed, 09 Feb 2005)
New Revision: 9827

Log:
Define va_copy for pre-C99 compilers (code taken from vfprintf.c).

Modified:
   trunk/uClibc/libc/stdio/vasprintf.c


Changeset:
Modified: trunk/uClibc/libc/stdio/vasprintf.c
===================================================================
--- trunk/uClibc/libc/stdio/vasprintf.c	2005-02-09 08:42:13 UTC (rev 9826)
+++ trunk/uClibc/libc/stdio/vasprintf.c	2005-02-09 09:00:28 UTC (rev 9827)
@@ -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)
 {




More information about the uClibc-cvs mailing list