MinGW workaround with USE_github_com_meganz_mingw_std_threads

This commit is contained in:
qPCR4vir
2015-12-02 13:38:22 +01:00
parent 003b0b4041
commit 74be76e49a
5 changed files with 42 additions and 10 deletions

View File

@@ -3,10 +3,14 @@
#include <nana/config.hpp>
#if defined(STD_THREAD_NOT_SUPPORTED)
#if defined(USE_github_com_meganz_mingw_std_threads)
#include <mingw.condition_variable.h>
#else
#include <boost/thread/condition_variable.hpp>
namespace std
{
typedef boost::condition_variable condition_variable;
}
#endif
#endif // (USE_github_com_meganz_mingw_std_threads)
#endif // (STD_THREAD_NOT_SUPPORTED)
#endif // NANA_STD_CONDITION_VARIABLE_HPP

View File

@@ -3,6 +3,20 @@
#include <nana/config.hpp>
#if defined(STD_THREAD_NOT_SUPPORTED)
#if defined(USE_github_com_meganz_mingw_std_threads)
#include <windows.h>
#include <mutex>
#include <condition_variable>
#include <thread>
#include <pthread.h>
#include <errno.h>
#include <cstdio>
// http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53
#define EPROTO 71 /* Protocol error */
#include <mingw.thread.h>
#include <mingw.mutex.h>
#else
#include <boost/thread/mutex.hpp>
#include <boost/thread/recursive_mutex.hpp>
#include <boost/thread/locks.hpp>
@@ -18,5 +32,6 @@ namespace std
typedef boost::mutex mutex;
typedef boost::recursive_mutex recursive_mutex;
}
#endif
#endif // (USE_github_com_meganz_mingw_std_threads)
#endif // (STD_THREAD_NOT_SUPPORTED)
#endif // NANA_STD_MUTEX_HPP

View File

@@ -3,11 +3,15 @@
#include <nana/config.hpp>
#if defined(STD_THREAD_NOT_SUPPORTED)
#if defined(USE_github_com_meganz_mingw_std_threads)
#include <mingw.thread.h>
#else
#include <boost/thread.hpp>
namespace std
{
typedef boost::thread thread;
}
#endif
#endif // (USE_github_com_meganz_mingw_std_threads)
#endif // (STD_THREAD_NOT_SUPPORTED)
#endif // NANA_STD_THREAD_HPP