mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
Fix C++11 Windows build of threading code
The initial problem was that mutex_auto_lock.h tries to use std::unique_lock<std::mutex> 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.
This commit is contained in:
@@ -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 <mutex>
|
||||
using MutexAutoLock = std::unique_lock<std::mutex>;
|
||||
using RecursiveMutexAutoLock = std::unique_lock<std::recursive_mutex>;
|
||||
|
Reference in New Issue
Block a user