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

John Kelley john
Sat Jan 27 08:50:03 CET 2007


On 1/26/07, Diego Biurrun <diego at biurrun.de> wrote:
> On Fri, Jan 26, 2007 at 10:23:34AM +0100, Michael Niedermayer wrote:
> >
> > 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. The C++ wrapper "fobs" (or other
> > > > C++ wrappers I'm not aware of) can be used by anyone requiring C++
> > > > support.
> > >
> > > 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
>
> Opinions are (unsurprisingly) mixed.
>
> I agree that we should have this either on all or none of our public
> header files and I vote for removing it everywhere for consistency.
> Baptiste and Reimar seem to be with me on this one.
>
> Diego

As someone who is not a C purist I would ask for the sanity of all C++
coders out there to simply add it to all public headers. It doesn't
take long to do, contrary to popular belief it does nothing to harm
your or the project or its readability. And no if we do it for C++ we
don't have to do x or y for java or python or ruby or perl. C++ is a
special case seeing it is pretty much a superset of C and is very
closely related, unlike other languages.

Also, not that anyone here probably cares but it is standard practice
for any library that is used in C++ and written in C to include extern
C in its public headers.

Regards,
John (Please don't flame although you probably will....)




More information about the ffmpeg-devel mailing list