diff options
author | YamaArashi <shadow962@live.com> | 2016-01-08 01:08:16 -0800 |
---|---|---|
committer | YamaArashi <shadow962@live.com> | 2016-01-08 01:08:16 -0800 |
commit | b4781cdf03fc43946b0e9f0686bce58083fe84cd (patch) | |
tree | 9290747628c10aac13fee3a7d2eefe86f6886feb /tools/scaninc/scaninc.cpp | |
parent | 4e95a132955541349558aeeba29a44890aefcee2 (diff) |
gpu_regs.c
Diffstat (limited to 'tools/scaninc/scaninc.cpp')
-rw-r--r-- | tools/scaninc/scaninc.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index 803355f32..9a228180a 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -276,6 +276,17 @@ void AsmFile::SkipString() } } +bool CanOpenFile(std::string path) +{ + FILE *fp = fopen(path.c_str(), "rb"); + + if (fp == NULL) + return false; + + fclose(fp); + return true; +} + int main(int argc, char **argv) { if (argc < 2) @@ -296,7 +307,9 @@ int main(int argc, char **argv) while ((incDirectiveType = file.ReadUntilIncDirective(path)) != IncDirectiveType::None) { bool inserted = dependencies.insert(path).second; - if (inserted && incDirectiveType == IncDirectiveType::Include) + if (inserted + && incDirectiveType == IncDirectiveType::Include + && CanOpenFile(path)) filesToProcess.push(path); } } |