[android] #5254 - fix ARMv5 support

Backported patches fixing ARMv5 support for issue #3985.
This commit is contained in:
Thiago Marcos P. Santos
2016-06-06 16:18:46 +03:00
parent f4a82bd367
commit b711979e32
19 changed files with 97 additions and 36 deletions

View File

@@ -21,5 +21,15 @@ uint32_t ceil_log2(uint64_t x) {
return y;
}
double log2(double x) {
// log2() is producing wrong results on ARMv5 binaries
// running on ARMv7+ CPUs.
#if defined(__ANDROID__) && defined(__ARM_ARCH_5TE__)
return std::log(x) / 0.6931471805599453; // log(x) / log(2)
#else
return ::log2(x);
#endif
}
} // namespace util
} // namespace mbgl
} // namespace mbgl