Re: AW: Solving a dependency circle

Espen Skoglund <[email protected]>
Newsgroups gmane.comp.micro-kernel.l4.l4ka.general
Message-ID <[email protected]>
[Martin Christian]
> Unfortunately it still doesn't work! I tried to emulate gcc:
> 1.) main -> Beta:
>     + BETA_H_ is defined
> 2.) Beta -> Alpha:
>     + ALPHA_H_ is defined
>     + Alpha is parsed
> 3.) Alpha -> Alpha_inline:
>     + ALPHA_INLINE_H_ is defined
>     + Alpha is ignored, because ALPHA_H_ is set
>     + Beta is ignored, because BETA_H_ is set
-> Error because Beta is needed

> Maybe it helps, if I rearrange Alpha and Beta?!

Whoops.  Sorry.  Thought you were including Alpha.h from main.  If you
do this (and move the Alpha_inline include) it will work.  If you
don't do this you'll have to do tricks with conditinally including
Alpha_inline and also include it directly in Beta.h.

Alternatively you can include Alpha.h from Beta.h before the first
ifdef.  This will be identical to including Alpha.h before Beta.h.  No
matter what you do it will be quite hackish, though.  And if you're
not careful with this sort of thing you can easily run into cycles of
include files.

	eSk
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.