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

Stefan Heinzmann stefan_heinzmann
Fri Jan 26 22:45:18 CET 2007

Reimar D?ffinger wrote:

> Given that not all public headers do include such wrapping, removing it
> would increase consistency (as would adding it to all public headers -
> are nested 'extern "C" {' valid?).

The current situation is such that C++ programs can include a few header
files (avutil.h, avcodec.h and avformat.h) without surrounding linkage
specifications (which is what those 'extern "C" { ... }' constructs are
called). All the other public headers need the linkage specification
around the #include line. I guess most C++ users (most users in
general?) will just include the three "main" header files and leave the
others alone. (Is there a policy? Are you supposed to include the main
headers only?)

Linkage specifications nest, with the innermost specification taking
precedence. So providing an external link specification does not hurt.
Providing additional linkage specifications in the other public headers
does not hurt either.

Admittedly, the current situation is somewhat inconsistent. A consistent
solution would either place linkage specifications in all public
headers, or in none. Except if the policy is that the only headers to be
directly included by client code are the three headers mentioned above.
If this policy applies, the current state is ok, too.

Just my 2 cents...


More information about the ffmpeg-devel mailing list