Android: use bionic pthread_barrier_* if possible
authorChih-Wei Huang <cwhuang@android-x86.org>
Sun, 4 Jun 2017 04:53:01 +0000 (12:53 +0800)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 5 Jun 2017 13:06:35 +0000 (14:06 +0100)
The pthread_barrier_* functions were introduced to bionic
since Nougat.

Signed-off-by: Chih-Wei Huang <cwhuang@linux.org.tw>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Android.common.mk
src/gallium/auxiliary/os/os_thread.h

index 57c31fc7e99c14856cd5398547d91ce3ee10ad01..44ad97b6be21386bf46507f9ff4ea22ff78ec0ab 100644 (file)
@@ -44,6 +44,7 @@ LOCAL_CFLAGS += \
 # It's likely due to a bug elsewhere, but let's temporarily add them
 # here to fix the radeonsi build.
 LOCAL_CFLAGS += \
+       -DANDROID_API_LEVEL=$(PLATFORM_SDK_VERSION) \
        -DENABLE_SHADER_CACHE \
        -D__STDC_CONSTANT_MACROS \
        -D__STDC_LIMIT_MACROS \
index b6e0698da617bdb16f780c07ce1c7348d5b4d118..0a238e5749307146719a4de5b8a8adc43b014606 100644 (file)
@@ -75,7 +75,7 @@ __pipe_mutex_assert_locked(mtx_t *mutex)
  * pipe_barrier
  */
 
-#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && !defined(PIPE_OS_ANDROID)
+#if (defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HURD)) && (!defined(PIPE_OS_ANDROID) || ANDROID_API_LEVEL >= 24)
 
 typedef pthread_barrier_t pipe_barrier;