mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Fix C++11 compilability
Previous commits broke it... :(
This commit is contained in:
parent
0459eca8eb
commit
e50c784e2c
7 changed files with 43 additions and 5 deletions
|
@ -30,6 +30,7 @@ DEALINGS IN THE SOFTWARE.
|
|||
#if __cplusplus >= 201103L && !defined(_WIN32)
|
||||
#include <mutex>
|
||||
using Mutex = std::mutex;
|
||||
using RecursiveMutex = std::recursive_mutex;
|
||||
#else
|
||||
|
||||
#ifdef _WIN32
|
||||
|
@ -49,11 +50,14 @@ DEALINGS IN THE SOFTWARE.
|
|||
class Mutex
|
||||
{
|
||||
public:
|
||||
Mutex(bool recursive=false);
|
||||
Mutex();
|
||||
~Mutex();
|
||||
void lock();
|
||||
void unlock();
|
||||
|
||||
protected:
|
||||
Mutex(bool recursive);
|
||||
void init_mutex(bool recursive);
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
CRITICAL_SECTION mutex;
|
||||
|
@ -64,6 +68,14 @@ private:
|
|||
DISABLE_CLASS_COPY(Mutex);
|
||||
};
|
||||
|
||||
class RecursiveMutex : public Mutex
|
||||
{
|
||||
public:
|
||||
RecursiveMutex();
|
||||
|
||||
DISABLE_CLASS_COPY(RecursiveMutex);
|
||||
};
|
||||
|
||||
#endif // C++11
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue