From cd67c5e24055753615f96567c87c518b7487e879 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Mon, 18 Jan 2021 23:39:05 -0500 Subject: Sync scaninc with pokeemerald --- tools/scaninc/scaninc.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'tools/scaninc/scaninc.cpp') diff --git a/tools/scaninc/scaninc.cpp b/tools/scaninc/scaninc.cpp index b95cbd033..dcb16c0e7 100644 --- a/tools/scaninc/scaninc.cpp +++ b/tools/scaninc/scaninc.cpp @@ -97,19 +97,26 @@ int main(int argc, char **argv) } for (auto include : file.GetIncludes()) { + bool exists = false; + std::string path(""); for (auto includeDir : includeDirs) { - std::string path(includeDir + include); + path = includeDir + include; if (CanOpenFile(path)) { - bool inserted = dependencies.insert(path).second; - if (inserted) - { - filesToProcess.push(path); - } + exists = true; break; } } + if (!exists && (file.FileType() == SourceFileType::Asm || file.FileType() == SourceFileType::Inc)) + { + path = include; + } + bool inserted = dependencies.insert(path).second; + if (inserted && exists) + { + filesToProcess.push(path); + } } includeDirs.pop_back(); } -- cgit v1.2.3