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

Ulrich von Zadow coder
Fri Jan 26 19:11:12 CET 2007

Michael Niedermayer wrote:
> Hi
> On Fri, Jan 26, 2007 at 05:15:07AM +0100, Diego Biurrun wrote:
>> On Fri, Jan 26, 2007 at 01:24:39PM +1030, Yuri Vilmanis wrote:
>>> Removed some dead code relating to C++. As no part of the codebase
>>> will ever be seen by a C++ compiler, any code protected by
>>> #ifdef__cplusplus will *never* get past the preprocessor, and so can
>>> be safely removed. The files in which these guards appear are not
>>> valid C++ anyway, so removing these references to C++ should reduce
>>> future confusion on this issue. 

I assume this is not meant seriously. Since people are taking it
seriously, however, I'll reply as if it were :-).

C++ projects that use libav* regularly include these files. When this is
done, the compiler will assume they are c++ files as well and thus
refuse to compile it - unless the code in the headers is wrapped by
'extern C'.

>>> The C++ wrapper "fobs" (or other
>>> C++ wrappers I'm not aware of) can be used by anyone requiring C++
>>> support.

Applying the patch is certain to break fobs as well - at least temporarily.

Also, from the fobs FAQ:

Q: Does Fobs offer all the functionality contained in ffmpeg?

A: No. FFMpeg offers much more functionality. Fobs is intended as a
simplified API to work easily with media files.

>> OK to apply this patch?
> all the versions should be bumped a little at least so user apps
> could detect if these macros are there or not
> now about the patch itself, i have no real oppinion on this, it where
> c++ people who wanted it, and now its one c++ developer who wants it
> removed, i think that the people who wanted this (see svnlog i dont
> remember at all) should at least get a chance to comment first

Fair enough.

I assume that this patch is a practical joke and not meant to be
applied. Please don't take it seriously, as applying it _will_ break
every existing c++ program that uses libav*. The lines that are removed
by the patch would need to be inserted into every c++ program using
libav*. Lines like this are standard in lots of other c libraries that
are used by c++ programs, as well.



More information about the ffmpeg-devel mailing list