summaryrefslogtreecommitdiff
path: root/openbsd-compat/openbsd-compat.h
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2016-07-15 14:48:30 +1000
committerDarren Tucker <dtucker@zip.com.au>2016-07-15 14:54:16 +1000
commit5abfb15ced985c340359ae7fb65a625ed3692b3e (patch)
treebcde17550f213403000237c99a541ec43cae38b1 /openbsd-compat/openbsd-compat.h
parent832b7443b7a8e181c95898bc5d73497b7190decd (diff)
Move VA_COPY macro into compat header.
Some AIX compilers unconditionally undefine va_copy but don't set it back to an internal function, causing link errors. In some compat code we already use VA_COPY instead so move the two existing instances into the shared header and use for sshbuf-getput-basic.c too. Should fix building with at lease some versions of AIX's compiler. bz#2589, ok djm@
Diffstat (limited to 'openbsd-compat/openbsd-compat.h')
-rw-r--r--openbsd-compat/openbsd-compat.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 997541e43..37d2064cd 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -253,6 +253,23 @@ int mbtowc(wchar_t *, const char*, size_t);
253# include <stdarg.h> 253# include <stdarg.h>
254#endif 254#endif
255 255
256/*
257 * Some platforms unconditionally undefine va_copy() so we define VA_COPY()
258 * instead. This is known to be the case on at least some configurations of
259 * AIX with the xlc compiler.
260 */
261#ifndef VA_COPY
262# ifdef HAVE_VA_COPY
263# define VA_COPY(dest, src) va_copy(dest, src)
264# else
265# ifdef HAVE___VA_COPY
266# define VA_COPY(dest, src) __va_copy(dest, src)
267# else
268# define VA_COPY(dest, src) (dest) = (src)
269# endif
270# endif
271#endif
272
256#ifndef HAVE_VASPRINTF 273#ifndef HAVE_VASPRINTF
257int vasprintf(char **, const char *, va_list); 274int vasprintf(char **, const char *, va_list);
258#endif 275#endif