From db21d7de0b95a0634a426fbb7f6bca1ee0e1a5c9 Mon Sep 17 00:00:00 2001 From: Florian Schlichting Date: Wed, 31 Oct 2018 12:15:11 +0100 Subject: [PATCH] fix compilation errors on Debian GNU/Hurd Apparently on hurd-i386 __GLIBC__ is defined, but the pthread implementation is special and cannot be used with constexpr. Hence exclude __gnu_hurd__. --- src/thread/PosixCond.hxx | 2 +- src/thread/PosixMutex.hxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/thread/PosixCond.hxx b/src/thread/PosixCond.hxx index c28147257..ab00a654f 100644 --- a/src/thread/PosixCond.hxx +++ b/src/thread/PosixCond.hxx @@ -43,7 +43,7 @@ class PosixCond { pthread_cond_t cond; public: -#ifdef __GLIBC__ +#if defined(__GLIBC__) && !defined(__gnu_hurd__) /* optimized constexpr constructor for pthread implementations that support it */ constexpr PosixCond() noexcept:cond(PTHREAD_COND_INITIALIZER) {} diff --git a/src/thread/PosixMutex.hxx b/src/thread/PosixMutex.hxx index 7042dc8ec..37157d724 100644 --- a/src/thread/PosixMutex.hxx +++ b/src/thread/PosixMutex.hxx @@ -41,7 +41,7 @@ class PosixMutex { pthread_mutex_t mutex; public: -#ifdef __GLIBC__ +#if defined(__GLIBC__) && !defined(__gnu_hurd__) /* optimized constexpr constructor for pthread implementations that support it */ constexpr PosixMutex():mutex(PTHREAD_MUTEX_INITIALIZER) {}