mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 23:30:10 +01:00
gallium: add PIPE_OS_ANDROID support
Android uses Linux kernel and its own C runtime. It resembles PIPE_OS_LINUX a lot with some minor exceptions. Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
31753b50f3
commit
cd893ccba9
4 changed files with 22 additions and 2 deletions
|
|
@ -314,7 +314,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)
|
||||
#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU)) && !defined(PIPE_OS_ANDROID)
|
||||
|
||||
typedef pthread_barrier_t pipe_barrier;
|
||||
|
||||
|
|
|
|||
|
|
@ -199,6 +199,16 @@ roundf(float x)
|
|||
#endif /* _MSC_VER */
|
||||
|
||||
|
||||
#ifdef PIPE_OS_ANDROID
|
||||
|
||||
static INLINE
|
||||
double log2(double d)
|
||||
{
|
||||
return log(d) * (1.0 / M_LN2);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -409,7 +419,7 @@ unsigned ffs( unsigned u )
|
|||
|
||||
return i;
|
||||
}
|
||||
#elif defined(__MINGW32__)
|
||||
#elif defined(__MINGW32__) || defined(PIPE_OS_ANDROID)
|
||||
#define ffs __builtin_ffs
|
||||
#endif
|
||||
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -154,6 +154,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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue