[FFmpeg-devel] Inhibit C++ name-mangling for FFmpeg public API

Nicolas George nicolas.george at normalesup.org
Thu Jun 23 19:07:33 CEST 2011


Le quintidi 5 messidor, an CCXIX, Kirill Gavrilov a écrit :
> many C-libraries follow C++ friendly style for their public headers and
> define constructions like this:
> /* Inhibit C++ name-mangling for libavutil functions */
> #ifdef __cplusplus
> extern "C" {
> #endif
> 
> ... library functions ...
> 
> #ifdef __cplusplus
> }
> #endif
> Such defines allows to include C-headers into C++ project without ugly
> declarations like that:
> extern "C" {
>    #include <libavutil/avutil.h>
> }
> This will simplify including FFmpeg in C++ projects and will eliminate
> common mistakes (especially by newbes).
> 
> Is it OK if I prepare the patch that will use this technique?
> Or there are some reasons (politics / religion) why these changes doesn't
> already included in FFmpeg project?

They were removed four years ago after a lengthy flamewar:

http://git.videolan.org/?p=ffmpeg.git;a=commit;h=605315248cb59d9c4213c7035175b6e930d3b66e

Please do not start the flamewar again.

Regarding the question itself, I believe that adding them would give the
impression that we give a damn about c++, and in particular that each change
to the headers is tested for compatibility. This is currently not the case.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110623/a4bc6695/attachment.asc>


More information about the ffmpeg-devel mailing list