Commit 69bf775e authored by Nicolas George's avatar Nicolas George

bprint: implement vsnprintf for win32.

parent 0f73ac3f
...@@ -26,6 +26,25 @@ ...@@ -26,6 +26,25 @@
#include "error.h" #include "error.h"
#include "mem.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_room(buf) ((buf)->size - FFMIN((buf)->len, (buf)->size))
#define av_bprint_is_allocated(buf) ((buf)->str != (buf)->reserved_internal_buffer) #define av_bprint_is_allocated(buf) ((buf)->str != (buf)->reserved_internal_buffer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment