summaryrefslogtreecommitdiff
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-20 00:31:11 +0300
commit921e17148a05931828594a4fcf8519195decb3cb (patch)
tree8cced87f82c14e30d90b077bb17331f508b65cb6
parent5d7e3e24e565afffe2bc9db5029286b167f039ed (diff)
downloadqtlocation-mapboxgl-upstream/qnx_erros.tar.gz
Fix compilation errors with libc++ on QNX 7upstream/qnx_erros
This patch fixes the compilation errors on QNX 7: 1) It seems that the 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. Fix the issues by providing the required constructors explicitly. 2) Resolve an ambiguous overload error with optional<T> 3) Remove use of noncopyable in Context
-rw-r--r--include/mbgl/style/expression/compound_expression.hpp5
-rw-r--r--src/mbgl/gl/context.hpp5
-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
-rw-r--r--src/mbgl/tile/geometry_tile_data.hpp16
-rw-r--r--test/api/recycle_map.cpp2
7 files changed, 32 insertions, 26 deletions
diff --git a/include/mbgl/style/expression/compound_expression.hpp b/include/mbgl/style/expression/compound_expression.hpp
index 9d39194563..0e37875394 100644
--- a/include/mbgl/style/expression/compound_expression.hpp
+++ b/include/mbgl/style/expression/compound_expression.hpp
@@ -33,7 +33,10 @@ namespace expression {
*/
struct VarargsType { type::Type type; };
template <typename T>
-struct Varargs : std::vector<T> { using std::vector<T>::vector; };
+struct Varargs : std::vector<T> {
+ template <class... Args>
+ Varargs(Args&&... args) : std::vector<T>(std::forward<Args>(args)...) {}
+};
namespace detail {
// Base class for the Signature<Fn> structs that are used to determine
diff --git a/src/mbgl/gl/context.hpp b/src/mbgl/gl/context.hpp
index d95311115e..662930d5b1 100644
--- a/src/mbgl/gl/context.hpp
+++ b/src/mbgl/gl/context.hpp
@@ -36,7 +36,7 @@ class Debugging;
class ProgramBinary;
} // namespace extension
-class Context : private util::noncopyable {
+class Context {
public:
Context();
~Context();
@@ -298,6 +298,9 @@ private:
std::vector<FramebufferID> abandonedFramebuffers;
std::vector<RenderbufferID> abandonedRenderbuffers;
+ Context(const Context&) = delete;
+ Context& operator=(const Context& other) = delete;
+
public:
// For testing and Windows because Qt + ANGLE
// crashes with VAO enabled.
diff --git a/src/mbgl/style/expression/interpolate.cpp b/src/mbgl/style/expression/interpolate.cpp
index a9bb3bf05e..31fd360fa9 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 59123c9812..2107b42a13 100644
--- a/src/mbgl/style/expression/match.cpp
+++ b/src/mbgl/style/expression/match.cpp
@@ -137,7 +137,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) {
@@ -145,7 +145,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) {
@@ -155,7 +155,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 f42a2721a9..c2113dd1c3 100644
--- a/src/mbgl/style/expression/step.cpp
+++ b/src/mbgl/style/expression/step.cpp
@@ -126,23 +126,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&) {}
diff --git a/src/mbgl/tile/geometry_tile_data.hpp b/src/mbgl/tile/geometry_tile_data.hpp
index 449d8cab28..bd64a1d153 100644
--- a/src/mbgl/tile/geometry_tile_data.hpp
+++ b/src/mbgl/tile/geometry_tile_data.hpp
@@ -22,19 +22,19 @@ class GeometryCoordinates : public std::vector<GeometryCoordinate> {
public:
using coordinate_type = int16_t;
- GeometryCoordinates() = default;
- GeometryCoordinates(const std::vector<GeometryCoordinate>& v)
- : std::vector<GeometryCoordinate>(v) {}
- GeometryCoordinates(std::vector<GeometryCoordinate>&& v)
- : std::vector<GeometryCoordinate>(std::move(v)) {}
-
- using std::vector<GeometryCoordinate>::vector;
+ template <class... Args>
+ GeometryCoordinates(Args&&... args) : std::vector<GeometryCoordinate>(std::forward<Args>(args)...) {}
+ GeometryCoordinates(std::initializer_list<GeometryCoordinate> args)
+ : std::vector<GeometryCoordinate>(std::move(args)) {}
};
class GeometryCollection : public std::vector<GeometryCoordinates> {
public:
using coordinate_type = int16_t;
- using std::vector<GeometryCoordinates>::vector;
+ template <class... Args>
+ GeometryCollection(Args&&... args) : std::vector<GeometryCoordinates>(std::forward<Args>(args)...) {}
+ GeometryCollection(std::initializer_list<GeometryCoordinates> args)
+ : std::vector<GeometryCoordinates>(std::move(args)) {}
};
class GeometryTileFeature {
diff --git a/test/api/recycle_map.cpp b/test/api/recycle_map.cpp
index ca6abac8c1..fc7e5223ec 100644
--- a/test/api/recycle_map.cpp
+++ b/test/api/recycle_map.cpp
@@ -35,7 +35,7 @@ TEST(API, RecycleMapUpdateImages) {
auto loadStyle = [&](auto markerName, auto markerPath) {
auto source = std::make_unique<GeoJSONSource>("geometry");
- source->setGeoJSON({ Point<double> { 0, 0 } });
+ source->setGeoJSON( Geometry<double>{ Point<double>{ 0, 0 } } );
auto layer = std::make_unique<SymbolLayer>("geometry", "geometry");
layer->setIconImage({ markerName });