From 8c79d5bc23e4b555625dfa368ca9f74e6d14540b Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Mon, 30 Sep 2013 14:37:50 +0200 Subject: C++: add code-model support for defines-per-editor. The UI side will come in another commit. Change-Id: I1038a438587fe4cef70408f7f627d08837fc192d Reviewed-by: Nikolai Kosjar --- src/plugins/cpptools/cpppreprocessor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/plugins/cpptools/cpppreprocessor.cpp') diff --git a/src/plugins/cpptools/cpppreprocessor.cpp b/src/plugins/cpptools/cpppreprocessor.cpp index 1e3f5b1bf0..f60c853b83 100644 --- a/src/plugins/cpptools/cpppreprocessor.cpp +++ b/src/plugins/cpptools/cpppreprocessor.cpp @@ -223,10 +223,15 @@ QString CppPreprocessor::cleanPath(const QString &path) return result; } +static inline bool isInjectedFile(const QString &fileName) +{ + return fileName.startsWith(QLatin1Char('<')) && fileName.endsWith(QLatin1Char('>')); +} + QString CppPreprocessor::resolveFile_helper(const QString &fileName, IncludeType type) { const QFileInfo fileInfo(fileName); - if (fileName == Preprocessor::configurationFileName || fileInfo.isAbsolute()) + if (isInjectedFile(fileName) || fileInfo.isAbsolute()) return fileName; if (type == IncludeLocal && m_currentDoc) { -- cgit v1.2.1