[FFmpeg-cvslog] bprint: implement vsnprintf for win32.
Nicolas George
git at videolan.org
Thu Jun 14 16:13:06 CEST 2012
ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Thu Jun 14 13:54:00 2012 +0200| [69bf775e9f858f1cec79c27ae7b98a64a7715cd8] | committer: Nicolas George
bprint: implement vsnprintf for win32.
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=69bf775e9f858f1cec79c27ae7b98a64a7715cd8
---
libavutil/bprint.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/libavutil/bprint.c b/libavutil/bprint.c
index f9d5d6a..6e59f6b 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)
More information about the ffmpeg-cvslog
mailing list