[Ffmpeg-devel] [PATCH] Dead code cleanup - C++

John Dalgliesh johnd
Tue Jan 30 14:25:40 CET 2007

On Tue, 30 Jan 2007, Yuri Vilmanis wrote:
> This patch should not have 
> a large impact on practical C++ usage though: if the C++ compiler being used 
> by client software has access to inttypes.h (and/or whatever other C99 
> headers are required) then the client code can simply put the extern 
> declaration around the includes, along the lines of:
> extern "C" {
> #include <avutil.h>
> #include <avcodec.h>
> #include <avformat.h>
> }

Exactly. C++ developers are used to doing this, even for system headers.

I have software that uses ffmpeg from C++ (actually Objective-C++) and for 
the little that it counts, my vote is also for removing this bloat.

> Waiting for a version number increment sounds like a good idea 
> though, as this patch will of course break linkage in C++ client code which 
> doesn't have its own extern "C" {}.

There's no point in doing that. The version numbers are defined inside the 
very headers we're talking about, so there's no way to base your decision 
on whether or not to add 'extern "C"' on these version numbers... by the 
time you know it's too late!

This will be one that C++ people just have to find and fix. And actually 
it's not necessary to detect older versions because, as has already been 
pointed out, nested linkage specifications are permitted.

And seeing as how it doesn't break binary compatibility, IMHO it could be 
done anytime.


More information about the ffmpeg-devel mailing list