Introduce {v,}asprintf for windows

We have now again two functions called h_platform_vasprintf and
h_platform_asprintf. On windows they are implemented in terms of vsnprint
and the like. On BSD/GNU libraries we use the supplied vasprintf and
asprintf.
This commit is contained in:
Nicolas Léveillé 2015-08-16 16:46:52 +02:00
parent 124b4c381b
commit 9557448ae6
5 changed files with 90 additions and 14 deletions

View file

@ -1,6 +1,5 @@
// Intended to be included from regex_debug.c
#define _GNU_SOURCE
#include <stdio.h>
#include "../platform.h"
#include <stdlib.h>
#define USE_DLADDR (0)
@ -22,7 +21,7 @@ char* getsym(HSVMActionFunc addr) {
return retstr;
} else
#endif
if (asprintf(&retstr, "%p", addr) > 0)
if (h_platform_asprintf(&retstr, "%p", addr) > 0)
return retstr;
else
return NULL;