summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <thiago@mapbox.com>2016-12-20 14:54:48 -0200
committerThiago Marcos P. Santos <thiago@mapbox.com>2017-01-24 11:36:59 +0200
commit4dd6b704223e14762fb68b23f29ad9d644bfcc93 (patch)
treeb6450a3b79b6658e0357ff85ad95ddabb2e1b280
parent74d362337db29de8864bcdd7a97b299216247b19 (diff)
downloadqtlocation-mapboxgl-4dd6b704223e14762fb68b23f29ad9d644bfcc93.tar.gz
[gcc4.9] Make geometry.hpp GCC4.9 compatible
-rw-r--r--src/3rd_party/geometry.hpp/include/mapbox/geometry/geometry.hpp2
-rw-r--r--src/3rd_party/geometry.hpp/include/mapbox/geometry/point_arithmetic.hpp39
2 files changed, 25 insertions, 16 deletions
diff --git a/src/3rd_party/geometry.hpp/include/mapbox/geometry/geometry.hpp b/src/3rd_party/geometry.hpp/include/mapbox/geometry/geometry.hpp
index a3970bf89b..72e470084d 100644
--- a/src/3rd_party/geometry.hpp/include/mapbox/geometry/geometry.hpp
+++ b/src/3rd_party/geometry.hpp/include/mapbox/geometry/geometry.hpp
@@ -37,7 +37,9 @@ struct geometry : geometry_base<T>
* The default constructor would create a point geometry with default-constructed coordinates;
* i.e. (0, 0). Since this is not particularly useful, and could hide bugs, it is disabled.
*/
+#if !defined(__GNUC__) || __GNUC__ >= 5
geometry() = delete;
+#endif
};
template <typename T, template <typename...> class Cont>
diff --git a/src/3rd_party/geometry.hpp/include/mapbox/geometry/point_arithmetic.hpp b/src/3rd_party/geometry.hpp/include/mapbox/geometry/point_arithmetic.hpp
index 3940e5b52c..ca7586f486 100644
--- a/src/3rd_party/geometry.hpp/include/mapbox/geometry/point_arithmetic.hpp
+++ b/src/3rd_party/geometry.hpp/include/mapbox/geometry/point_arithmetic.hpp
@@ -1,58 +1,65 @@
#pragma once
+// GCC 4.9 compatibility
+#if !defined(__GNUC__) || __GNUC__ >= 5
+#define GEOMETRYHPP_CONSTEXPR constexpr
+#else
+#define GEOMETRYHPP_CONSTEXPR inline
+#endif
+
namespace mapbox {
namespace geometry {
template <typename T>
-constexpr point<T> operator+(point<T> const& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator+(point<T> const& lhs, point<T> const& rhs)
{
return point<T>(lhs.x + rhs.x, lhs.y + rhs.y);
}
template <typename T>
-constexpr point<T> operator+(point<T> const& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator+(point<T> const& lhs, T const& rhs)
{
return point<T>(lhs.x + rhs, lhs.y + rhs);
}
template <typename T>
-constexpr point<T> operator-(point<T> const& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator-(point<T> const& lhs, point<T> const& rhs)
{
return point<T>(lhs.x - rhs.x, lhs.y - rhs.y);
}
template <typename T>
-constexpr point<T> operator-(point<T> const& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator-(point<T> const& lhs, T const& rhs)
{
return point<T>(lhs.x - rhs, lhs.y - rhs);
}
template <typename T>
-constexpr point<T> operator*(point<T> const& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator*(point<T> const& lhs, point<T> const& rhs)
{
return point<T>(lhs.x * rhs.x, lhs.y * rhs.y);
}
template <typename T>
-constexpr point<T> operator*(point<T> const& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator*(point<T> const& lhs, T const& rhs)
{
return point<T>(lhs.x * rhs, lhs.y * rhs);
}
template <typename T>
-constexpr point<T> operator/(point<T> const& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator/(point<T> const& lhs, point<T> const& rhs)
{
return point<T>(lhs.x / rhs.x, lhs.y / rhs.y);
}
template <typename T>
-constexpr point<T> operator/(point<T> const& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T> operator/(point<T> const& lhs, T const& rhs)
{
return point<T>(lhs.x / rhs, lhs.y / rhs);
}
template <typename T>
-constexpr point<T>& operator+=(point<T>& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator+=(point<T>& lhs, point<T> const& rhs)
{
lhs.x += rhs.x;
lhs.y += rhs.y;
@@ -60,7 +67,7 @@ constexpr point<T>& operator+=(point<T>& lhs, point<T> const& rhs)
}
template <typename T>
-constexpr point<T>& operator+=(point<T>& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator+=(point<T>& lhs, T const& rhs)
{
lhs.x += rhs;
lhs.y += rhs;
@@ -68,7 +75,7 @@ constexpr point<T>& operator+=(point<T>& lhs, T const& rhs)
}
template <typename T>
-constexpr point<T>& operator-=(point<T>& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator-=(point<T>& lhs, point<T> const& rhs)
{
lhs.x -= rhs.x;
lhs.y -= rhs.y;
@@ -76,7 +83,7 @@ constexpr point<T>& operator-=(point<T>& lhs, point<T> const& rhs)
}
template <typename T>
-constexpr point<T>& operator-=(point<T>& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator-=(point<T>& lhs, T const& rhs)
{
lhs.x -= rhs;
lhs.y -= rhs;
@@ -84,7 +91,7 @@ constexpr point<T>& operator-=(point<T>& lhs, T const& rhs)
}
template <typename T>
-constexpr point<T>& operator*=(point<T>& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator*=(point<T>& lhs, point<T> const& rhs)
{
lhs.x *= rhs.x;
lhs.y *= rhs.y;
@@ -92,7 +99,7 @@ constexpr point<T>& operator*=(point<T>& lhs, point<T> const& rhs)
}
template <typename T>
-constexpr point<T>& operator*=(point<T>& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator*=(point<T>& lhs, T const& rhs)
{
lhs.x *= rhs;
lhs.y *= rhs;
@@ -100,7 +107,7 @@ constexpr point<T>& operator*=(point<T>& lhs, T const& rhs)
}
template <typename T>
-constexpr point<T>& operator/=(point<T>& lhs, point<T> const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator/=(point<T>& lhs, point<T> const& rhs)
{
lhs.x /= rhs.x;
lhs.y /= rhs.y;
@@ -108,7 +115,7 @@ constexpr point<T>& operator/=(point<T>& lhs, point<T> const& rhs)
}
template <typename T>
-constexpr point<T>& operator/=(point<T>& lhs, T const& rhs)
+GEOMETRYHPP_CONSTEXPR point<T>& operator/=(point<T>& lhs, T const& rhs)
{
lhs.x /= rhs;
lhs.y /= rhs;