aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2012-06-14 13:54:00 +0200
committerNicolas George <nicolas.george@normalesup.org>2012-06-14 13:54:00 +0200
commit69bf775e9f858f1cec79c27ae7b98a64a7715cd8 (patch)
tree27535bf087ff7d0d20f37f568f6a5eaf565046f9 /libavutil
parent0f73ac3fc87afc6ebdc6048c3d53054f5264cda0 (diff)
downloadffmpeg-69bf775e9f858f1cec79c27ae7b98a64a7715cd8.tar.gz
bprint: implement vsnprintf for win32.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/bprint.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index f9d5d6ad40..6e59f6b69e 100644
--- a/libavutil/bprint.c
+++ b/libavutil/bprint.c
@@ -26,6 +26,25 @@
#include "error.h"
#include "mem.h"
+#if defined(_WIN32)
+
+static int vsnprintf_fixed(char *s, size_t n, const char *format, va_list va)
+{
+ va_list va2;
+ int r;
+
+ va_copy(va2, va);
+ r = vsnprintf(s, n, format, va2);
+ va_end(va2);
+ if (r == -1)
+ r = _vscprintf(format, va);
+ return r;
+}
+
+#define vsnprintf vsnprintf_fixed
+
+#endif
+
#define av_bprint_room(buf) ((buf)->size - FFMIN((buf)->len, (buf)->size))
#define av_bprint_is_allocated(buf) ((buf)->str != (buf)->reserved_internal_buffer)