diff --git a/configure.ac b/configure.ac index e20e322..bfae47f 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ AC_ARG_ENABLE([cares], AC_SEARCH_LIBS([socket], [network socket]) AC_CHECK_FUNCS([snprintf vsnprintf]) +AC_CHECK_DECLS([va_copy], [], [], [#include ]) if test "x$enable_tls" != xno; then PKG_CHECK_MODULES([openssl], [openssl], diff --git a/src/ctx.c b/src/ctx.c index 3491616..da2d643 100644 --- a/src/ctx.c +++ b/src/ctx.c @@ -50,9 +50,10 @@ #include "resolver.h" #include "util.h" -/* Workaround for visual studio without va_copy support. */ -#if defined(_MSC_VER) && _MSC_VER < 1800 || defined(__HAIKU__) -#define va_copy(d, s) ((d) = (s)) +/* Workaround for systems without va_copy support. */ +#if defined(_MSC_VER) && _MSC_VER < 1800 || \ + !defined(_MSC_VER) && !defined(HAVE_DECL_VA_COPY) +#define va_copy(d, s) (memcpy(&d, &s, sizeof(va_list))) #endif /** Initialize the Strophe library.