diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2018-06-21 14:44:00 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2018-09-11 11:43:54 +0200 |
commit | 4a3c4edb59b6881a30056531bc71e52295ab1cb0 (patch) | |
tree | b1c466667efc84cd5f7345d977032155f315ec76 /include/mbgl/math | |
parent | 30e570aae7d2ba5522feafb962b334ef3f35459e (diff) | |
download | qtlocation-mapboxgl-4a3c4edb59b6881a30056531bc71e52295ab1cb0.tar.gz |
[android] add support for gnustl
Diffstat (limited to 'include/mbgl/math')
-rw-r--r-- | include/mbgl/math/log2.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/mbgl/math/log2.hpp b/include/mbgl/math/log2.hpp index 3136ac22b4..4f5fde60d1 100644 --- a/include/mbgl/math/log2.hpp +++ b/include/mbgl/math/log2.hpp @@ -15,6 +15,17 @@ namespace util { // (== number of bits required to store x) uint32_t ceil_log2(uint64_t x); +template <typename T> +T log2(T x) { +// log2() is producing wrong results on ARMv5 binaries +// running on ARMv7+ CPUs. +#if defined(__ANDROID__) + return ::log(x) / M_LN2; +#else + return ::log2(x); +#endif +} + } // namespace util } // namespace mbgl |