From 17935c0191b4c5adb68dd59df23282caef869875 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 27 Sep 2010 00:19:43 +0800 Subject: android: Fix build with bionic. --- src/gallium/auxiliary/os/os_thread.h | 2 +- src/gallium/auxiliary/util/u_math.h | 10 ++++++++++ src/gallium/include/pipe/p_compiler.h | 2 ++ src/gallium/include/pipe/p_config.h | 8 ++++++++ 4 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/os/os_thread.h b/src/gallium/auxiliary/os/os_thread.h index a084310d4f..64e3869a74 100644 --- a/src/gallium/auxiliary/os/os_thread.h +++ b/src/gallium/auxiliary/os/os_thread.h @@ -306,7 +306,7 @@ typedef int64_t pipe_condvar; * pipe_barrier */ -#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED) +#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_EMBEDDED)) && !defined(PIPE_OS_ANDROID) typedef pthread_barrier_t pipe_barrier; diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 37294b7203..cfcb9cd857 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -187,6 +187,16 @@ static INLINE double log2( double x ) #endif /* _MSC_VER */ +#ifdef PIPE_OS_ANDROID + +static INLINE +double log2(double d) +{ + return log(d) / M_LN2; +} + +#endif + diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index 3d6b5b5c81..a842d541eb 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -67,7 +67,9 @@ extern "C" { #if !defined(__HAIKU__) && !defined(__USE_MISC) +#if !defined(PIPE_OS_ANDROID) typedef unsigned int uint; +#endif typedef unsigned short ushort; #endif typedef unsigned char ubyte; diff --git a/src/gallium/include/pipe/p_config.h b/src/gallium/include/pipe/p_config.h index 74a1fa2978..988430c11d 100644 --- a/src/gallium/include/pipe/p_config.h +++ b/src/gallium/include/pipe/p_config.h @@ -133,6 +133,14 @@ #define PIPE_OS_UNIX #endif +/* + * Android defines __linux__ so PIPE_OS_LINUX and PIPE_OS_UNIX will also be + * defined. + */ +#if defined(ANDROID) +#define PIPE_OS_ANDROID +#endif + #if defined(__FreeBSD__) #define PIPE_OS_FREEBSD #define PIPE_OS_BSD -- cgit v1.2.3