1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 08:55:25 +02:00

Bug 517908: Don't convert #undef into #include <#undef> anymore

Change-Id: I24b18e050ac91668bd63626ed39f1bf8807f8feb
This commit is contained in:
Jonah Graham 2017-06-06 22:54:26 +01:00
parent ad97076c4d
commit 68a609fe44
2 changed files with 10 additions and 0 deletions

View file

@ -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();

View file

@ -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;