Chris@16: // (C) Copyright John Maddock 2001. Chris@16: // (C) Copyright Jens Maurer 2001. Chris@16: // Use, modification and distribution are subject to the Chris@16: // Boost Software License, Version 1.0. (See accompanying file Chris@16: // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for most recent version. Chris@16: Chris@16: // config for libstdc++ v3 Chris@16: // not much to go in here: Chris@16: Chris@16: #define BOOST_GNU_STDLIB 1 Chris@16: Chris@16: #ifdef __GLIBCXX__ Chris@16: #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__) Chris@16: #else Chris@16: #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__) Chris@16: #endif Chris@16: Chris@16: #if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T) Chris@16: # define BOOST_NO_CWCHAR Chris@16: # define BOOST_NO_CWCTYPE Chris@16: # define BOOST_NO_STD_WSTRING Chris@16: # define BOOST_NO_STD_WSTREAMBUF Chris@16: #endif Chris@16: Chris@16: #if defined(__osf__) && !defined(_REENTRANT) \ Chris@16: && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) ) Chris@16: // GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header Chris@16: // file is included, therefore for consistency we define it here as well. Chris@16: # define _REENTRANT Chris@16: #endif Chris@16: Chris@16: #ifdef __GLIBCXX__ // gcc 3.4 and greater: Chris@16: # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \ Chris@16: || defined(_GLIBCXX__PTHREADS) \ Chris@16: || defined(_GLIBCXX_HAS_GTHREADS) \ Chris@16: || defined(_WIN32) \ Chris@101: || defined(_AIX) \ Chris@101: || defined(__HAIKU__) Chris@16: // Chris@16: // If the std lib has thread support turned on, then turn it on in Boost Chris@16: // as well. We do this because some gcc-3.4 std lib headers define _REENTANT Chris@16: // while others do not... Chris@16: // Chris@16: # define BOOST_HAS_THREADS Chris@16: # else Chris@16: # define BOOST_DISABLE_THREADS Chris@16: # endif Chris@16: #elif defined(__GLIBCPP__) \ Chris@16: && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \ Chris@16: && !defined(_GLIBCPP__PTHREADS) Chris@16: // disable thread support if the std lib was built single threaded: Chris@16: # define BOOST_DISABLE_THREADS Chris@16: #endif Chris@16: Chris@16: #if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT) Chris@16: // linux on arm apparently doesn't define _REENTRANT Chris@16: // so just turn on threading support whenever the std lib is thread safe: Chris@16: # define BOOST_HAS_THREADS Chris@16: #endif Chris@16: Chris@16: #if !defined(_GLIBCPP_USE_LONG_LONG) \ Chris@16: && !defined(_GLIBCXX_USE_LONG_LONG)\ Chris@16: && defined(BOOST_HAS_LONG_LONG) Chris@16: // May have been set by compiler/*.hpp, but "long long" without library Chris@16: // support is useless. Chris@16: # undef BOOST_HAS_LONG_LONG Chris@16: #endif Chris@16: Chris@16: // Apple doesn't seem to reliably defined a *unix* macro Chris@16: #if !defined(CYGWIN) && ( defined(__unix__) \ Chris@16: || defined(__unix) \ Chris@16: || defined(unix) \ Chris@16: || defined(__APPLE__) \ Chris@16: || defined(__APPLE) \ Chris@16: || defined(APPLE)) Chris@16: # include Chris@16: #endif Chris@16: Chris@16: #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 Chris@16: # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx Chris@16: # define BOOST_HAS_SLIST Chris@16: # define BOOST_HAS_HASH Chris@16: # define BOOST_SLIST_HEADER Chris@16: # if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) Chris@16: # define BOOST_HASH_SET_HEADER Chris@16: # define BOOST_HASH_MAP_HEADER Chris@16: # else Chris@16: # define BOOST_HASH_SET_HEADER Chris@16: # define BOOST_HASH_MAP_HEADER Chris@16: # endif Chris@16: #endif Chris@16: Chris@101: // Chris@101: // Decide whether we have C++11 support turned on: Chris@101: // Chris@101: #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103) Chris@101: # define BOOST_LIBSTDCXX11 Chris@101: #endif Chris@101: // Chris@101: // Decide which version of libstdc++ we have, normally Chris@16: // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly Chris@16: // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++ Chris@16: // developers. He also commented: Chris@16: // Chris@16: // "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in Chris@16: // GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305. Chris@16: // Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support Chris@16: // than any release in the 4.2 series." Chris@16: // Chris@16: // Another resource for understanding stdlibc++ features is: Chris@16: // http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x Chris@101: // Chris@101: // However, using the GCC version number fails when the compiler is clang since this Chris@101: // only ever claims to emulate GCC-4.2, see https://svn.boost.org/trac/boost/ticket/7473 Chris@101: // for a long discussion on this issue. What we can do though is use clang's __has_include Chris@101: // to detect the presence of a C++11 header that was introduced with a specific GCC release. Chris@101: // We still have to be careful though as many such headers were buggy and/or incomplete when Chris@101: // first introduced, so we only check for headers that were fully featured from day 1, and then Chris@101: // use that to infer the underlying GCC version: Chris@101: // Chris@101: #ifdef __clang__ Chris@101: Chris@101: #if __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 50000 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40900 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40800 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40700 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40600 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40500 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40400 Chris@101: #elif __has_include() Chris@101: # define BOOST_LIBSTDCXX_VERSION 40300 Chris@101: #endif Chris@101: // Chris@101: // GCC 4.8 and 9 add working versions of and respectively. Chris@101: // However, we have no test for these as the headers were present but broken Chris@101: // in early GCC versions. Chris@101: // Chris@101: #endif Chris@101: Chris@101: #if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) && (__cplusplus >= 201103L) Chris@101: // Chris@101: // Oracle Solaris compiler uses it's own verison of libstdc++ but doesn't Chris@101: // set __GNUC__ Chris@101: // Chris@101: #define BOOST_LIBSTDCXX_VERSION 40800 Chris@101: #endif Chris@101: Chris@101: #if !defined(BOOST_LIBSTDCXX_VERSION) Chris@101: # define BOOST_LIBSTDCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__) Chris@101: #endif Chris@16: Chris@16: // C++0x headers in GCC 4.3.0 and later Chris@16: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40300) || !defined(BOOST_LIBSTDCXX11) Chris@16: # define BOOST_NO_CXX11_HDR_ARRAY Chris@16: # define BOOST_NO_CXX11_HDR_TUPLE Chris@16: # define BOOST_NO_CXX11_HDR_UNORDERED_MAP Chris@16: # define BOOST_NO_CXX11_HDR_UNORDERED_SET Chris@16: # define BOOST_NO_CXX11_HDR_FUNCTIONAL Chris@16: #endif Chris@16: Chris@16: // C++0x headers in GCC 4.4.0 and later Chris@16: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40400) || !defined(BOOST_LIBSTDCXX11) Chris@16: # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE Chris@16: # define BOOST_NO_CXX11_HDR_FORWARD_LIST Chris@16: # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST Chris@16: # define BOOST_NO_CXX11_HDR_MUTEX Chris@16: # define BOOST_NO_CXX11_HDR_RATIO Chris@16: # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR Chris@16: # define BOOST_NO_CXX11_SMART_PTR Chris@16: #else Chris@16: # define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG Chris@16: # define BOOST_HAS_TR1_COMPLEX_OVERLOADS Chris@16: #endif Chris@16: Chris@16: // C++0x features in GCC 4.5.0 and later Chris@16: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40500) || !defined(BOOST_LIBSTDCXX11) Chris@16: # define BOOST_NO_CXX11_NUMERIC_LIMITS Chris@16: # define BOOST_NO_CXX11_HDR_FUTURE Chris@16: # define BOOST_NO_CXX11_HDR_RANDOM Chris@16: #endif Chris@16: Chris@16: // C++0x features in GCC 4.6.0 and later Chris@16: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40600) || !defined(BOOST_LIBSTDCXX11) Chris@16: # define BOOST_NO_CXX11_HDR_TYPEINDEX Chris@101: # define BOOST_NO_CXX11_ADDRESSOF Chris@16: #endif Chris@16: Chris@16: // C++0x features in GCC 4.7.0 and later Chris@16: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40700) || !defined(BOOST_LIBSTDCXX11) Chris@101: // Note that although existed prior to 4.7, "steady_clock" is spelled "monotonic_clock" Chris@16: // so 4.7.0 is the first truely conforming one. Chris@16: # define BOOST_NO_CXX11_HDR_CHRONO Chris@16: # define BOOST_NO_CXX11_ALLOCATOR Chris@16: #endif Chris@101: // C++0x features in GCC 4.8.0 and later Chris@101: // Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40800) || !defined(BOOST_LIBSTDCXX11) Chris@101: // Note that although existed prior to gcc 4.8 it was largely unimplemented for many types: Chris@101: # define BOOST_NO_CXX11_HDR_ATOMIC Chris@101: # define BOOST_NO_CXX11_HDR_THREAD Chris@101: #endif Chris@101: #if (BOOST_LIBSTDCXX_VERSION < 40900) || !defined(BOOST_LIBSTDCXX11) Chris@101: // Although is present and compilable against, the actual implementation is not functional Chris@101: // even for the simplest patterns such as "\d" or "[0-9]". This is the case at least in gcc up to 4.8, inclusively. Chris@101: # define BOOST_NO_CXX11_HDR_REGEX Chris@101: #endif Chris@101: Chris@101: #if defined(__clang_major__) && ((__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 7))) Chris@101: // As of clang-3.6, libstdc++ header throws up errors with clang: Chris@101: # define BOOST_NO_CXX11_HDR_ATOMIC Chris@101: #endif Chris@101: Chris@16: // C++0x headers not yet (fully!) implemented Chris@16: // Chris@16: # define BOOST_NO_CXX11_HDR_TYPE_TRAITS Chris@16: # define BOOST_NO_CXX11_HDR_CODECVT Chris@16: # define BOOST_NO_CXX11_ATOMIC_SMART_PTR Chris@101: # define BOOST_NO_CXX11_STD_ALIGN Chris@101: Chris@101: // Chris@101: // Headers not present on Solaris with the Oracle compiler: Chris@101: #if defined(__SUNPRO_CC) Chris@101: #define BOOST_NO_CXX11_HDR_FUTURE Chris@101: #define BOOST_NO_CXX11_HDR_FORWARD_LIST Chris@101: #define BOOST_NO_CXX11_HDR_ATOMIC Chris@101: #endif Chris@101: Chris@101: #if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) Chris@101: // Headers not always available: Chris@101: # ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE Chris@101: # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE Chris@101: # endif Chris@101: # ifndef BOOST_NO_CXX11_HDR_MUTEX Chris@101: # define BOOST_NO_CXX11_HDR_MUTEX Chris@101: # endif Chris@101: # ifndef BOOST_NO_CXX11_HDR_THREAD Chris@101: # define BOOST_NO_CXX11_HDR_THREAD Chris@101: # endif Chris@101: #endif Chris@101: Chris@101: #if (!defined(_GTHREAD_USE_MUTEX_TIMEDLOCK) || (_GTHREAD_USE_MUTEX_TIMEDLOCK == 0)) && !defined(BOOST_NO_CXX11_HDR_MUTEX) Chris@101: // Timed mutexes are not always available: Chris@101: # define BOOST_NO_CXX11_HDR_MUTEX Chris@101: #endif Chris@16: Chris@16: // --- end ---