[FFmpeg-devel] [PATCH] mingw: Use avprive_vsnprintf in bprint

jamal jamrial at gmail.com
Thu Sep 20 21:53:40 CEST 2012


On 20/09/12 4:13 PM, Derek Buitenhuis wrote:
> On 20/09/2012 12:51 PM, Nicolas George wrote:
>> This looks strange: why do you not proceed the same way as for the basic
>> version of this file, i.e.
>>
>> OBJS-$(HAVE_MINGW32) += ../compat/msvcrt/snprintf.o
>>
>> bprint is not the only place where vsnprintf is used. If mingw's
>> implementation is bogus, it may be better to get the fixed version used by
>> the whole library.
> 
> Since it should then be used by both MinGW & MSVC, we run into some design
> things:
> 
> - Where do we include/put the function prototypes?
> - Do we keep using -D?
> - Is there a HAVE_* that covers both? Perhaps HAVE_MSVCRT can.
> - Do we want to use MinGW's own vsnprintf if the version is new enough>
> 
> - Derek
> 
I think HAVE_WINDOWS_H should work for that.
Nonetheless, Mingw32's vsnprintf works fine. The buggy one is Mingw64's (both 32 and 64 bits) before rev 4663 as you mentioned, so we should make sure to use avpriv_vsnprintf only with Mingw64 v1.0 and v2.0.
This is important because Mingw32 is the only remaining toolchain that compiles for Win98/NT4 and Win2K, so forcing the usage of avpriv_vsnprintf with it would mean the end of ffmpeg's support for those versions.

And regarding the prototypes, i still think that a new libavutil/os_support.h header for this would be a good idea.


More information about the ffmpeg-devel mailing list