This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: #import and PCH
- From: Stan Shebs <shebs at apple dot com>
- To: Geoffrey Keating <geoffk at apple dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 24 Jan 2003 13:53:32 -0800
- Subject: Re: #import and PCH
- References: <200301242040.h0OKebh1007933@keatge.apple.com>
Geoffrey Keating wrote:
#import worked by setting a flag bit on cpplib's hash table. This is
somewhat annoying from a PCH perspective, and is kind of ugly too.
This patch changes the behaviour so that #import uses macro
definitions to track whether a header is included or not, and then
PCH works with it automatically.
Bootstrapped & tested on powerpc-darwin.
I'll wait a bit before committing it so that people can comment.
Does this work right with symlinks? #import depends on being able to
detect file identity (I know, bleah bad evil etc etc), so I should
think your guard macro needs to have an inode number or some such
embedded in it.
Unfortunately this is not a hypothetical issue, a build of Mac OS X
will likely go down in flames if you get this wrong, since there
are cases of multiple #imports through different paths but all
symlinking to a single file.
Stan