|
Re: indexer doesn't track active configuration for #ifdefs [message #1768259 is a reply to message #1768218] |
Sun, 16 July 2017 06:39 |
David Vavra Messages: 1426 Registered: October 2012 |
Senior Member |
|
|
I haven't look at the code but AFAIK the indexer has only one cache.
If a macro has multiple values the last value encountered will be used.
This makes the value appear to be random.
Not sure if this would work:
You could try using a Preprocessor Macros File or maybe an Include File in the User Settings Entries tab
of Project --> Properties --> C/C++ General --> Preprocessor Include Paths, Macros etc.
Use a name that has the current configuration name
Something like: MacrosFor${config_name:${ProjName}}.h (or maybe $(ConfigName) )
The file probably should undefine all macros before setting their values.
You may need to hit the apply button after changing the configuration.
You may also need to rebuild the index too.
[Updated on: Sun, 16 July 2017 07:22] Report message to a moderator
|
|
|
Re: indexer doesn't track active configuration for #ifdefs [message #1768283 is a reply to message #1768259] |
Sun, 16 July 2017 22:03 |
Andrew Voelkel Messages: 17 Registered: September 2016 |
Junior Member |
|
|
Hi and thanks for the reply!
I'm not sure I completely understand your reply, mostly because I don't have a macro that is set multiple times. I just have a macro that is only set in one configuration. Let's call it SPECIAL_CONFIG, which I add to the "paths and symbols" of the "Special" configuration (and I don't give it any value)
But when I set the active configuration to "Special", the indexer doesn't seem to know that SPECIAL_CONFIG is defined in a source file:
#ifdef SPECIAL_CONFIG
// indexer "greys out" anything in here.
#endif
So it isn't a matter of SPECIAL_CONFIG being set more than once. I'm confused because this seems like a very basic use case. Telling Eclipse to rebuild the index after changing the active configuration doesn't seem to help.
- Andy
[Updated on: Sun, 16 July 2017 22:06] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.02350 seconds