[libdvbpsi-devel] Header multiple inclusion error

Jean-Paul Saman jpsaman at videolan.org
Tue May 14 13:56:02 CEST 2013


On Tue, May 14, 2013 at 1:46 PM, Andrey Utkin <
andrey.krieger.utkin at gmail.com> wrote:

> 2013/5/14 Jean-Paul Saman <jpsaman at videolan.org>:
> > In case of multiple inclusion of a header file is usually a sign that the
> > design is flawed.
> > Your design probably exposes more internal details than it needs too.
> >
> > It could easily lead to circular dependencies. It is cleaner to have
> header
> > files as much
> > as possible declared inside the *.c file.
> >
> > This is my 2cts on the subject.
> >
> >> And with workaround you gave, i see the problem of having type
> >> dvbpsi_t undefined in headers. As i explained, i need this type as
> >> classes datamembers.
>
> It feels like you ignore what i say.
>

I think we can safely agree on the fact that we disagree. It is your
project,
so structure it like you want, but I won't include a patch-set that removes
the #error from libdvbpsi header files.


> Your point is very valid for C, but I have C++ project, not C. It is
> usual to declare fully the object structure in .h file, and private
> data members, too, you know. Well, as far as i know, there's no way at
> all to _not_ declare private datamembers in .h and declare them later
> in .cpp of that same class.
> And the classes i address to are not of public API, they're just
> classes inside my project, i don't want to use PIMPL pattern or
> something else, splitting classes into two _only_ to workaround the
> compilation fail forced by library.
>
> I'd say it again - i am not against include guard as such, i am for
> removal of compilation fail forcing. It is not used anywhere else!
> Look at include guarding in other projects, they don't have it. Look
> at wiki, there's no even mention of such behaviour, everywhere it is
> just
> #ifndef HEADER_H_
> #define HEADER_H_
> // declarations
> #endif
>
> --
> Andrey Utkin
>

Kind regards,

Jean-Paul Saman.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/libdvbpsi-devel/attachments/20130514/376a5e87/attachment.html>


More information about the libdvbpsi-devel mailing list