summaryrefslogtreecommitdiff
path: root/printf.c
diff options
context:
space:
mode:
authorthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-27 09:34:03 +0000
committerthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2009-03-27 09:34:03 +0000
commitb4181d68215d3d4dd85d7d84f32c64516d55710f (patch)
tree81ac53191b586f807cb57e3f22ee045f67fb3779 /printf.c
parent8427a181b42c4156f0abc20fe6b77fc29fb556ee (diff)
downloadmpfr-b4181d68215d3d4dd85d7d84f32c64516d55710f.tar.gz
acinclude.m4: remove definition of va_copy, just detect its presence.
printf.c vasprintf.c: #define a replacement of va_copy if needed (in the same way as gmp). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6143 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'printf.c')
-rw-r--r--printf.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/printf.c b/printf.c
index 1557cc652..38b754229 100644
--- a/printf.c
+++ b/printf.c
@@ -28,6 +28,19 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef HAVE_STDARG
#include <stdarg.h>
+
+#ifndef HAVE_VA_COPY
+# ifdef HAVE___VA_COPY
+# define va_copy(dst,src) __va_copy(dst, src)
+# else
+/* autoconf manual advocates this fallback.
+ This is also the solution chosen by gmp */
+# define va_copy(dst,src) \
+ do { memcpy(&(dst), &(src), sizeof(va_list)); } while (0)
+# endif /* HAVE___VA_COPY */
+#endif /* HAVE_VA_COPY */
+
+
#include <errno.h>
#include "mpfr-impl.h"