Skip to content

Commit 323abdc

Browse files
committed
Windows: Work around MS cl.exe preprocessor quirk
1 parent 75ea0cd commit 323abdc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

driver/cpreprocessor.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ const char *getPathToImportc_h(const Loc &loc) {
2121
error(loc, "cannot find \"importc.h\" along import path");
2222
fatal();
2323
}
24+
25+
#ifdef _WIN32
26+
// if the path to importc.h is relative, cl.exe (but not clang-cl) treats it as relative to the .c file!
27+
cached = FileName::toAbsolute(cached);
28+
#endif
2429
}
2530
return cached;
2631
}

0 commit comments

Comments
 (0)