Re: Is there a bug in #include operation?
Re: Is there a bug in #include operation?
- Subject: Re: Is there a bug in #include operation?
- From: Allan Odgaard <email@hidden>
- Date: Mon, 1 Mar 2004 22:27:51 +0100
On 1. Mar 2004, at 21:33, Denis Stanton wrote:
Is there a problem in Xcode 1.1's handling of #include where classes
are mutually dependent ?
I Doubt it...
I have written about 20 classes. There are many dependencies so each
.h file contains one or more #include statements. In some cases these
could form loops. so aaa.h includes bbb.h, bbb.h includes ccc.h and
ccc.h includes aaa.h
You cannot have loops. If the include order is as you say, the compiler
will generate a source similar to:
cat >tmp.h ccc.h bbb.h aaa.h
If you look at tmp.h, you'll see that that the top of this file is
ccc.h, so if ccc.h require parts of aaa.h, then it will not work,
because these are defined in the bottom of tmp.h
Including aaa.h from ccc.h will just be ignored by the compiler (at
least if you use import instead of include) -- as it would otherwise go
into an infinite loop.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.