summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2008-06-27 08:36:34 +0000
committerthevenyp <thevenyp@280ebfd0-de03-0410-8827-d642c229c3f4>2008-06-27 08:36:34 +0000
commit49e7f82e9fa53cf4909918e26fd12c2bf4f27c2e (patch)
tree1ebd50d00eb154a3d822f148fdc2aba29850adc3 /acinclude.m4
parentd68bdebb5e483cc91e789d01f9caeadf1a4e96e9 (diff)
downloadmpfr-49e7f82e9fa53cf4909918e26fd12c2bf4f27c2e.tar.gz
acinclude.m4: add a check defining va_copy macro when needed.
vasprintf.c: use TMP_ALLOC instead of variable-length array (C99). tests/tfprintf.c tests/tsprintf.c: #define length of array instead of const int so as to avoid variable-length array (C99). tests/tprintf.c: #define length of array instead of const int so as to avoid variable-length array (C99). remove use of function dup (dependency with <unistd.h>). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@5408 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m418
1 files changed, 18 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 9e84bf7f1..88efc6689 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -63,6 +63,24 @@ AC_CHECK_HEADERS([sys/time.h sys/fpu.h])
dnl SIZE_MAX macro
gl_SIZE_MAX
+dnl va_copy macro
+AC_MSG_CHECKING([how to copy va_list])
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdarg.h>
+]], [[
+ va_list ap1, ap2;
+ va_copy(ap1, ap2);
+]])], AC_MSG_RESULT([va_copy]),
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <stdarg.h>
+]], [[
+ va_list ap1, ap2;
+ __va_copy(ap1, ap2);
+]])], [AC_DEFINE([va_copy], [__va_copy]) AC_MSG_RESULT([__va_copy])],
+ [AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
+ AC_MSG_RESULT([memcpy])])
+ ])
+
dnl FIXME: The functions memmove, memset and strtol are really needed by
dnl MPFR, but if they are implemented as macros, this is also OK (in our
dnl case). So, we do not return an error, but their tests are currently