From 7436519c8043f61bb949858aec30ca4485283b64 Mon Sep 17 00:00:00 2001 From: Vladimir Hirsl Date: Wed, 6 Jul 2005 20:47:40 +0000 Subject: [PATCH] Fix for 102701: [Scanner Discovery] Per-file options also given to header files incorrectly. Added check to remove include and macros files from returned scanner info that match the parsed resource. --- .../PerFileDiscoveredPathContainer.java | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java index ffe8a833e7e..0248fd7ec72 100644 --- a/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java +++ b/build/org.eclipse.cdt.make.core/src/org/eclipse/cdt/make/internal/core/scannerconfig/PerFileDiscoveredPathContainer.java @@ -62,16 +62,25 @@ public class PerFileDiscoveredPathContainer extends DiscoveredPathContainer entries.add(CoreModel.newMacroEntry(path, (String)entry.getKey(), (String)entry.getValue())); //$NON-NLS-1$ } } - if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) { + // compare the resource with include and macros files + IPath fullResPath = fProject.getWorkspace().getRoot().getFile(path).getLocation(); + if (fullResPath == null) { + fullResPath = path; + } + if ((mask & IPathEntry.CDT_INCLUDE_FILE) != 0) { IPath[] includeFiles = filePathInfo.getIncludeFiles(path); for (int i = 0; i < includeFiles.length; i++) { - entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i])); + if (!includeFiles[i].equals(fullResPath)) { + entries.add(CoreModel.newIncludeFileEntry(path, includeFiles[i])); + } } } if ((mask & IPathEntry.CDT_MACRO_FILE) != 0) { IPath[] imacrosFiles = filePathInfo.getMacroFiles(path); for (int i = 0; i < imacrosFiles.length; i++) { - entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i])); + if (!imacrosFiles[i].equals(fullResPath)) { + entries.add(CoreModel.newMacroFileEntry(path, imacrosFiles[i])); + } } } }