summaryrefslogtreecommitdiff
path: root/legacy/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-04-14 17:47:40 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-04-14 17:47:40 +0000
commitc1f0bf9bbdef881e03fe68aa76d5551f02d79a18 (patch)
treed5301496cee2f7a54d0dad3442ef1df9b52dc699 /legacy/evil
parent84e4660d68591daa5e1e66465df2a327056c0e8e (diff)
* src/lib/evil_stdio.c:
* src/lib/evil_stdio.h: add vasprintf() function SVN revision: 48001
Diffstat (limited to 'legacy/evil')
-rw-r--r--legacy/evil/ChangeLog6
-rw-r--r--legacy/evil/src/lib/evil_stdio.c18
-rw-r--r--legacy/evil/src/lib/evil_stdio.h6
3 files changed, 30 insertions, 0 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index 2610aa8ec6..cc31972005 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,9 @@
12010-04-14 Vincent Torri <doursse at users dot sf dot net>
2
3 * src/lib/evil_stdio.c:
4 * src/lib/evil_stdio.h:
5 add vasprintf() function
6
12010-04-03 Vincent Torri <doursse at users dot sf dot net> 72010-04-03 Vincent Torri <doursse at users dot sf dot net>
2 8
3 * src/lib/Evil.h: 9 * src/lib/Evil.h:
diff --git a/legacy/evil/src/lib/evil_stdio.c b/legacy/evil/src/lib/evil_stdio.c
index 3e3aab8678..d859f52c40 100644
--- a/legacy/evil/src/lib/evil_stdio.c
+++ b/legacy/evil/src/lib/evil_stdio.c
@@ -214,3 +214,21 @@ int evil_fclose_native(FILE *stream)
214} 214}
215 215
216#endif /* _WIN32_WCE */ 216#endif /* _WIN32_WCE */
217
218#ifdef _MSC_VER
219
220int
221vasprintf(char **strp, const char *fmt, va_list ap)
222{
223 char *res;
224 int len;
225
226 len = _vsnprintf(NULL, 0, fmt, ap) + 1;
227 res = (char *)malloc(len);
228 if (!res) return -1;
229
230 *strp = res;
231 return vsprintf(res, fmt, ap);
232}
233
234#endif /* _MSC_VER */
diff --git a/legacy/evil/src/lib/evil_stdio.h b/legacy/evil/src/lib/evil_stdio.h
index f56f85facd..626caac464 100644
--- a/legacy/evil/src/lib/evil_stdio.h
+++ b/legacy/evil/src/lib/evil_stdio.h
@@ -52,6 +52,12 @@ EAPI int evil_fclose_native(FILE *stream);
52 52
53#endif /* _WIN32_WCE */ 53#endif /* _WIN32_WCE */
54 54
55#ifdef _MSC_VER
56
57EAPI int vasprintf(char **strp, const char *fmt, va_list ap);
58
59#endif /* _MSC_VER */
60
55 61
56/** 62/**
57 * @} 63 * @}