aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBilly O'Neal <bion@microsoft.com>2020-06-11 17:47:18 -0700
committerGitHub <noreply@github.com>2020-06-11 17:47:18 -0700
commit9efc1318dd055b09c9a8d20ff0045822c3cccc44 (patch)
tree318f1fcd8030c889882fa6b3512a9a04024b557d
parentc704058346b89b8f7b2c68f3162f0d4a86a47c0d (diff)
downloadvcpkg-9efc1318dd055b09c9a8d20ff0045822c3cccc44.tar.gz
vcpkg-9efc1318dd055b09c9a8d20ff0045822c3cccc44.zip
[vcpkg] Fix bootstrap on VS2015 (#11891)
* Fix boostrap on VS2015 by removing use of C++17 constexpr lambdas.
-rw-r--r--toolsrc/src/vcpkg/metrics.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/toolsrc/src/vcpkg/metrics.cpp b/toolsrc/src/vcpkg/metrics.cpp
index d1acbed99..e2661d98a 100644
--- a/toolsrc/src/vcpkg/metrics.cpp
+++ b/toolsrc/src/vcpkg/metrics.cpp
@@ -30,6 +30,14 @@ namespace vcpkg::Metrics
return "";
}
+ struct append_hexits {
+ constexpr static char hex[17] = "0123456789abcdef";
+ void operator()(std::string& res, std::uint8_t bits) const {
+ res.push_back(hex[(bits >> 4) & 0x0F]);
+ res.push_back(hex[(bits >> 0) & 0x0F]);
+ }
+ };
+
// note: this ignores the bits of these numbers that would be where format and variant go
static std::string uuid_of_integers(uint64_t top, uint64_t bottom)
{
@@ -40,11 +48,7 @@ namespace vcpkg::Metrics
// uuid_field_size in hex characters, not bytes
constexpr size_t uuid_size = 8 + 1 + 4 + 1 + 4 + 1 + 4 + 1 + 12;
- constexpr static char hex[17] = "0123456789abcdef";
- constexpr static auto write_byte = [](std::string& res, std::uint8_t bits) {
- res.push_back(hex[(bits >> 4) & 0x0F]);
- res.push_back(hex[(bits >> 0) & 0x0F]);
- };
+ constexpr static append_hexits write_byte;
// set the version bits to 4
top &= 0xFFFF'FFFF'FFFF'0FFFULL;