summaryrefslogtreecommitdiff
path: root/src/mbgl/style
diff options
context:
space:
mode:
authorSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2018-07-09 11:18:30 +0300
committerSudarsana Babu Nagineni <sudarsana.babu@mapbox.com>2018-07-30 12:38:24 +0300
commit15a1c7b71f276b558f028eabae53456f444cebbc (patch)
treea4b3ada175c2e43101f75fc1ba6c7eaf27d2993f /src/mbgl/style
parentf05199e2d94a085c615aea96c867280e88a6ef6e (diff)
downloadqtlocation-mapboxgl-15a1c7b71f276b558f028eabae53456f444cebbc.tar.gz
Fix compilation errors with libc++ on QNX 7
This patch fixes the compilation errors on QNX 7: 1) QNX 7 compiler (i.e qcc based GCC 5.4.0 with libc++ from LLVM) has a limited c++11 feature support and causing the compilation errors with the inheriting constructors. This fixes the issues by providing the required constructors explicitly. 2) Resolves an ambiguous overload error with optional<T>
Diffstat (limited to 'src/mbgl/style')
-rw-r--r--src/mbgl/style/expression/interpolate.cpp12
-rw-r--r--src/mbgl/style/expression/match.cpp6
-rw-r--r--src/mbgl/style/expression/step.cpp12
3 files changed, 15 insertions, 15 deletions
diff --git a/src/mbgl/style/expression/interpolate.cpp b/src/mbgl/style/expression/interpolate.cpp
index 852042382c..54fbc6e1d7 100644
--- a/src/mbgl/style/expression/interpolate.cpp
+++ b/src/mbgl/style/expression/interpolate.cpp
@@ -170,23 +170,23 @@ ParseResult parseInterpolate(const Convertible& value, ParsingContext& ctx) {
labelValue->match(
[&](uint64_t n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{static_cast<double>(n)};
}
},
[&](int64_t n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{static_cast<double>(n)};
}
},
[&](double n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{n};
}
},
[&](const auto&) {}
diff --git a/src/mbgl/style/expression/match.cpp b/src/mbgl/style/expression/match.cpp
index 340f1dab4d..4b4984811f 100644
--- a/src/mbgl/style/expression/match.cpp
+++ b/src/mbgl/style/expression/match.cpp
@@ -138,7 +138,7 @@ optional<InputType> parseInputValue(const Convertible& input, ParsingContext& pa
parentContext.error("Branch labels must be integers no larger than " + util::toString(Value::maxSafeInteger()) + ".", index);
} else {
type = {type::Number};
- result = {static_cast<int64_t>(n)};
+ result = optional<InputType>{static_cast<int64_t>(n)};
}
},
[&] (int64_t n) {
@@ -146,7 +146,7 @@ optional<InputType> parseInputValue(const Convertible& input, ParsingContext& pa
parentContext.error("Branch labels must be integers no larger than " + util::toString(Value::maxSafeInteger()) + ".", index);
} else {
type = {type::Number};
- result = {n};
+ result = optional<InputType>{n};
}
},
[&] (double n) {
@@ -156,7 +156,7 @@ optional<InputType> parseInputValue(const Convertible& input, ParsingContext& pa
parentContext.error("Numeric branch labels must be integer values.", index);
} else {
type = {type::Number};
- result = {static_cast<int64_t>(n)};
+ result = optional<InputType>{static_cast<int64_t>(n)};
}
},
[&] (const std::string& s) {
diff --git a/src/mbgl/style/expression/step.cpp b/src/mbgl/style/expression/step.cpp
index ee6055091e..a1ca0a702e 100644
--- a/src/mbgl/style/expression/step.cpp
+++ b/src/mbgl/style/expression/step.cpp
@@ -127,23 +127,23 @@ ParseResult Step::parse(const mbgl::style::conversion::Convertible& value, Parsi
labelValue->match(
[&](uint64_t n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{static_cast<double>(n)};
}
},
[&](int64_t n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{static_cast<double>(n)};
}
},
[&](double n) {
if (n > std::numeric_limits<double>::max()) {
- label = {std::numeric_limits<double>::infinity()};
+ label = optional<double>{std::numeric_limits<double>::infinity()};
} else {
- label = {static_cast<double>(n)};
+ label = optional<double>{n};
}
},
[&](const auto&) {}