mirror of
https://github.com/strophe/libstrophe.git
synced 2026-07-17 19:36:22 +00:00
Check for va_copy declaration
ctx.c contains a workaround for systems without va_copy() support. Improve this workaround in the way which is described in the autoconf manual. Also check for va_copy declaration in configure time. Fixes #160.
This commit is contained in:
@@ -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 <stdarg.h>])
|
||||
|
||||
if test "x$enable_tls" != xno; then
|
||||
PKG_CHECK_MODULES([openssl], [openssl],
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user