annotate DEPENDENCIES/generic/include/boost/config/stdlib/libstdcpp3.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // (C) Copyright John Maddock 2001.
Chris@16 2 // (C) Copyright Jens Maurer 2001.
Chris@16 3 // Use, modification and distribution are subject to the
Chris@16 4 // Boost Software License, Version 1.0. (See accompanying file
Chris@16 5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
Chris@16 6
Chris@16 7 // See http://www.boost.org for most recent version.
Chris@16 8
Chris@16 9 // config for libstdc++ v3
Chris@16 10 // not much to go in here:
Chris@16 11
Chris@16 12 #define BOOST_GNU_STDLIB 1
Chris@16 13
Chris@16 14 #ifdef __GLIBCXX__
Chris@16 15 #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
Chris@16 16 #else
Chris@16 17 #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
Chris@16 18 #endif
Chris@16 19
Chris@16 20 #if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
Chris@16 21 # define BOOST_NO_CWCHAR
Chris@16 22 # define BOOST_NO_CWCTYPE
Chris@16 23 # define BOOST_NO_STD_WSTRING
Chris@16 24 # define BOOST_NO_STD_WSTREAMBUF
Chris@16 25 #endif
Chris@16 26
Chris@16 27 #if defined(__osf__) && !defined(_REENTRANT) \
Chris@16 28 && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
Chris@16 29 // GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
Chris@16 30 // file is included, therefore for consistency we define it here as well.
Chris@16 31 # define _REENTRANT
Chris@16 32 #endif
Chris@16 33
Chris@16 34 #ifdef __GLIBCXX__ // gcc 3.4 and greater:
Chris@16 35 # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
Chris@16 36 || defined(_GLIBCXX__PTHREADS) \
Chris@16 37 || defined(_GLIBCXX_HAS_GTHREADS) \
Chris@16 38 || defined(_WIN32) \
Chris@101 39 || defined(_AIX) \
Chris@101 40 || defined(__HAIKU__)
Chris@16 41 //
Chris@16 42 // If the std lib has thread support turned on, then turn it on in Boost
Chris@16 43 // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
Chris@16 44 // while others do not...
Chris@16 45 //
Chris@16 46 # define BOOST_HAS_THREADS
Chris@16 47 # else
Chris@16 48 # define BOOST_DISABLE_THREADS
Chris@16 49 # endif
Chris@16 50 #elif defined(__GLIBCPP__) \
Chris@16 51 && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
Chris@16 52 && !defined(_GLIBCPP__PTHREADS)
Chris@16 53 // disable thread support if the std lib was built single threaded:
Chris@16 54 # define BOOST_DISABLE_THREADS
Chris@16 55 #endif
Chris@16 56
Chris@16 57 #if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
Chris@16 58 // linux on arm apparently doesn't define _REENTRANT
Chris@16 59 // so just turn on threading support whenever the std lib is thread safe:
Chris@16 60 # define BOOST_HAS_THREADS
Chris@16 61 #endif
Chris@16 62
Chris@16 63 #if !defined(_GLIBCPP_USE_LONG_LONG) \
Chris@16 64 && !defined(_GLIBCXX_USE_LONG_LONG)\
Chris@16 65 && defined(BOOST_HAS_LONG_LONG)
Chris@16 66 // May have been set by compiler/*.hpp, but "long long" without library
Chris@16 67 // support is useless.
Chris@16 68 # undef BOOST_HAS_LONG_LONG
Chris@16 69 #endif
Chris@16 70
Chris@16 71 // Apple doesn't seem to reliably defined a *unix* macro
Chris@16 72 #if !defined(CYGWIN) && ( defined(__unix__) \
Chris@16 73 || defined(__unix) \
Chris@16 74 || defined(unix) \
Chris@16 75 || defined(__APPLE__) \
Chris@16 76 || defined(__APPLE) \
Chris@16 77 || defined(APPLE))
Chris@16 78 # include <unistd.h>
Chris@16 79 #endif
Chris@16 80
Chris@16 81 #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
Chris@16 82 # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
Chris@16 83 # define BOOST_HAS_SLIST
Chris@16 84 # define BOOST_HAS_HASH
Chris@16 85 # define BOOST_SLIST_HEADER <ext/slist>
Chris@16 86 # if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
Chris@16 87 # define BOOST_HASH_SET_HEADER <ext/hash_set>
Chris@16 88 # define BOOST_HASH_MAP_HEADER <ext/hash_map>
Chris@16 89 # else
Chris@16 90 # define BOOST_HASH_SET_HEADER <backward/hash_set>
Chris@16 91 # define BOOST_HASH_MAP_HEADER <backward/hash_map>
Chris@16 92 # endif
Chris@16 93 #endif
Chris@16 94
Chris@101 95 //
Chris@101 96 // Decide whether we have C++11 support turned on:
Chris@101 97 //
Chris@101 98 #if defined(__GXX_EXPERIMENTAL_CXX0X__) || (__cplusplus >= 201103)
Chris@101 99 # define BOOST_LIBSTDCXX11
Chris@101 100 #endif
Chris@101 101 //
Chris@101 102 // Decide which version of libstdc++ we have, normally
Chris@16 103 // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
Chris@16 104 // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
Chris@16 105 // developers. He also commented:
Chris@16 106 //
Chris@16 107 // "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
Chris@16 108 // GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
Chris@16 109 // Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
Chris@16 110 // than any release in the 4.2 series."
Chris@16 111 //
Chris@16 112 // Another resource for understanding stdlibc++ features is:
Chris@16 113 // http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
Chris@101 114 //
Chris@101 115 // However, using the GCC version number fails when the compiler is clang since this
Chris@101 116 // only ever claims to emulate GCC-4.2, see https://svn.boost.org/trac/boost/ticket/7473
Chris@101 117 // for a long discussion on this issue. What we can do though is use clang's __has_include
Chris@101 118 // to detect the presence of a C++11 header that was introduced with a specific GCC release.
Chris@101 119 // We still have to be careful though as many such headers were buggy and/or incomplete when
Chris@101 120 // first introduced, so we only check for headers that were fully featured from day 1, and then
Chris@101 121 // use that to infer the underlying GCC version:
Chris@101 122 //
Chris@101 123 #ifdef __clang__
Chris@101 124
Chris@101 125 #if __has_include(<experimental/any>)
Chris@101 126 # define BOOST_LIBSTDCXX_VERSION 50000
Chris@101 127 #elif __has_include(<shared_mutex>)
Chris@101 128 # define BOOST_LIBSTDCXX_VERSION 40900
Chris@101 129 #elif __has_include(<ext/cmath>)
Chris@101 130 # define BOOST_LIBSTDCXX_VERSION 40800
Chris@101 131 #elif __has_include(<chrono>)
Chris@101 132 # define BOOST_LIBSTDCXX_VERSION 40700
Chris@101 133 #elif __has_include(<typeindex>)
Chris@101 134 # define BOOST_LIBSTDCXX_VERSION 40600
Chris@101 135 #elif __has_include(<future>)
Chris@101 136 # define BOOST_LIBSTDCXX_VERSION 40500
Chris@101 137 #elif __has_include(<ratio>)
Chris@101 138 # define BOOST_LIBSTDCXX_VERSION 40400
Chris@101 139 #elif __has_include(<array>)
Chris@101 140 # define BOOST_LIBSTDCXX_VERSION 40300
Chris@101 141 #endif
Chris@101 142 //
Chris@101 143 // GCC 4.8 and 9 add working versions of <atomic> and <regex> respectively.
Chris@101 144 // However, we have no test for these as the headers were present but broken
Chris@101 145 // in early GCC versions.
Chris@101 146 //
Chris@101 147 #endif
Chris@101 148
Chris@101 149 #if defined(__SUNPRO_CC) && (__SUNPRO_CC >= 0x5130) && (__cplusplus >= 201103L)
Chris@101 150 //
Chris@101 151 // Oracle Solaris compiler uses it's own verison of libstdc++ but doesn't
Chris@101 152 // set __GNUC__
Chris@101 153 //
Chris@101 154 #define BOOST_LIBSTDCXX_VERSION 40800
Chris@101 155 #endif
Chris@101 156
Chris@101 157 #if !defined(BOOST_LIBSTDCXX_VERSION)
Chris@101 158 # define BOOST_LIBSTDCXX_VERSION (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
Chris@101 159 #endif
Chris@16 160
Chris@16 161 // C++0x headers in GCC 4.3.0 and later
Chris@16 162 //
Chris@101 163 #if (BOOST_LIBSTDCXX_VERSION < 40300) || !defined(BOOST_LIBSTDCXX11)
Chris@16 164 # define BOOST_NO_CXX11_HDR_ARRAY
Chris@16 165 # define BOOST_NO_CXX11_HDR_TUPLE
Chris@16 166 # define BOOST_NO_CXX11_HDR_UNORDERED_MAP
Chris@16 167 # define BOOST_NO_CXX11_HDR_UNORDERED_SET
Chris@16 168 # define BOOST_NO_CXX11_HDR_FUNCTIONAL
Chris@16 169 #endif
Chris@16 170
Chris@16 171 // C++0x headers in GCC 4.4.0 and later
Chris@16 172 //
Chris@101 173 #if (BOOST_LIBSTDCXX_VERSION < 40400) || !defined(BOOST_LIBSTDCXX11)
Chris@16 174 # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
Chris@16 175 # define BOOST_NO_CXX11_HDR_FORWARD_LIST
Chris@16 176 # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
Chris@16 177 # define BOOST_NO_CXX11_HDR_MUTEX
Chris@16 178 # define BOOST_NO_CXX11_HDR_RATIO
Chris@16 179 # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
Chris@16 180 # define BOOST_NO_CXX11_SMART_PTR
Chris@16 181 #else
Chris@16 182 # define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
Chris@16 183 # define BOOST_HAS_TR1_COMPLEX_OVERLOADS
Chris@16 184 #endif
Chris@16 185
Chris@16 186 // C++0x features in GCC 4.5.0 and later
Chris@16 187 //
Chris@101 188 #if (BOOST_LIBSTDCXX_VERSION < 40500) || !defined(BOOST_LIBSTDCXX11)
Chris@16 189 # define BOOST_NO_CXX11_NUMERIC_LIMITS
Chris@16 190 # define BOOST_NO_CXX11_HDR_FUTURE
Chris@16 191 # define BOOST_NO_CXX11_HDR_RANDOM
Chris@16 192 #endif
Chris@16 193
Chris@16 194 // C++0x features in GCC 4.6.0 and later
Chris@16 195 //
Chris@101 196 #if (BOOST_LIBSTDCXX_VERSION < 40600) || !defined(BOOST_LIBSTDCXX11)
Chris@16 197 # define BOOST_NO_CXX11_HDR_TYPEINDEX
Chris@101 198 # define BOOST_NO_CXX11_ADDRESSOF
Chris@16 199 #endif
Chris@16 200
Chris@16 201 // C++0x features in GCC 4.7.0 and later
Chris@16 202 //
Chris@101 203 #if (BOOST_LIBSTDCXX_VERSION < 40700) || !defined(BOOST_LIBSTDCXX11)
Chris@101 204 // Note that although <chrono> existed prior to 4.7, "steady_clock" is spelled "monotonic_clock"
Chris@16 205 // so 4.7.0 is the first truely conforming one.
Chris@16 206 # define BOOST_NO_CXX11_HDR_CHRONO
Chris@16 207 # define BOOST_NO_CXX11_ALLOCATOR
Chris@16 208 #endif
Chris@101 209 // C++0x features in GCC 4.8.0 and later
Chris@101 210 //
Chris@101 211 #if (BOOST_LIBSTDCXX_VERSION < 40800) || !defined(BOOST_LIBSTDCXX11)
Chris@101 212 // Note that although <atomic> existed prior to gcc 4.8 it was largely unimplemented for many types:
Chris@101 213 # define BOOST_NO_CXX11_HDR_ATOMIC
Chris@101 214 # define BOOST_NO_CXX11_HDR_THREAD
Chris@101 215 #endif
Chris@101 216 #if (BOOST_LIBSTDCXX_VERSION < 40900) || !defined(BOOST_LIBSTDCXX11)
Chris@101 217 // Although <regex> is present and compilable against, the actual implementation is not functional
Chris@101 218 // 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 219 # define BOOST_NO_CXX11_HDR_REGEX
Chris@101 220 #endif
Chris@101 221
Chris@101 222 #if defined(__clang_major__) && ((__clang_major__ < 3) || ((__clang_major__ == 3) && (__clang_minor__ < 7)))
Chris@101 223 // As of clang-3.6, libstdc++ header <atomic> throws up errors with clang:
Chris@101 224 # define BOOST_NO_CXX11_HDR_ATOMIC
Chris@101 225 #endif
Chris@101 226
Chris@16 227 // C++0x headers not yet (fully!) implemented
Chris@16 228 //
Chris@16 229 # define BOOST_NO_CXX11_HDR_TYPE_TRAITS
Chris@16 230 # define BOOST_NO_CXX11_HDR_CODECVT
Chris@16 231 # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
Chris@101 232 # define BOOST_NO_CXX11_STD_ALIGN
Chris@101 233
Chris@101 234 //
Chris@101 235 // Headers not present on Solaris with the Oracle compiler:
Chris@101 236 #if defined(__SUNPRO_CC)
Chris@101 237 #define BOOST_NO_CXX11_HDR_FUTURE
Chris@101 238 #define BOOST_NO_CXX11_HDR_FORWARD_LIST
Chris@101 239 #define BOOST_NO_CXX11_HDR_ATOMIC
Chris@101 240 #endif
Chris@101 241
Chris@101 242 #if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1))
Chris@101 243 // Headers not always available:
Chris@101 244 # ifndef BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
Chris@101 245 # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
Chris@101 246 # endif
Chris@101 247 # ifndef BOOST_NO_CXX11_HDR_MUTEX
Chris@101 248 # define BOOST_NO_CXX11_HDR_MUTEX
Chris@101 249 # endif
Chris@101 250 # ifndef BOOST_NO_CXX11_HDR_THREAD
Chris@101 251 # define BOOST_NO_CXX11_HDR_THREAD
Chris@101 252 # endif
Chris@101 253 #endif
Chris@101 254
Chris@101 255 #if (!defined(_GTHREAD_USE_MUTEX_TIMEDLOCK) || (_GTHREAD_USE_MUTEX_TIMEDLOCK == 0)) && !defined(BOOST_NO_CXX11_HDR_MUTEX)
Chris@101 256 // Timed mutexes are not always available:
Chris@101 257 # define BOOST_NO_CXX11_HDR_MUTEX
Chris@101 258 #endif
Chris@16 259
Chris@16 260 // --- end ---