[FFmpeg-devel] [PATCH] [RFC] avoid _vscnprintf since it exists only since WinXP.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sun Jul 22 22:01:57 CEST 2012

On Sun, Jul 22, 2012 at 04:45:58PM -0300, jamal wrote:
> How about using this for the time being?
> #if (_WIN32_WINNT >= 0x0501)
>         r = _vscprintf(format, va);
> #else
>         r = 2*n;
> #endif

Well, I am not keen on adding extra complexity for this case (win2k
doesn't seem important enough for that).
Part of the [RFC] thing is kind of e.g. why it is used at all,
and why is both the vsnprintf return value and a allocation loop used.
Overall the code seems kind of strange to me, for example the check
for negative return values - the man page says "If an output error is
encountered, a negative value is returned."
However there can be no output error for vsnprintf, so I would have
expected it to rather be e.g. an av_assert0...
But since Nicolas said be intends to change it anyway it's probably
moot to discuss it now.

More information about the ffmpeg-devel mailing list