From 261c0028dcc3d15f82ed7f5db6cb89fc77083418 Mon Sep 17 00:00:00 2001 From: Richard Sharpe Date: Fri, 24 Oct 2003 05:47:39 +0000 Subject: Check for va_copy before you check for __va_copy, since va_copy is the actual standard, and __va_copy was the proposed standard. (This used to be commit 4ab7947e601e61cacd7ff541ee881850d9808387) --- source3/configure.in | 18 ++++++++++++++---- source3/lib/snprintf.c | 4 ++++ 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'source3') diff --git a/source3/configure.in b/source3/configure.in index 01c71b3149..bbf26c916d 100644 --- a/source3/configure.in +++ b/source3/configure.in @@ -1391,12 +1391,22 @@ if test x"$samba_cv_HAVE_GETTIMEOFDAY_TZ" = x"yes"; then AC_DEFINE(HAVE_GETTIMEOFDAY_TZ,1,[Whether gettimeofday() is available]) fi -AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE_VA_COPY,[ +AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[ AC_TRY_LINK([#include -va_list ap1,ap2;], [__va_copy(ap1,ap2);], -samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)]) +va_list ap1,ap2;], [va_copy(ap1,ap2);], +samba_cv_HAVE_VA_COPY=yes, +samba_cv_HAVE_VA_COPY=no)]) if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then - AC_DEFINE(HAVE_VA_COPY,1,[Whether __va_copy() is available]) + AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available]) +else + AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[ + AC_TRY_LINK([#include + va_list ap1,ap2;], [__va_copy(ap1,ap2);], + samba_cv_HAVE___VA_COPY=yes, + samba_cv_HAVE___VA_COPY=no)]) + if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then + AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available]) + fi fi AC_CACHE_CHECK([for C99 vsnprintf],samba_cv_HAVE_C99_VSNPRINTF,[ diff --git a/source3/lib/snprintf.c b/source3/lib/snprintf.c index a2f9f592db..5b0cfa1ab3 100644 --- a/source3/lib/snprintf.c +++ b/source3/lib/snprintf.c @@ -147,10 +147,14 @@ #ifndef VA_COPY #ifdef HAVE_VA_COPY +#define VA_COPY(dest, src) va_copy(dest, src) +#else +#ifdef HAVE___VA_COPY #define VA_COPY(dest, src) __va_copy(dest, src) #else #define VA_COPY(dest, src) (dest) = (src) #endif +#endif /* * dopr(): poor man's version of doprintf -- cgit