From 4a3c4edb59b6881a30056531bc71e52295ab1cb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 21 Jun 2018 14:44:00 +0200 Subject: [android] add support for gnustl --- include/mbgl/math/log2.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'include') 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 +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 -- cgit v1.2.1