Windows doesn't actually support it, but MinGW provides it. However, with some versions of
MinGW it doesn't work correctly. Instead, we vsnprintf() to a local buffer and xstrdup() the
results.
}
static inline int xvasprintf(char **strp, const char *fmt, va_list ap) {
+#ifdef HAVE_MINGW
+ char buf[1024];
+ int result = vsnprintf(buf, sizeof buf, fmt, ap);
+ if(result < 0)
+ abort();
+ *strp = xstrdup(buf);
+#else
int result = vasprintf(strp, fmt, ap);
if(result < 0)
abort();
+#endif
return result;
}