diff options
author | Nicolas George <nicolas.george@normalesup.org> | 2012-06-14 13:54:00 +0200 |
---|---|---|
committer | Nicolas George <nicolas.george@normalesup.org> | 2012-06-14 13:54:00 +0200 |
commit | 69bf775e9f858f1cec79c27ae7b98a64a7715cd8 (patch) | |
tree | 27535bf087ff7d0d20f37f568f6a5eaf565046f9 | |
parent | 0f73ac3fc87afc6ebdc6048c3d53054f5264cda0 (diff) | |
download | ffmpeg-streaming-69bf775e9f858f1cec79c27ae7b98a64a7715cd8.zip ffmpeg-streaming-69bf775e9f858f1cec79c27ae7b98a64a7715cd8.tar.gz |
bprint: implement vsnprintf for win32.
-rw-r--r-- | libavutil/bprint.c | 19 |
1 files changed, 19 insertions, 0 deletions
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) |