From 9b7f492c65ca1bcc034f81ae30eab05177bf322f Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 18 Feb 2014 09:36:24 +0100 Subject: [PATCH] thread/Posix{Mutex,Cond}: disable "constexpr" on Android Bionic's pthread declarations are non-literal. --- src/notify.hxx | 2 +- src/thread/PosixCond.hxx | 5 ++++- src/thread/PosixMutex.hxx | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/notify.hxx b/src/notify.hxx index cde29468f..ebd12e5c6 100644 --- a/src/notify.hxx +++ b/src/notify.hxx @@ -28,7 +28,7 @@ struct notify { Cond cond; bool pending; -#ifndef WIN32 +#if !defined(WIN32) && !defined(__BIONIC__) constexpr #endif notify():pending(false) {} diff --git a/src/thread/PosixCond.hxx b/src/thread/PosixCond.hxx index 6f98d3ad0..35aa8c88a 100644 --- a/src/thread/PosixCond.hxx +++ b/src/thread/PosixCond.hxx @@ -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; diff --git a/src/thread/PosixMutex.hxx b/src/thread/PosixMutex.hxx index d50764af4..464ed5787 100644 --- a/src/thread/PosixMutex.hxx +++ b/src/thread/PosixMutex.hxx @@ -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;