libstdcpp3.hpp 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. // (C) Copyright John Maddock 2001.
  2. // (C) Copyright Jens Maurer 2001.
  3. // Use, modification and distribution are subject to the
  4. // Boost Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. // See http://www.boost.org for most recent version.
  7. // config for libstdc++ v3
  8. // not much to go in here:
  9. #define BOOST_GNU_STDLIB 1
  10. #ifdef __GLIBCXX__
  11. #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
  12. #else
  13. #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
  14. #endif
  15. #if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
  16. # define BOOST_NO_CWCHAR
  17. # define BOOST_NO_CWCTYPE
  18. # define BOOST_NO_STD_WSTRING
  19. # define BOOST_NO_STD_WSTREAMBUF
  20. #endif
  21. #if defined(__osf__) && !defined(_REENTRANT) \
  22. && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
  23. // GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
  24. // file is included, therefore for consistency we define it here as well.
  25. # define _REENTRANT
  26. #endif
  27. #ifdef __GLIBCXX__ // gcc 3.4 and greater:
  28. # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
  29. || defined(_GLIBCXX__PTHREADS) \
  30. || defined(_GLIBCXX_HAS_GTHREADS) \
  31. || defined(_WIN32) \
  32. || defined(_AIX)
  33. //
  34. // If the std lib has thread support turned on, then turn it on in Boost
  35. // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
  36. // while others do not...
  37. //
  38. # define BOOST_HAS_THREADS
  39. # else
  40. # define BOOST_DISABLE_THREADS
  41. # endif
  42. #elif defined(__GLIBCPP__) \
  43. && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
  44. && !defined(_GLIBCPP__PTHREADS)
  45. // disable thread support if the std lib was built single threaded:
  46. # define BOOST_DISABLE_THREADS
  47. #endif
  48. #if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
  49. // linux on arm apparently doesn't define _REENTRANT
  50. // so just turn on threading support whenever the std lib is thread safe:
  51. # define BOOST_HAS_THREADS
  52. #endif
  53. #if !defined(_GLIBCPP_USE_LONG_LONG) \
  54. && !defined(_GLIBCXX_USE_LONG_LONG)\
  55. && defined(BOOST_HAS_LONG_LONG)
  56. // May have been set by compiler/*.hpp, but "long long" without library
  57. // support is useless.
  58. # undef BOOST_HAS_LONG_LONG
  59. #endif
  60. // Apple doesn't seem to reliably defined a *unix* macro
  61. #if !defined(CYGWIN) && ( defined(__unix__) \
  62. || defined(__unix) \
  63. || defined(unix) \
  64. || defined(__APPLE__) \
  65. || defined(__APPLE) \
  66. || defined(APPLE))
  67. # include <unistd.h>
  68. #endif
  69. #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
  70. # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
  71. # define BOOST_HAS_SLIST
  72. # define BOOST_HAS_HASH
  73. # define BOOST_SLIST_HEADER <ext/slist>
  74. # if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
  75. # define BOOST_HASH_SET_HEADER <ext/hash_set>
  76. # define BOOST_HASH_MAP_HEADER <ext/hash_map>
  77. # else
  78. # define BOOST_HASH_SET_HEADER <backward/hash_set>
  79. # define BOOST_HASH_MAP_HEADER <backward/hash_map>
  80. # endif
  81. #endif
  82. // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
  83. // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
  84. // developers. He also commented:
  85. //
  86. // "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
  87. // GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
  88. // Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
  89. // than any release in the 4.2 series."
  90. //
  91. // Another resource for understanding stdlibc++ features is:
  92. // http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
  93. // C++0x headers in GCC 4.3.0 and later
  94. //
  95. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  96. # define BOOST_NO_CXX11_HDR_ARRAY
  97. # define BOOST_NO_CXX11_HDR_REGEX
  98. # define BOOST_NO_CXX11_HDR_TUPLE
  99. # define BOOST_NO_CXX11_HDR_UNORDERED_MAP
  100. # define BOOST_NO_CXX11_HDR_UNORDERED_SET
  101. # define BOOST_NO_CXX11_HDR_FUNCTIONAL
  102. #endif
  103. // C++0x headers in GCC 4.4.0 and later
  104. //
  105. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  106. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  107. # define BOOST_NO_CXX11_HDR_FORWARD_LIST
  108. # define BOOST_NO_CXX11_HDR_INITIALIZER_LIST
  109. # define BOOST_NO_CXX11_HDR_MUTEX
  110. # define BOOST_NO_CXX11_HDR_RATIO
  111. # define BOOST_NO_CXX11_HDR_SYSTEM_ERROR
  112. # define BOOST_NO_CXX11_SMART_PTR
  113. #else
  114. # define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
  115. # define BOOST_HAS_TR1_COMPLEX_OVERLOADS
  116. #endif
  117. #if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_CXX11_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_CXX11_HDR_MUTEX))
  118. # define BOOST_NO_CXX11_HDR_CONDITION_VARIABLE
  119. # define BOOST_NO_CXX11_HDR_MUTEX
  120. #endif
  121. // C++0x features in GCC 4.5.0 and later
  122. //
  123. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  124. # define BOOST_NO_CXX11_NUMERIC_LIMITS
  125. # define BOOST_NO_CXX11_HDR_FUTURE
  126. # define BOOST_NO_CXX11_HDR_RANDOM
  127. #endif
  128. // C++0x features in GCC 4.6.0 and later
  129. //
  130. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  131. # define BOOST_NO_CXX11_HDR_TYPEINDEX
  132. #endif
  133. // C++0x features in GCC 4.7.0 and later
  134. //
  135. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 7) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  136. // Note that although <chrono> existed prior to 4.7, "stead_clock" is spelled "monotonic_clock"
  137. // so 4.7.0 is the first truely conforming one.
  138. # define BOOST_NO_CXX11_HDR_CHRONO
  139. # define BOOST_NO_CXX11_ALLOCATOR
  140. #endif
  141. // C++0x headers not yet (fully!) implemented
  142. //
  143. # define BOOST_NO_CXX11_HDR_THREAD
  144. # define BOOST_NO_CXX11_HDR_TYPE_TRAITS
  145. # define BOOST_NO_CXX11_HDR_CODECVT
  146. # define BOOST_NO_CXX11_ATOMIC_SMART_PTR
  147. // --- end ---