[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Tinycc-devel] cached header files cause multi-includes to fail
From: |
grischka |
Subject: |
Re: [Tinycc-devel] cached header files cause multi-includes to fail |
Date: |
Thu, 09 Jul 2009 11:18:50 +0200 |
User-agent: |
Thunderbird 1.5.0.10 (Windows/20070221) |
Simon Lehmayr wrote:
Hi,
I found an error in tcc while compiling a project which uses one header
that includes another header several times using defines to generate
different code.
Caching of headers hides the following includes thus no code is
generated in these cases.
I disabled caching by returning NULL in the cache check.
Caching should include the environmental state (defines, etc) to avoid
this problem.
There is some state included, that is headers are skipped only if there is
an #ifndef macro around, such as:
#ifndef FOO_H
#define FOO_H
...
#endif
And the ifdef must be the first thing and the endif must be the last.
I'm not sure how this can not work but maybe you can tell more details.
Also you could compile TCC with INC_DEBUG (at tcc.h:79).
Greetings,
Simon