From 7a78d997d0c117e6163dddc4771ce8d59659d6ef Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 26 Feb 2017 13:01:11 +0000 Subject: [PATCH] Fixes for various clang versions: clang-5 didn't like the comparison used for testing nl_type.h, other clang versions look for ::gets even though libstdc++ doesn't define it --- include/boost/config/stdlib/libstdcpp3.hpp | 6 ++++++ test/boost_has_nl_types_h.ipp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) 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; }