From 0a16e53b40d347db7dcd04cb694d0f8f2ed1a5a7 Mon Sep 17 00:00:00 2001 From: sfan5 Date: Thu, 6 Oct 2016 21:13:04 +0200 Subject: Fix C++11 Windows build of threading code The initial problem was that mutex_auto_lock.h tries to use std::unique_lock despite mutex.h not using C++11's std::mutex on Windows. The problem here is the mismatch between C++11 usage conditions of the two headers. This commit moves the decision logic to threads.h and makes sure mutex.h, mutex_auto_lock.h and event.h all use the same features. --- src/threading/mutex_auto_lock.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/threading/mutex_auto_lock.h') diff --git a/src/threading/mutex_auto_lock.h b/src/threading/mutex_auto_lock.h index 25caf7e14..d79c68a93 100644 --- a/src/threading/mutex_auto_lock.h +++ b/src/threading/mutex_auto_lock.h @@ -26,7 +26,9 @@ DEALINGS IN THE SOFTWARE. #ifndef THREADING_MUTEX_AUTO_LOCK_H #define THREADING_MUTEX_AUTO_LOCK_H -#if __cplusplus >= 201103L +#include "threads.h" + +#if USE_CPP11_MUTEX #include using MutexAutoLock = std::unique_lock; using RecursiveMutexAutoLock = std::unique_lock; -- cgit v1.2.3