views:

131

answers:

1

I am working on an inherited Borland C/C++ project and a lot of the project's functionality is hidden away behind #ifdefs which rely on defines passed to the compiler. I have been trying to get eclipse to activate these sections by using per-configuration symbols however when i view the source files, large sections are still greyed out. Is there any way to tell eclipse about these defines so i can change my build configuration and see which sections of code are being compiled properly?

A: 

Is this link to the problem described in this thread?

most likely the problem is that the files you are specifying are not found on the include search path.
The difference between macro- and include-files is that: - macro files are preprocessed only (i.e. macro definitions are extracted) whereas - include files are actually parsed (i.e declarations are extracted also).

These options should work just like the gcc's -imacro and -include commandline options.

I see the problem now.
I had the indexer turned off for the project.
So the file itself was found but the buffer for it was empty because it couldn't locate the file in the index.

After digging around in the code a bit, I found that I could turn on the "Follow unindexed header files when producing the outline view" option in the C/C++ preference page, and then it would parse the macro file correctly.


Or is it related to more recent bugs like bug 197989? (fast indexer may not be accurate when header included multiple times)

VonC
Not quite. The system i have currently set up is an eclipse project containing all the source code, and a makefile with multiple complilers and cross-compilers defined. I have the workspace currently set up with multiple build configurations, which all have custom symbols defined in the project properties.What i want to do is have eclipse itself define __COMPILER__ to be BCB5 or any of my other compiler strings so that when i look at the source code it recognises blocks protected by #if __COMPILER__ == BCB5 become active when set to the build configuration that defines them.
Thomas