From 8ffb09a08a375e19208bbe65ba532ce1e462b74e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 21 Feb 2022 17:14:22 +0100 Subject: [PATCH] Fix macOS build --- .../resolve-system-dependencies.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/resolve-system-dependencies/resolve-system-dependencies.cc b/src/resolve-system-dependencies/resolve-system-dependencies.cc index 98c969437..4dd691981 100644 --- a/src/resolve-system-dependencies/resolve-system-dependencies.cc +++ b/src/resolve-system-dependencies/resolve-system-dependencies.cc @@ -23,9 +23,9 @@ Path resolveCacheFile(Path lib) return cacheDir + "/" + lib; } -std::set readCacheFile(const Path & file) +std::set readCacheFile(const Path & file) { - return tokenizeString>(readFile(file), "\n"); + return tokenizeString>(readFile(file), "\n"); } std::set runResolver(const Path & filename) @@ -81,7 +81,7 @@ std::set runResolver(const Path & filename) bool should_swap = magic == MH_CIGAM_64; ptrdiff_t cmd_offset = mach64_offset + sizeof(mach_header_64); - std::set libs; + std::set libs; for (uint32_t i = 0; i < DO_SWAP(should_swap, m_header->ncmds); i++) { load_command * cmd = (load_command *) (obj + cmd_offset); switch(DO_SWAP(should_swap, cmd->cmd)) { @@ -110,9 +110,9 @@ Path resolveSymlink(const Path & path) : concatStrings(dirOf(path), "/", target); } -std::set resolveTree(const Path & path, PathSet & deps) +std::set resolveTree(const Path & path, PathSet & deps) { - std::set results; + std::set results; if (!deps.insert(path).second) return {}; for (auto & lib : runResolver(path)) { results.insert(lib); @@ -123,7 +123,7 @@ std::set resolveTree(const Path & path, PathSet & deps) return results; } -std::set getPath(const Path & path) +std::set getPath(const Path & path) { if (hasPrefix(path, "/dev")) return {}; @@ -131,7 +131,7 @@ std::set getPath(const Path & path) if (pathExists(cacheFile)) return readCacheFile(cacheFile); - std::set deps, paths; + std::set deps, paths; paths.insert(path); Path nextPath(path); @@ -180,7 +180,7 @@ int main(int argc, char ** argv) impurePaths.insert("/usr/lib/libSystem.dylib"); } - std::set allPaths; + std::set allPaths; for (auto & path : impurePaths) for (auto & p : getPath(path))