[android] #5254 - fix ARMv5 support
Backported patches fixing ARMv5 support for issue #3985.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user