From 6b83c85154cf7c1f3237479430fe9623d59a8094 Mon Sep 17 00:00:00 2001 From: Anton Kolesnyk <41349689+antkmsft@users.noreply.github.com> Date: Sat, 6 Mar 2021 18:04:25 -0800 Subject: [PATCH] Fix build on VS2017 (#1808) * VS2017 is right, we should be including ``, if we use `std::inserter`. It fails to compile on VS2017 without that include. Why if fails on 2017 and not 2019? Some of the other stdlib headers we include must be including `` indirectly in 2019. But we should not be relying on that. Standard says, you use `std::inserter` - include ``, if it works without that, that's a coincidence which may break beween versions of stdlib/compilers. * VS 2017 does not fail because we don't include `` here, but formally we should include it too, because we use `std::remove_reference` and `std::remove_const`. It just happens that `log.hpp` includes it, but we should not be relying on that. This was found during local vcpkg verification - I happen to have it configured targeting VS2017. It does not mean it will fail in vcpkg CI, or would affect many customers, but some for sure. Verification on vcpkg CI looks good - https://github.com/microsoft/vcpkg/pull/16578 (it is based on our master as of Sat 3/6 + this fix). I verified locally that it builds successfully on `x64-windows`, `x64-windows-static`, and `arm-uwp`. We should run verification once again, once we have all the renames/moves in master. --- sdk/core/azure-core/src/http/log_policy.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sdk/core/azure-core/src/http/log_policy.cpp b/sdk/core/azure-core/src/http/log_policy.cpp index a5047989f..1633f40d6 100644 --- a/sdk/core/azure-core/src/http/log_policy.cpp +++ b/sdk/core/azure-core/src/http/log_policy.cpp @@ -6,7 +6,9 @@ #include #include +#include #include +#include using Azure::Core::Context; using namespace Azure::Core::Http;