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

This commit is contained in:
jzmaddock
2017-02-26 13:01:11 +00:00
parent 5ff8f83739
commit 7a78d997d0
2 changed files with 7 additions and 1 deletions

View File

@ -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 <atomic> and <regex> respectively.
// However, we have no test for these as the headers were present but broken

View File

@ -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;
}