From a376598a049bf953619171ed15f42b6ab723a17a Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Wed, 29 Aug 2018 22:07:08 +0300 Subject: [PATCH] Try to work around ::gets errors on clang 3.x/c++14/libstdc++ 4.8 --- include/boost/mp11/detail/config.hpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/include/boost/mp11/detail/config.hpp b/include/boost/mp11/detail/config.hpp index 9791db8..0ddb172 100644 --- a/include/boost/mp11/detail/config.hpp +++ b/include/boost/mp11/detail/config.hpp @@ -49,7 +49,7 @@ #elif defined(__clang__) -// clang++ +// Clang # undef BOOST_MP11_CLANG # define BOOST_MP11_CLANG (__clang_major__ * 100 + __clang_minor__) @@ -60,6 +60,15 @@ # endif # endif +#if BOOST_MP11_CLANG < 400 && __cplusplus >= 201402L \ + && defined( __GLIBCXX__ ) && !__has_include() + +// Clang pre-4 in C++14 mode, libstdc++ pre-4.9, ::gets is not defined, +// but Clang tries to import it into std + + extern "C" char *gets (char *__s); +#endif + #elif defined(__INTEL_COMPILER) // Intel C++