mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 11:33:03 +08:00
[vcpkg] Fix compilation on VS2015 (#13398)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
This commit is contained in:
parent
0d0a84694c
commit
a35ddddac8
@ -360,6 +360,10 @@ namespace vcpkg::Json
|
||||
std::vector<std::string> m_errors;
|
||||
struct Path
|
||||
{
|
||||
constexpr Path() = default;
|
||||
constexpr Path(int64_t i) : index(i) { }
|
||||
constexpr Path(StringView f) : field(f) { }
|
||||
|
||||
int64_t index = -1;
|
||||
StringView field;
|
||||
};
|
||||
@ -397,7 +401,7 @@ namespace vcpkg::Json
|
||||
return false;
|
||||
}
|
||||
|
||||
m_path.push_back({-1, key});
|
||||
m_path.push_back(key);
|
||||
Optional<Type> opt = internal_visit(*value, visitor);
|
||||
|
||||
if (auto val = opt.get())
|
||||
|
@ -490,6 +490,18 @@ namespace vcpkg
|
||||
constexpr StringLiteral FeatureDeserializer::DESCRIPTION;
|
||||
constexpr StringLiteral FeatureDeserializer::DEPENDENCIES;
|
||||
|
||||
static constexpr StringView EXPRESSION_WORDS[] = {
|
||||
"WITH",
|
||||
"AND",
|
||||
"OR",
|
||||
};
|
||||
static constexpr StringView VALID_LICENSES[] =
|
||||
#include "spdx-licenses.inc"
|
||||
;
|
||||
static constexpr StringView VALID_EXCEPTIONS[] =
|
||||
#include "spdx-licenses.inc"
|
||||
;
|
||||
|
||||
// We "parse" this so that we can add actual license parsing at some point in the future
|
||||
// without breaking anyone
|
||||
struct LicenseExpressionDeserializer : Json::IDeserializer<std::string>
|
||||
@ -503,18 +515,6 @@ namespace vcpkg
|
||||
ExpectException,
|
||||
};
|
||||
|
||||
constexpr static StringView EXPRESSION_WORDS[] = {
|
||||
"WITH",
|
||||
"AND",
|
||||
"OR",
|
||||
};
|
||||
constexpr static StringView VALID_LICENSES[] =
|
||||
#include "spdx-licenses.inc"
|
||||
;
|
||||
constexpr static StringView VALID_EXCEPTIONS[] =
|
||||
#include "spdx-licenses.inc"
|
||||
;
|
||||
|
||||
virtual Optional<std::string> visit_string(Json::Reader&, StringView sv) override
|
||||
{
|
||||
Mode mode = Mode::ExpectExpression;
|
||||
@ -630,10 +630,6 @@ namespace vcpkg
|
||||
}
|
||||
};
|
||||
|
||||
constexpr StringView LicenseExpressionDeserializer::EXPRESSION_WORDS[];
|
||||
constexpr StringView LicenseExpressionDeserializer::VALID_LICENSES[];
|
||||
constexpr StringView LicenseExpressionDeserializer::VALID_EXCEPTIONS[];
|
||||
|
||||
struct ManifestDeserializer : Json::IDeserializer<std::unique_ptr<SourceControlFile>>
|
||||
{
|
||||
virtual StringView type_name() const override { return "a manifest"; }
|
||||
|
Loading…
Reference in New Issue
Block a user