projects
/
tinc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add -I m4 back to ACLOCAL_AMFLAGS.
[tinc]
/
src
/
xalloc.h
diff --git
a/src/xalloc.h
b/src/xalloc.h
index
6629b60
..
28960fb
100644
(file)
--- a/
src/xalloc.h
+++ b/
src/xalloc.h
@@
-52,9
+52,17
@@
static inline char *xstrdup(const char *s) {
}
static inline int xvasprintf(char **strp, const char *fmt, va_list ap) {
}
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();
int result = vasprintf(strp, fmt, ap);
if(result < 0)
abort();
+#endif
return result;
}
return result;
}