diff --git a/include/boost/config/stdlib/libstdcpp3.hpp b/include/boost/config/stdlib/libstdcpp3.hpp index 205489a9..14dca142 100644 --- a/include/boost/config/stdlib/libstdcpp3.hpp +++ b/include/boost/config/stdlib/libstdcpp3.hpp @@ -143,6 +143,12 @@ # define BOOST_LIBSTDCXX_VERSION 40300 #endif +#if (BOOST_LIBSTDCXX_VERSION < 50100) +// libstdc++ does not define this function as it's deprecated in C++11, but clang still looks for it, +// defining it here is a terrible cludge, but should get things working: +extern "C" char *gets (char *__s); +#endif + // // GCC 4.8 and 9 add working versions of and respectively. // However, we have no test for these as the headers were present but broken diff --git a/test/boost_has_nl_types_h.ipp b/test/boost_has_nl_types_h.ipp index 9126adbf..e23f0a21 100644 --- a/test/boost_has_nl_types_h.ipp +++ b/test/boost_has_nl_types_h.ipp @@ -17,7 +17,7 @@ namespace boost_has_nl_types_h{ int test() { nl_catd cat = catopen("foo", 0); - if(cat >= 0) catclose(cat); + if(cat != (nl_catd)-1) catclose(cat); return 0; }