use std::thread if gcc is compiled with c++11 threading support
NANA_CMAKE_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ option must still be enabled but mingw.thread.h and mingw.mutex.h will be ignored if _GLIBCXX_HAS_GTHREADS is defined
This commit is contained in:
parent
a777447cfd
commit
d86a8cfad2
@ -14,8 +14,12 @@
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
// http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53
|
// http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53
|
||||||
//#define EPROTO 71 /* Protocol error */
|
//#define EPROTO 71 /* Protocol error */
|
||||||
|
#ifdef _GLIBCXX_HAS_GTHREADS
|
||||||
|
# include <thread>
|
||||||
|
#else
|
||||||
#include <mingw.thread.h>
|
#include <mingw.thread.h>
|
||||||
#include <mingw.mutex.h>
|
#include <mingw.mutex.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <boost/thread/mutex.hpp>
|
#include <boost/thread/mutex.hpp>
|
||||||
#include <boost/thread/recursive_mutex.hpp>
|
#include <boost/thread/recursive_mutex.hpp>
|
||||||
|
@ -6,7 +6,11 @@
|
|||||||
|
|
||||||
#if defined(NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
#if defined(NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ)
|
||||||
|
|
||||||
#include <mingw.thread.h>
|
#ifdef _GLIBCXX_HAS_GTHREADS
|
||||||
|
# include <thread>
|
||||||
|
#else
|
||||||
|
# include <mingw.thread.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
namespace std
|
namespace std
|
||||||
|
Loading…
x
Reference in New Issue
Block a user