#define COMPAT_H_INCLUDED
#ifndef HAVE_VASPRINTF
-int vasprintf(char **strp, const char *fmt, va_list ap)
+#ifdef va_start /* make sure <stdarg.h> is in scope */
+int vasprintf(char **strp, const char *fmt, va_list ap);
+#endif
#endif
#ifndef HAVE_ASPRINTF
-int asprintf(char **strp, const char *fmt, ...)
+int asprintf(char **strp, const char *fmt, ...);
#endif
#ifndef HAVE_STRLCPY
#include <stdarg.h>
#include <stdio.h>
+#include <stdlib.h>
#include "compat.h"
#ifndef HAVE_VASPRINTF
int
-asprintf(char **strp, const char *fmt, va_list ap)
+vasprintf(char **strp, const char *fmt, va_list ap)
{
- va_list ap, aq;
+ va_list aq;
int ret;
va_copy(aq, ap);