aboutsummaryrefslogtreecommitdiff
path: root/ports/azure-storage-cpp/pplx-do-while.patch
diff options
context:
space:
mode:
authorWimok Nupphiboon <wimok.mok@gmail.com>2018-04-22 20:35:52 +0700
committerWimok Nupphiboon <wimok.mok@gmail.com>2018-04-22 20:35:52 +0700
commitbefd3c6be2db90e5bc3a7acb2b0103cb6dfd7b42 (patch)
treefd4cfee016003e6be2898ac5d37f679a567cad76 /ports/azure-storage-cpp/pplx-do-while.patch
parent4c028691c7f03335f6fb8a38ce80794c213819cb (diff)
parent4f52f53b99f6a5465157958bc99f79cc0b2712ad (diff)
downloadvcpkg-befd3c6be2db90e5bc3a7acb2b0103cb6dfd7b42.tar.gz
vcpkg-befd3c6be2db90e5bc3a7acb2b0103cb6dfd7b42.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'ports/azure-storage-cpp/pplx-do-while.patch')
-rw-r--r--ports/azure-storage-cpp/pplx-do-while.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/ports/azure-storage-cpp/pplx-do-while.patch b/ports/azure-storage-cpp/pplx-do-while.patch
new file mode 100644
index 000000000..0c2163442
--- /dev/null
+++ b/ports/azure-storage-cpp/pplx-do-while.patch
@@ -0,0 +1,52 @@
+diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h
+index 756163d..6fbfd44 100644
+--- a/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h
++++ b/Microsoft.WindowsAzure.Storage/includes/wascore/executor.h
+@@ -366,7 +366,7 @@ namespace azure { namespace storage { namespace core {
+ // TODO: Reduce usage of auto variable types
+
+ auto instance = std::make_shared<executor_impl>(command, options, context);
+- return pplx::details::do_while([instance]() -> pplx::task<bool>
++ return details::_do_while([instance]() -> pplx::task<bool>
+ {
+ // 0. Begin request
+ instance->validate_location_mode();
+diff --git a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h
+index f3401f2..6a6aa48 100644
+--- a/Microsoft.WindowsAzure.Storage/includes/wascore/util.h
++++ b/Microsoft.WindowsAzure.Storage/includes/wascore/util.h
+@@ -127,6 +127,21 @@ namespace azure { namespace storage { namespace core {
+ };
+ #endif
+
++ namespace details
++ {
++ template<class F, class T = bool>
++ pplx::task<T> _do_while(F func)
++ {
++ pplx::task<T> first = func();
++ return first.then([=](bool guard) -> pplx::task<T> {
++ if (guard)
++ return azure::storage::core::details::_do_while<F,T>(func);
++ else
++ return first;
++ });
++ }
++ }
++
+ }}} // namespace azure::storage::core
+
+ #pragma pop_macro("max")
+diff --git a/Microsoft.WindowsAzure.Storage/src/util.cpp b/Microsoft.WindowsAzure.Storage/src/util.cpp
+index dd2250a..b8d1341 100644
+--- a/Microsoft.WindowsAzure.Storage/src/util.cpp
++++ b/Microsoft.WindowsAzure.Storage/src/util.cpp
+@@ -98,7 +98,7 @@ namespace azure { namespace storage { namespace core {
+ auto obuffer = ostream.streambuf();
+ auto length_ptr = (length != std::numeric_limits<utility::size64_t>::max()) ? std::make_shared<utility::size64_t>(length) : nullptr;
+ auto total_ptr = std::make_shared<utility::size64_t>(0);
+- return pplx::details::do_while([istream, obuffer, buffer_size, length_ptr, total_ptr, max_length] () -> pplx::task<bool>
++ return azure::storage::core::details::_do_while([istream, obuffer, buffer_size, length_ptr, total_ptr, max_length] () -> pplx::task<bool>
+ {
+ size_t read_length = buffer_size;
+ if ((length_ptr != nullptr) && (*length_ptr < read_length))