From 556ca517abbf036ac9121f9910a809875d91ca6a Mon Sep 17 00:00:00 2001 From: Vince Harron Date: Sun, 24 May 2015 13:24:31 +0000 Subject: [PATCH] Remove log2 dependency when building against Android API-9 SDK Android's API-9 SDK is missing log2 builtins. A previous commit added support for building against this API revision but this requires log2l to be present. (And it doesn't seem to be defined, despite being in the headers.) Author: pasaulais (Pierre-Andre Saulais) Differential Revision: http://reviews.llvm.org/D9884 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@238111 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Support/MathExtras.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/llvm/Support/MathExtras.h b/include/llvm/Support/MathExtras.h index 340dc934934..e3166165a48 100644 --- a/include/llvm/Support/MathExtras.h +++ b/include/llvm/Support/MathExtras.h @@ -456,7 +456,7 @@ inline unsigned countPopulation(T Value) { /// Log2 - This function returns the log base 2 of the specified value inline double Log2(double Value) { #if defined(__ANDROID_API__) && __ANDROID_API__ < 18 - return (double)__builtin_log2l(Value); + return __builtin_log(Value) / __builtin_log(2.0); #else return log2(Value); #endif