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

jamal jamrial at gmail.com
Sun Jul 22 21:45:58 CEST 2012


How about using this for the time being?

#if (_WIN32_WINNT >= 0x0501)
        r = _vscprintf(format, va);
#else
        r = 2*n;
#endif

And as Döffinger said a configure check will do nothing since both mingw32 and mingw64 (32 and 64 bits) declare _vscprintf unconditionally regardless of the target Windows version, which is what the MSDN Library states.
I find it really weird that the MSDN Library has this wrong to be honest.

Regards.

On 22/07/12 4:10 PM, Nicolas George wrote:
> Le quintidi 5 thermidor, an CCXX, Reimar Döffinger a écrit :
>> The MSDN documentation is wrong, this function does not exist
>> on e.g. Win2k.
>> By my reading of the only case where it is used, this hack should work
>> almost as well, though it is ugly and comes with a risk of breaking
>> in the future.
> I intended to submit a slightly less ugly hack (vsnprintf to a reasonably
> large automatic buffer and memcpy). But this version is fine for now.
>
> I would be happier if there was a configure check. Unfortunately, I am
> completely clueless about the maze of twisty compiler and libc versions, all
> alike that makes the windows build environment
>
> Regards,


More information about the ffmpeg-devel mailing list