summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiago Marcos P. Santos <tmpsantos@gmail.com>2017-07-31 15:53:23 +0300
committerThiago Marcos P. Santos <tmpsantos@gmail.com>2017-08-07 17:20:33 +0300
commit2108763010cd4f5634129875c58940d279bde319 (patch)
treea453270b888e1cd48e925fa5a6705129d69918d1
parentcaea48658753db49174ecdfbf0af7510208b846e (diff)
downloadqtlocation-mapboxgl-2108763010cd4f5634129875c58940d279bde319.tar.gz
[core] Remove std:: namespace for some functions
They are not available on Android + GCC (needed by Qt)
-rw-r--r--include/mbgl/math/log2.hpp4
-rw-r--r--platform/qt/src/qmapboxgl.cpp5
-rw-r--r--src/mbgl/util/math.hpp2
3 files changed, 6 insertions, 5 deletions
diff --git a/include/mbgl/math/log2.hpp b/include/mbgl/math/log2.hpp
index 8a3bc7f1c0..53d5e45545 100644
--- a/include/mbgl/math/log2.hpp
+++ b/include/mbgl/math/log2.hpp
@@ -17,9 +17,9 @@ typename std::enable_if_t<std::is_floating_point<T>::value, T> log2(T x)
// log2() is producing wrong results on ARMv5 binaries
// running on ARMv7+ CPUs.
#if defined(__ANDROID__)
- return std::log(x) / M_LN2;
+ return ::log(x) / M_LN2;
#else
- return std::log2(x);
+ return ::log2(x);
#endif
}
diff --git a/platform/qt/src/qmapboxgl.cpp b/platform/qt/src/qmapboxgl.cpp
index eeb0bece12..c7c4cf1e4a 100644
--- a/platform/qt/src/qmapboxgl.cpp
+++ b/platform/qt/src/qmapboxgl.cpp
@@ -8,6 +8,7 @@
#include <mbgl/annotation/annotation.hpp>
#include <mbgl/map/camera.hpp>
#include <mbgl/map/map.hpp>
+#include <mbgl/math/log2.hpp>
#include <mbgl/math/minmax.hpp>
#include <mbgl/style/style.hpp>
#include <mbgl/style/conversion.hpp>
@@ -583,7 +584,7 @@ double QMapboxGL::scale() const
void QMapboxGL::setScale(double scale_, const QPointF &center)
{
- d_ptr->mapObj->setZoom(std::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
+ d_ptr->mapObj->setZoom(mbgl::util::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
}
/*!
@@ -991,7 +992,7 @@ void QMapboxGL::moveBy(const QPointF &offset)
can be used for implementing a pinch gesture.
*/
void QMapboxGL::scaleBy(double scale_, const QPointF &center) {
- d_ptr->mapObj->setZoom(d_ptr->mapObj->getZoom() + std::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
+ d_ptr->mapObj->setZoom(d_ptr->mapObj->getZoom() + mbgl::util::log2(scale_), mbgl::ScreenCoordinate { center.x(), center.y() });
}
/*!
diff --git a/src/mbgl/util/math.hpp b/src/mbgl/util/math.hpp
index eb3c7d0fde..fcde01c1a3 100644
--- a/src/mbgl/util/math.hpp
+++ b/src/mbgl/util/math.hpp
@@ -112,7 +112,7 @@ inline T division(const T dividend, const T divisor, const T nan) {
if (dividend == 0) {
return nan;
} else {
- return std::copysign(std::numeric_limits<T>::infinity(), dividend);
+ return ::copysign(std::numeric_limits<T>::infinity(), dividend);
}
} else {
return dividend / divisor;