Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonah Graham2017-06-06 17:54:26 -0400
committerJonah Graham2017-06-07 04:20:23 -0400
commit68a609fe4498d8237dd99bd884564f9cf6715137 (patch)
treec0cfc3dee16cd95889363b71383e291017f56e0e
parentad97076c4d323cf8aaa60e9f3b6f5c057eae705b (diff)
downloadorg.eclipse.cdt-68a609fe4498d8237dd99bd884564f9cf6715137.tar.gz
org.eclipse.cdt-68a609fe4498d8237dd99bd884564f9cf6715137.tar.xz
org.eclipse.cdt-68a609fe4498d8237dd99bd884564f9cf6715137.zip
Bug 517908: Don't convert #undef into #include <#undef> anymore
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java5
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java5
2 files changed, 10 insertions, 0 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
index 4fc6d9b994..976e00a9a2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/language/settings/providers/tests/GCCBuiltinSpecsDetectorTest.java
@@ -373,12 +373,16 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
detector.startupForLanguage(null);
detector.processLine(" "+loc+"/misplaced/include1");
+ detector.processLine("#undef BEFORE_INCLUDES");
detector.processLine("#include \"...\" search starts here:");
+ detector.processLine("#undef IN_THE_MIDDLE_OF_INCLUDES_0");
detector.processLine(" "+loc+"/local/include");
detector.processLine("#include <...> search starts here:");
detector.processLine(" "+loc+"/usr/include");
detector.processLine(" "+loc+"/usr/include/../include2");
+ detector.processLine("#undef IN_THE_MIDDLE_OF_INCLUDES_1");
detector.processLine(" "+loc+"/missing/folder");
+ detector.processLine("#undef IN_THE_MIDDLE_OF_INCLUDES_2");
detector.processLine(" "+loc+"/Library/Frameworks (framework directory)");
detector.processLine("End of search list.");
detector.processLine(" "+loc+"/misplaced/include2");
@@ -386,6 +390,7 @@ public class GCCBuiltinSpecsDetectorTest extends BaseTestCase {
detector.processLine(" "+loc+"/System/Library/Frameworks");
detector.processLine("End of framework search list.");
detector.processLine(" "+loc+"/misplaced/include3");
+ detector.processLine("#undef AFTER_INCLUDES");
detector.shutdownForLanguage();
detector.shutdown();
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
index 83074435ea..163e22a088 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/language/settings/providers/GCCBuiltinSpecsDetector.java
@@ -80,6 +80,11 @@ public class GCCBuiltinSpecsDetector extends ToolchainBuiltinSpecsDetector imple
return makeList(line);
}
+ // never process #undef, see Bug 517908
+ if (line.startsWith("#undef")) {
+ return null;
+ }
+
// contribution of includes
if (line.equals("#include \"...\" search starts here:")) {
state = State.EXPECTING_LOCAL_INCLUDE;

Back to the top