From 63e64d4bebf51d1c689241635ab59341110007da Mon Sep 17 00:00:00 2001 From: dnso86 Date: Wed, 31 Jan 2018 09:24:11 +0100 Subject: [PATCH] Checking whether MinGW really supports threads --- include/nana/c++defines.hpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/include/nana/c++defines.hpp b/include/nana/c++defines.hpp index 04b5113f..99414127 100644 --- a/include/nana/c++defines.hpp +++ b/include/nana/c++defines.hpp @@ -171,9 +171,9 @@ #endif #endif -//Assume the std::thread is not implement on MinGW +//Assume the std::thread is not implemented on MinGW, +//unless it was compiled with POSIX threading support. //But some toolchains may implement std::thread. -// it seems that MinGW 6.3 and 7.1 have std::thread #ifdef NANA_MINGW # ifndef STD_THREAD_NOT_SUPPORTED # define STD_THREAD_NOT_SUPPORTED @@ -221,8 +221,11 @@ # if __has_include() # undef STD_FILESYSTEM_NOT_SUPPORTED # endif -# if __has_include() -# undef STD_THREAD_NOT_SUPPORTED +# if __has_include() +# if !(defined(NANA_MINGW) && !defined(_GLIBCXX_HAS_GTHREADS)) +//See the comment above regarding MinGW's threading support +# undef STD_THREAD_NOT_SUPPORTED +# endif # endif #endif