From d86a8cfad251218fa98fbd50ef0a040440e3b113 Mon Sep 17 00:00:00 2001 From: Ac Date: Fri, 29 Sep 2017 11:06:22 +0900 Subject: [PATCH] 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 --- include/nana/std_mutex.hpp | 4 ++++ include/nana/std_thread.hpp | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/include/nana/std_mutex.hpp b/include/nana/std_mutex.hpp index 38c07aaf..55f486e4 100644 --- a/include/nana/std_mutex.hpp +++ b/include/nana/std_mutex.hpp @@ -14,8 +14,12 @@ #include // http://lxr.free-electrons.com/source/include/uapi/asm-generic/errno.h#L53 //#define EPROTO 71 /* Protocol error */ +#ifdef _GLIBCXX_HAS_GTHREADS +# include +#else #include #include +#endif #else #include #include diff --git a/include/nana/std_thread.hpp b/include/nana/std_thread.hpp index e1df7ef7..87db1e5a 100644 --- a/include/nana/std_thread.hpp +++ b/include/nana/std_thread.hpp @@ -6,7 +6,11 @@ #if defined(NANA_ENABLE_MINGW_STD_THREADS_WITH_MEGANZ) -#include +#ifdef _GLIBCXX_HAS_GTHREADS +# include +#else +# include +#endif #else #include namespace std