diff options
-rw-r--r-- | lib/atomic-arm.c | 3 | ||||
-rw-r--r-- | lib/atomic.c | 4 | ||||
-rw-r--r-- | lib/int_math.h | 6 |
3 files changed, 13 insertions, 0 deletions
diff --git a/lib/atomic-arm.c b/lib/atomic-arm.c index 13d3b539d..648734477 100644 --- a/lib/atomic-arm.c +++ b/lib/atomic-arm.c @@ -289,6 +289,7 @@ int32_t android_atomic_nand_and_fetch (volatile int32_t *ptr, int32_t val) } #endif +#if !defined(__clang__) // gcc compatible interface // http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/_005f_005fsync-Builtins.html @@ -446,4 +447,6 @@ DEFINE_UNSUPPORT_SYNC_FUNC(val_compare_and_swap, int8_t, 1) DEFINE_UNSUPPORT_SYNC_FUNC(val_compare_and_swap, int32_t, 2) DEFINE_UNSUPPORT_SYNC_FUNC(val_compare_and_swap, int64_t, 8) +#endif // __clang__ + #endif // __arm__ diff --git a/lib/atomic.c b/lib/atomic.c index a291f0d05..832dc81d8 100644 --- a/lib/atomic.c +++ b/lib/atomic.c @@ -25,6 +25,8 @@ *===----------------------------------------------------------------------=== */ +#if defined(__clang__) + #include <stdint.h> #include <string.h> @@ -313,3 +315,5 @@ OPTIMISED_CASES #define OPTIMISED_CASE(n, lockfree, type) ATOMIC_RMW(n, lockfree, type, xor, ^) OPTIMISED_CASES #undef OPTIMISED_CASE + +#endif // __clang__ diff --git a/lib/int_math.h b/lib/int_math.h index d6b4bdae1..adc0dc5c6 100644 --- a/lib/int_math.h +++ b/lib/int_math.h @@ -58,7 +58,13 @@ #define crt_logb(x) __builtin_logb((x)) #define crt_logbf(x) __builtin_logbf((x)) +#if defined(__ANDROID__) +// In Android "long double" carries distinct signature but is treated the +// same as double, and logbl doesn't exist until API 18 +#define crt_logbl(x) __builtin_logb((double)(x)) +#else #define crt_logbl(x) __builtin_logbl((x)) +#endif #define crt_scalbn(x, y) __builtin_scalbn((x), (y)) #define crt_scalbnf(x, y) __builtin_scalbnf((x), (y)) |