From b7ca3078325c6a8a7248e4d86f25d92c21302226 Mon Sep 17 00:00:00 2001 From: Joerg-Christian Boehme Date: Wed, 8 Nov 2017 00:40:28 +0100 Subject: [PATCH] Fix android compile error with newer NDK. Android is using in the newer NDK the unified headers. See also https://android.googlesource.com/platform/ndk/+/ndk-r15-release/docs/UnifiedHeaders.md --- Foundation/src/Event_POSIX.cpp | 8 ++++---- Foundation/src/Semaphore_POSIX.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Foundation/src/Event_POSIX.cpp b/Foundation/src/Event_POSIX.cpp index 398234d67..2f3e69d0c 100644 --- a/Foundation/src/Event_POSIX.cpp +++ b/Foundation/src/Event_POSIX.cpp @@ -24,12 +24,12 @@ // // Note: pthread_cond_timedwait() with CLOCK_MONOTONIC is supported -// on Linux and QNX, as well as on Android >= 5.0. On Android < 5.0, -// HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC is defined to indicate -// availability of non-standard pthread_cond_timedwait_monotonic(). +// on Linux and QNX, as well as on Android >= 5.0 (API level 21). +// On Android < 5.0, HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC is defined +// to indicate availability of non-standard pthread_cond_timedwait_monotonic(). // #ifndef POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT - #if (defined(__linux__) || defined(__QNX__)) && !(defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)) + #if (defined(__linux__) || defined(__QNX__)) && !(defined(__ANDROID__) && (defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC) || __ANDROID_API__ <= 21)) #define POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT 1 #endif #endif diff --git a/Foundation/src/Semaphore_POSIX.cpp b/Foundation/src/Semaphore_POSIX.cpp index 9c90fdaba..226d5d44f 100644 --- a/Foundation/src/Semaphore_POSIX.cpp +++ b/Foundation/src/Semaphore_POSIX.cpp @@ -24,12 +24,12 @@ // // Note: pthread_cond_timedwait() with CLOCK_MONOTONIC is supported -// on Linux and QNX, as well as on Android >= 5.0. On Android < 5.0, -// HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC is defined to indicate -// availability of non-standard pthread_cond_timedwait_monotonic(). +// on Linux and QNX, as well as on Android >= 5.0 (API level 21). +// On Android < 5.0, HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC is defined +// to indicate availability of non-standard pthread_cond_timedwait_monotonic(). // #ifndef POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT - #if (defined(__linux__) || defined(__QNX__)) && !(defined(__ANDROID__) && defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC)) + #if (defined(__linux__) || defined(__QNX__)) && !(defined(__ANDROID__) && (defined(HAVE_PTHREAD_COND_TIMEDWAIT_MONOTONIC) || __ANDROID_API__ <= 21)) #define POCO_HAVE_MONOTONIC_PTHREAD_COND_TIMEDWAIT 1 #endif #endif