From b0fca36261ef4be48b6db53cde51321fae182d1e Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 29 Aug 2002 11:47:21 +0000 Subject: [PATCH] * acinclude.m4 (GNUPG_CHECK_VA_COPY): New. * configure.ac: Use it. --- trunk/ChangeLog | 5 +++++ trunk/acinclude.m4 | 35 +++++++++++++++++++++++++++++++++++ trunk/configure.ac | 8 +++++++- 3 files changed, 47 insertions(+), 1 deletion(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 47ae65d..3a4f2a3 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -3,6 +3,11 @@ * gpgme.spec.in: Changed user name in Wojciech Polak's email address from ghostface to polak per request by himself. +2002-08-28 Werner Koch + + * acinclude.m4 (GNUPG_CHECK_VA_COPY): New. + * configure.ac: Use it. + 2002-08-23 Werner Koch * configure.ac (GPGME_CONFIG_CFLAGS): Renamed from GPGME_CFLAGS diff --git a/trunk/acinclude.m4 b/trunk/acinclude.m4 index b6f0a3a..6a06343 100644 --- a/trunk/acinclude.m4 +++ b/trunk/acinclude.m4 @@ -4143,3 +4143,38 @@ else fi AC_MSG_RESULT([$SED]) ]) + +dnl GNUPG_CHECK_VA_COPY() +dnl Do some check on how to implement va_copy. +dnl May define MUST_COPY_VA_BY_VAL. +dnl Actual test code taken from glib-1.1. +AC_DEFUN(GNUPG_CHECK_VA_COPY, +[ AC_MSG_CHECKING(whether va_lists must be copied by value) + AC_CACHE_VAL(gnupg_cv_must_copy_va_byval,[ + gnupg_cv_must_copy_va_byval=no + AC_TRY_RUN([ + #include + void f (int i, ...) + { + va_list args1, args2; + va_start (args1, i); + args2 = args1; + if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42) + exit (1); + va_end (args1); + va_end (args2); + } + + int main() + { + f (0, 42); + return 0; + } + ],gnupg_cv_must_copy_va_byval=yes) + ]) + if test "$gnupg_cv_must_copy_va_byval" = yes; then + AC_DEFINE(MUST_COPY_VA_BYVAL,1,[used to implement the va_copy macro]) + fi + AC_MSG_RESULT($gnupg_cv_must_copy_va_byval) +]) + diff --git a/trunk/configure.ac b/trunk/configure.ac index 14823f8..1ba0f3f 100644 --- a/trunk/configure.ac +++ b/trunk/configure.ac @@ -154,13 +154,19 @@ dnl AC_REPLACE_FUNCS(stpcpy) -# asprintf() is at least used in assuan AC_REPLACE_FUNCS(vasprintf) +if test "$ac_cv_func_vasprintf" != yes; then + GNUPG_CHECK_VA_COPY +fi + + + # Note: fopencokie is only a dummy stub and not used. # However some code in assuan/ links against it. AC_REPLACE_FUNCS(fopencookie) + dnl dnl Checks for system services dnl -- 2.26.2