Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Indexer issues with shared C/C++ headers

Hi,

I've come across an indexer issue when a C++ project contains both C and C++ source files that share the same header. Specifically, the issue is when the header does this:

#if defined(__cplusplus)
extern "C" {
#endif
<declare something>
#if defined(__cplusplus)
}
#endif

It looks like the indexer treats the __cplusplus macro as being true across all source files in a C++ project, so the thing declared in the above statement will not be visible in the C sources that include that header, since the extern "C" statement is invalid.

I don't know how the indexer works, but would it be possible for it to evaluate the __cplusplus macro per source file, according to the source file type?

Thanks,
Mike

Back to the top