From 9f68e62265bcc15307edd32aca8bd278ddc570f3 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Fri, 11 Mar 2016 12:32:26 -0500 Subject: SERVER-23088 fix boost's libstdcpp detection under clang Fixes compilation errors introduced by SERVER-19936 when compiling with clang on a system without boost headers installed. (cherry picked from commit 4b6952e97e74d8c7bd16ebfc5fe6e412ccf0f48c) --- .../boost-1.56.0/boost/config/stdlib/libstdcpp3.hpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/third_party/boost-1.56.0') diff --git a/src/third_party/boost-1.56.0/boost/config/stdlib/libstdcpp3.hpp b/src/third_party/boost-1.56.0/boost/config/stdlib/libstdcpp3.hpp index 2fd6ea7d533..10799e80328 100644 --- a/src/third_party/boost-1.56.0/boost/config/stdlib/libstdcpp3.hpp +++ b/src/third_party/boost-1.56.0/boost/config/stdlib/libstdcpp3.hpp @@ -91,6 +91,18 @@ # endif #endif + +// MONGO +// Implement support for clang + libstdc++ similarly to new versions of boost. This is based on +// https://github.com/boostorg/config/blob/boost-1.60.0/include/boost/config/stdlib/libstdcpp3.hpp#L115-L141 +#ifdef __clang__ +#if !__has_include() +#error "MongoDB does not support compiling with libstdc++ older than 4.8" +#elif __has_include() +#define MONGO_CLANG_LIBSTDCPP49 +#endif +#else + // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++ // developers. He also commented: @@ -162,7 +174,11 @@ // Note that although existed prior to gcc 4.8 it was largely unimplemented for many types: # define BOOST_NO_CXX11_HDR_ATOMIC #endif -#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) || !defined(__GXX_EXPERIMENTAL_CXX0X__) + +#endif // MONGO __clang__ + +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 9) || !defined(__GXX_EXPERIMENTAL_CXX0X__) \ + || !defined(MONGO_CLANG_LIBSTDCPP49) // Although is present and compilable against, the actual implementation is not functional // even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. # define BOOST_NO_CXX11_HDR_REGEX -- cgit v1.2.1