summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorKevin Ryde <user42@zip.com.au>2001-04-29 23:31:40 +0200
committerKevin Ryde <user42@zip.com.au>2001-04-29 23:31:40 +0200
commit3e5ac7ec30720b13c8701adb04f392bb75ea6e48 (patch)
tree0e2d0a04c4ad0c6b17841728a8ae12dc2e5deb01 /acinclude.m4
parentf1afed4ede6471382b4bb1665ff3c7e7058b9ea3 (diff)
downloadgmp-3e5ac7ec30720b13c8701adb04f392bb75ea6e48.tar.gz
* acinclude.m4 (GMP_C_STDARG): New macro.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m434
1 files changed, 34 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index f9d88745e..3002af4af 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1427,6 +1427,40 @@ fi
])
+dnl GMP_C_STDARG
+dnl ------------
+dnl Test whether to use <stdarg.h> or <varargs.h>.
+dnl
+dnl Notice the AC_DEFINE here is HAVE_STDARG to avoid clashing with
+dnl HAVE_STDARG_H which could arise from AC_CHECK_HEADERS.
+dnl
+dnl This test might be slight overkill, after all there's really only going
+dnl to be ANSI or K&R and the two can be differentiated by AC_PROG_CC_STDC
+dnl or very likely by the setups for _PROTO in gmp.h. On the other hand
+dnl this test is nice and direct, being what we're going to actually use.
+
+AC_DEFUN(GMP_C_STDARG,
+[AC_CACHE_CHECK([whether <stdarg.h> exists and works],
+ gmp_cv_c_stdarg,
+[AC_TRY_COMPILE(
+[#include <stdarg.h>
+int foo (int x, ...)
+{
+ va_list ap;
+ int y;
+ va_start (ap, x);
+ y = va_arg (ap, int);
+ va_end (ap);
+ return y;
+}],,
+gmp_cv_c_stdarg=yes, gmp_cv_c_stdarg=no)
+])
+if test $gmp_cv_c_stdarg = yes; then
+ AC_DEFINE(HAVE_STDARG, 1, [Define if <stdarg.h> exists and works])
+fi
+])
+
+
dnl GMP_FUNC_ALLOCA
dnl ---------------
dnl Determine whether "alloca" is available. This is AC_FUNC_ALLOCA from