+# include <stdio.h>
+# include <stdlib.h>
+# include <stdarg.h>
+static inline int vasprintf (char **strp, const char *fmt, va_list ap)
+{
+ int len = vsnprintf (NULL, 0, fmt, ap) + 1;
+ char *res = (char *)malloc (len);
+ if (res == NULL)
+ return -1;
+ *strp = res;
+ return vsprintf (res, fmt, ap);
+}