Re: Header multiple inclusion error
Andrey Utkin <[email protected]>
| Newsgroups | gmane.comp.video.videolan.libdvbpsi.devel |
|---|---|
| Message-ID | <CANZNk80vJSJPvGCm8zWdU1v2Xdavdb-5Gp=q0ju9tn3M2kJqCw@mail.gmail.com> |
2013/5/14 Jean-Paul Saman <[email protected]>: > 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. 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 _______________________________________________ libdvbpsi-devel mailing list [email protected] http://mailman.videolan.org/listinfo/libdvbpsi-devel