Re: Solving a dependency circle
Espen Skoglund <[email protected]>
| Newsgroups | gmane.comp.micro-kernel.l4.l4ka.general |
|---|---|
| Message-ID | <[email protected]> |
[Martin Christian]
> This is not really a L4 question! However, it's a real problem for me,
> while adapting the PowerPC arch to NICTAs L4.N1 API. The include files
> create a circle of dependency. There are common solutions to this,
> however this ones seems to be special or at least out of my mind.
> I created this simple example:
> <main.cpp>
> #include "Beta.h"
> int main( int argc, char** argv ) {
> Beta b;
> b.useInline();
> return 0;
> }
> </main.cpp>
> Compile with: gcc -Wall main.cpp -o dependency
> The solution would be to include "Alpha_inline." in
> main.cpp. However, the file belongs to the "API", which means I
> can't change it.
As far as I can see from your example, including Alpha_inline.h in
Alpha.h at end of the file instead of the beginning would also solve
the problem.
eSk