[x264-devel] Minor changes to simplify inclusion from C++

Mark Webster mark.webster at gmail.com
Wed Aug 12 08:54:08 CEST 2015


Hi,

Forward declarations are useful so that in C++, header files containing
struct/class/function definitions with pointers to x264 structs can be
#included without having to #include x264.h as well. This means you only
need to #include "x264.h" in the class/function implementation sources, not
everywhere throughout the project.

When a struct is declared anonymous, this is not possible, and x264.h must
be included, which should be unnecessary.

Thanks
-Mark

On 12 August 2015 at 07:46, BugMaster <BugMaster at narod.ru> wrote:

> On Wed, 5 Aug 2015 04:47:15 +0100, Mark Webster wrote:
> > Hi all,
>
> > Forgive me if this has been suggested before, but I found nothing after
> a lot of searching.
>
> > This patch simply wraps x264.h in extern "C" if included from a C++
> > target, and names  the previously anonymous struct types to enable
> forward declarations.
>
> > I understand if you want to keep the header pure from "#ifdef
> > __cplusplus", but in this case would it be acceptable just to modify
> > the typedef structs, as in the patch, to enable forward declarations?
>
> > Many thanks!
> > -Mark
>
> Hi. Can you a little bit a elaborate why you want forward declarations
> for this structs. As I understand you would still need to include
> x264.h than why not include it earlier? Can you explain your use case
> for this forward declarations?
>
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> https://mailman.videolan.org/listinfo/x264-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x264-devel/attachments/20150812/abc902e3/attachment.html>


More information about the x264-devel mailing list