mirror of
https://github.com/isar/libmdbx.git
synced 2024-12-30 03:34:13 +08:00
mdbx-test: fix build for __ANDROID_API__ < 24
(using pthread_barrier_t
stub).
This commit is contained in:
parent
b19ebf0c2e
commit
9cf18176f0
@ -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>
|
||||||
|
@ -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__ */
|
|
@ -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 */
|
Loading…
x
Reference in New Issue
Block a user