From f990dfaa5ba82155f95b75021453c075816fd4be Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Fri, 26 Jul 2019 16:32:33 -0700 Subject: [vcpkg] Fix RealFilesystem::remove_all (#7430) * fix remove_all we were attempting to remove READONLY files before this, and so set them to non-READONLY * fix linux/macos support * whee fix vs2015 --- toolsrc/include/vcpkg/base/files.h | 2 +- toolsrc/include/vcpkg/base/work_queue.h | 20 +++++++++++++------- 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'toolsrc/include') diff --git a/toolsrc/include/vcpkg/base/files.h b/toolsrc/include/vcpkg/base/files.h index a5e04db25..ae699036c 100644 --- a/toolsrc/include/vcpkg/base/files.h +++ b/toolsrc/include/vcpkg/base/files.h @@ -31,7 +31,7 @@ namespace fs struct symlink_status_t { file_status operator()(const path& p, std::error_code& ec) const noexcept; - file_status operator()(const path& p, vcpkg::LineInfo li) const noexcept; + file_status operator()(vcpkg::LineInfo li, const path& p) const noexcept; }; struct is_symlink_t { diff --git a/toolsrc/include/vcpkg/base/work_queue.h b/toolsrc/include/vcpkg/base/work_queue.h index 70142e110..1c49cc1a7 100644 --- a/toolsrc/include/vcpkg/base/work_queue.h +++ b/toolsrc/include/vcpkg/base/work_queue.h @@ -12,17 +12,23 @@ namespace vcpkg namespace detail { // for SFINAE purposes, keep out of the class - template - auto call_moved_action(Action& action, + // also this sfinae is so weird because Backwards Compatibility with VS2015 + template()(std::declval(), + std::declval&>()))> + void call_moved_action(Action& action, const WorkQueue& work_queue, - ThreadLocalData& tld) -> decltype(static_cast(std::move(action)(tld, work_queue))) + ThreadLocalData& tld) { std::move(action)(tld, work_queue); } - template - auto call_moved_action(Action& action, const WorkQueue&, ThreadLocalData& tld) - -> decltype(static_cast(std::move(action)(tld))) + template()(std::declval())), + class = void> + void call_moved_action(Action& action, const WorkQueue&, ThreadLocalData& tld) { std::move(action)(tld); } @@ -32,7 +38,7 @@ namespace vcpkg struct WorkQueue { template - WorkQueue(std::uint16_t num_threads, LineInfo li, const F& tld_init) noexcept + WorkQueue(LineInfo li, std::uint16_t num_threads, const F& tld_init) noexcept { m_line_info = li; -- cgit v1.2.3