mdbx-test: fix build for __ANDROID_API__ < 24 (using pthread_barrier_t stub).

This commit is contained in:
Leonid Yuriev 2022-01-05 16:53:03 +03:00
parent b19ebf0c2e
commit 9cf18176f0
5 changed files with 7 additions and 9 deletions

View File

@ -32,9 +32,15 @@
#if defined(__APPLE__) && (MDBX_LOCKING == MDBX_LOCKING_POSIX2001 || \ #if defined(__APPLE__) && (MDBX_LOCKING == MDBX_LOCKING_POSIX2001 || \
MDBX_LOCKING == MDBX_LOCKING_POSIX2008) MDBX_LOCKING == MDBX_LOCKING_POSIX2008)
#include "darwin/pthread_barrier.c" #include "stub/pthread_barrier.c"
#endif /* __APPLE__ && MDBX_LOCKING >= MDBX_LOCKING_POSIX2001 */ #endif /* __APPLE__ && MDBX_LOCKING >= MDBX_LOCKING_POSIX2001 */
#if defined(__ANDROID_API__) && __ANDROID_API__ < 24 && \
(MDBX_LOCKING == MDBX_LOCKING_POSIX2001 || \
MDBX_LOCKING == MDBX_LOCKING_POSIX2008)
#include "stub/pthread_barrier.c"
#endif /* __ANDROID_API__ < 24 && MDBX_LOCKING >= MDBX_LOCKING_POSIX2001 */
#if MDBX_LOCKING == MDBX_LOCKING_SYSV #if MDBX_LOCKING == MDBX_LOCKING_SYSV
#include <sys/ipc.h> #include <sys/ipc.h>
#include <sys/sem.h> #include <sys/sem.h>

View File

@ -29,8 +29,6 @@
#include <errno.h> #include <errno.h>
#ifdef __APPLE__
int pthread_barrierattr_init(pthread_barrierattr_t *attr) { int pthread_barrierattr_init(pthread_barrierattr_t *attr) {
memset(attr, 0, sizeof(pthread_barrierattr_t)); memset(attr, 0, sizeof(pthread_barrierattr_t));
int m = pthread_mutexattr_init(&attr->mattr); int m = pthread_mutexattr_init(&attr->mattr);
@ -106,5 +104,3 @@ int pthread_barrier_wait(pthread_barrier_t *barrier) {
return 0; return 0;
} }
} }
#endif /* __APPLE__ */

View File

@ -30,8 +30,6 @@
#include <pthread.h> #include <pthread.h>
#ifdef __APPLE__
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -78,6 +76,4 @@ int pthread_barrier_wait(pthread_barrier_t *barrier);
} }
#endif #endif
#endif /* __APPLE__ */
#endif /* PTHREAD_BARRIER_H */ #endif /* PTHREAD_BARRIER_H */