thread/Posix{Mutex,Cond}: disable "constexpr" on Android

Bionic's pthread declarations are non-literal.
This commit is contained in:
Max Kellermann
2014-02-18 09:36:24 +01:00
parent 6eda79d02d
commit 9b7f492c65
3 changed files with 9 additions and 3 deletions

View File

@@ -41,7 +41,10 @@ class PosixCond {
pthread_cond_t cond;
public:
constexpr PosixCond():cond(PTHREAD_COND_INITIALIZER) {}
#ifndef __BIONIC__
constexpr
#endif
PosixCond():cond(PTHREAD_COND_INITIALIZER) {}
PosixCond(const PosixCond &other) = delete;
PosixCond &operator=(const PosixCond &other) = delete;

View File

@@ -41,7 +41,10 @@ class PosixMutex {
pthread_mutex_t mutex;
public:
constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {}
#ifndef __BIONIC__
constexpr
#endif
PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {}
PosixMutex(const PosixMutex &other) = delete;
PosixMutex &operator=(const PosixMutex &other) = delete;