diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2014-08-21 15:46:20 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2014-08-21 15:46:20 +0200 |
commit | 1fa3a3e85ae9ca247b61cd6bede0948dec0a641a (patch) | |
tree | 17171e82496da1a6b98b630e66ef02e7cc72c0a2 | |
parent | b9c7e1bdd99b4c6d37672ef34ffe178d4bc54ad3 (diff) | |
download | qtlocation-mapboxgl-1fa3a3e85ae9ca247b61cd6bede0948dec0a641a.tar.gz |
add a few fixes for gcc
fixes #437
-rw-r--r-- | include/mbgl/text/collision.hpp | 3 | ||||
-rw-r--r-- | include/mbgl/text/types.hpp | 2 | ||||
-rw-r--r-- | include/mbgl/util/threadpool.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/util/utf.hpp | 6 | ||||
-rw-r--r-- | include/mbgl/util/vec.hpp | 2 | ||||
-rw-r--r-- | src/text/collision.cpp | 4 | ||||
-rw-r--r-- | src/text/rotation_range.cpp | 2 |
7 files changed, 10 insertions, 10 deletions
diff --git a/include/mbgl/text/collision.hpp b/include/mbgl/text/collision.hpp index 7e65e979da..8eec30f216 100644 --- a/include/mbgl/text/collision.hpp +++ b/include/mbgl/text/collision.hpp @@ -5,8 +5,9 @@ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#ifdef __clang__ #pragma GCC diagnostic ignored "-Wdeprecated-register" -#ifndef __clang__ +#else #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif diff --git a/include/mbgl/text/types.hpp b/include/mbgl/text/types.hpp index e2539bff62..dbb483ea8f 100644 --- a/include/mbgl/text/types.hpp +++ b/include/mbgl/text/types.hpp @@ -101,7 +101,7 @@ struct PlacementProperty { : zoom(zoom), rotationRange(rotationRange) {} inline operator bool() const { - return !isnan(zoom) && zoom != std::numeric_limits<float>::infinity() && + return !std::isnan(zoom) && zoom != std::numeric_limits<float>::infinity() && rotationRange[0] != rotationRange[1]; } diff --git a/include/mbgl/util/threadpool.hpp b/include/mbgl/util/threadpool.hpp index 497d4e3083..ff913ec508 100644 --- a/include/mbgl/util/threadpool.hpp +++ b/include/mbgl/util/threadpool.hpp @@ -4,6 +4,7 @@ #include <pthread.h> #include <forward_list> #include <queue> +#include <memory> namespace mbgl { namespace util { diff --git a/include/mbgl/util/utf.hpp b/include/mbgl/util/utf.hpp index 5dfc4ad2d1..fa21df74c0 100644 --- a/include/mbgl/util/utf.hpp +++ b/include/mbgl/util/utf.hpp @@ -4,11 +4,9 @@ #include <memory> // g++/libstdc++ is missing c++11 codecvt support -#ifdef __linux__ -#pragma GCC diagnostic push #ifndef __clang__ +#pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#endif #include <boost/locale.hpp> #pragma GCC diagnostic pop #else @@ -20,7 +18,7 @@ namespace mbgl { namespace util { -#ifdef __linux__ +#ifndef __clang__ class utf8_to_utf32 { public: diff --git a/include/mbgl/util/vec.hpp b/include/mbgl/util/vec.hpp index 0b9bf63d53..a5fbee477b 100644 --- a/include/mbgl/util/vec.hpp +++ b/include/mbgl/util/vec.hpp @@ -71,7 +71,7 @@ struct vec2 { template<typename U = T, typename std::enable_if<std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> inline operator bool() const { - return !isnan(x) && !isnan(y); + return !std::isnan(x) && !std::isnan(y); } template<typename U = T, typename std::enable_if<!std::numeric_limits<U>::has_quiet_NaN, int>::type = 0> diff --git a/src/text/collision.cpp b/src/text/collision.cpp index 89e91d6844..6326bea825 100644 --- a/src/text/collision.cpp +++ b/src/text/collision.cpp @@ -166,10 +166,10 @@ float Collision::getPlacementScale(const GlyphBoxes &glyphs, float minPlacementS float s4 = (ob.br.y - nb.tl.y + padding) / (na.y - oa.y); // scale at which new box is to the bottom of old box - if (isnan(s1) || isnan(s2)) { + if (std::isnan(s1) || std::isnan(s2)) { s1 = s2 = 1; } - if (isnan(s3) || isnan(s4)) { + if (std::isnan(s3) || std::isnan(s4)) { s3 = s4 = 1; } diff --git a/src/text/rotation_range.cpp b/src/text/rotation_range.cpp index 3ebdfe91cb..664ea9c709 100644 --- a/src/text/rotation_range.cpp +++ b/src/text/rotation_range.cpp @@ -95,7 +95,7 @@ rotatingRotatingCollisions(const CollisionRect &a, const CollisionRect &b, std::vector<float> f; for (size_t i = 0; i < c.size(); i++) { // Check if they are close enough to collide - if (!isnan(c[i]) && d_sq <= e[i]) { + if (!std::isnan(c[i]) && d_sq <= e[i]) { // So far, angles have been calulated as relative to the vector // between anchors. // Convert the angles to angles from north. |