diff options
author | Max Kellermann <max@duempel.org> | 2014-09-13 11:26:17 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-09-13 11:26:17 +0200 |
commit | e304d0f8ee404ef7e1223a324012d4fb4049185d (patch) | |
tree | e2e6b0c018541f6746d7f704bcb10743ca08ed53 /src/notify.hxx | |
parent | ab7b38d4b9c6673dc4adfaed7956984ec6bc8c9e (diff) | |
download | mpd-e304d0f8ee404ef7e1223a324012d4fb4049185d.tar.gz mpd-e304d0f8ee404ef7e1223a324012d4fb4049185d.tar.xz mpd-e304d0f8ee404ef7e1223a324012d4fb4049185d.zip |
thread/Posix{Cond,Mutex}: don't ues PTHREAD_*_INITIALIZER on NetBSD
On NetBSD, PTHREAD_MUTEX_INITIALIZER and PTHREAD_COND_INITIALIZER are
not compatible with C++11 "constexpr" (see Mantis ticket 0004110). As
a workaround, don't ues "constexpr", and use the functions
pthread_mutex_init(), pthread_mutex_destroy(), pthread_cond_init() and
pthread_cond_destroy() instead. This adds some runtime overhead, but
is portable to POSIX implementations that have awkward initializer
macros.
Diffstat (limited to '')
-rw-r--r-- | src/notify.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/notify.hxx b/src/notify.hxx index 6b9e95368..1024dd8d9 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(__NetBSD__) constexpr #endif notify():pending(false) {} |