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

Derek Buitenhuis derek.buitenhuis at gmail.com
Fri Sep 21 19:06:45 CEST 2012

On 20/09/2012 9:59 PM, jamal wrote:
>>> I think HAVE_WINDOWS_H should work for that.
>> We already have something like HAVE_MSVCRT or so. There's no reason for
>> an extra check. Heck, we may as well just use _WIN32.
> HAVE_WINDOWS_H already exists, that's why i mentioned it.

We already have HAVE_MSVCRT too, and using that would be much more descriptive
and true to what we're actually checking for.

> I personally don't agree with dropping support for Win98/NT4/2K when there's no justified reason for doing so.
> If we were trying to add some new feature or fix that would bring improvements to current Windows versions and the only way to achieve that is by dropping support for old versions, then I'd agree since it would be justified. But this you suggest is dropping support simply to avoid doing some extra checks.

Fair enough. I was just voicing my annoyance with people who still care about
such old, unsupported OSes in 2012. I guess we add the version checks.

>>> And regarding the prototypes, i still think that a new libavutil/os_support.h header for this would be a good idea.
>> I am certain this will be frowned upon... see all the bikeshedding about where the implementation was
>> placed in the first place...
> What about adding new functions av_vsnprintf and av_snprintf to avstring.h/c, and replacing every instance of vsnprintf and snprintf with them?

I strongly dislike this idea. It's quite intrusive, and we already have an OK way to do this in
place in configure (-D).

> With MSVC and MingW64 < v3.0 they would use the code that's currently on snprintf.c, and with everything else they would simply call the corresponding system function. Check for example the attached patch.

I'd rather keep it as-is, and use -D with a header or -FI.

> If neither that nor libavutil/os_support.h are viable options, then we could just force the inclusion of some new header in CFLAGS, which is what Bultje originally intended and what's being done with MSVC for other stuff.
> It's hackish and i personally don't like it, but it's acceptable.

Is libavutil/os_support.h included by everything that could need it (implicitly or otherwise)?

- Derek

More information about the ffmpeg-devel mailing list