dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29
dnl ----------
dnl check for va_copy, part of stdarg.h
dnl Also, workaround for glibc's __va_copy, by checking for both.
AC_DEFUN([CF_VA_COPY],[
AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[
AC_TRY_LINK([
#include <stdarg.h>
],[
	static va_list dst;
	static va_list src;
	va_copy(dst, src)],
	cf_cv_have_va_copy=yes,
	cf_cv_have_va_copy=no)])

test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY)

AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[
AC_TRY_LINK([
#include <stdarg.h>
],[
	static va_list dst;
	static va_list src;
	__va_copy(dst, src)],
	cf_cv_have___va_copy=yes,
	cf_cv_have___va_copy=no)])

test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY)
])
