1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-26 10:04:02 +03:00

r4717: fixed our usage of VA_COPY to be more standards compliant

(This used to be commit 48b52584ab7db747feaf7ad4382bd3877935ee26)
This commit is contained in:
Andrew Tridgell 2005-01-12 22:06:52 +00:00 committed by Gerald (Jerry) Carter
parent ef4e85614e
commit d9d41b57e9
2 changed files with 15 additions and 4 deletions

View File

@ -820,12 +820,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 <stdarg.h>
va_list ap1,ap2;], [__va_copy(ap1,ap2);],
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])
fi
if test x"$samba_cv_HAVE_VA_COPY" != x"yes"; then
AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
AC_TRY_LINK([#include <stdarg.h>
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,[

View File

@ -281,8 +281,9 @@ int asprintf(char **,const char *, ...) PRINTF_ATTRIBUTE(2,3);
#define slprintf snprintf
/* we need to use __va_copy() on some platforms */
#ifdef HAVE_VA_COPY
#define VA_COPY(dest, src) va_copy(dest, src)
#elif defined(HAVE___VA_COPY)
#define VA_COPY(dest, src) __va_copy(dest, src)
#else
#define VA_COPY(dest, src) (dest) = (src)