libstdcpp3.hpp 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. #ifdef __GLIBCXX__
  10. #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
  11. #else
  12. #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCPP__)
  13. #endif
  14. #if !defined(_GLIBCPP_USE_WCHAR_T) && !defined(_GLIBCXX_USE_WCHAR_T)
  15. # define BOOST_NO_CWCHAR
  16. # define BOOST_NO_CWCTYPE
  17. # define BOOST_NO_STD_WSTRING
  18. # define BOOST_NO_STD_WSTREAMBUF
  19. #endif
  20. #if defined(__osf__) && !defined(_REENTRANT) \
  21. && ( defined(_GLIBCXX_HAVE_GTHR_DEFAULT) || defined(_GLIBCPP_HAVE_GTHR_DEFAULT) )
  22. // GCC 3 on Tru64 forces the definition of _REENTRANT when any std lib header
  23. // file is included, therefore for consistency we define it here as well.
  24. # define _REENTRANT
  25. #endif
  26. #ifdef __GLIBCXX__ // gcc 3.4 and greater:
  27. # if defined(_GLIBCXX_HAVE_GTHR_DEFAULT) \
  28. || defined(_GLIBCXX__PTHREADS)
  29. //
  30. // If the std lib has thread support turned on, then turn it on in Boost
  31. // as well. We do this because some gcc-3.4 std lib headers define _REENTANT
  32. // while others do not...
  33. //
  34. # define BOOST_HAS_THREADS
  35. # else
  36. # define BOOST_DISABLE_THREADS
  37. # endif
  38. #elif defined(__GLIBCPP__) \
  39. && !defined(_GLIBCPP_HAVE_GTHR_DEFAULT) \
  40. && !defined(_GLIBCPP__PTHREADS)
  41. // disable thread support if the std lib was built single threaded:
  42. # define BOOST_DISABLE_THREADS
  43. #endif
  44. #if (defined(linux) || defined(__linux) || defined(__linux__)) && defined(__arm__) && defined(_GLIBCPP_HAVE_GTHR_DEFAULT)
  45. // linux on arm apparently doesn't define _REENTRANT
  46. // so just turn on threading support whenever the std lib is thread safe:
  47. # define BOOST_HAS_THREADS
  48. #endif
  49. #if !defined(_GLIBCPP_USE_LONG_LONG) \
  50. && !defined(_GLIBCXX_USE_LONG_LONG)\
  51. && defined(BOOST_HAS_LONG_LONG)
  52. // May have been set by compiler/*.hpp, but "long long" without library
  53. // support is useless.
  54. # undef BOOST_HAS_LONG_LONG
  55. #endif
  56. #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
  57. # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
  58. # define BOOST_HAS_SLIST
  59. # define BOOST_HAS_HASH
  60. # define BOOST_SLIST_HEADER <ext/slist>
  61. # if !defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
  62. # define BOOST_HASH_SET_HEADER <ext/hash_set>
  63. # define BOOST_HASH_MAP_HEADER <ext/hash_map>
  64. # else
  65. # define BOOST_HASH_SET_HEADER <backward/hash_set>
  66. # define BOOST_HASH_MAP_HEADER <backward/hash_map>
  67. # endif
  68. #endif
  69. // stdlibc++ C++0x support is detected via __GNUC__, __GNUC_MINOR__, and possibly
  70. // __GNUC_PATCHLEVEL__ at the suggestion of Jonathan Wakely, one of the stdlibc++
  71. // developers. He also commented:
  72. //
  73. // "I'm not sure how useful __GLIBCXX__ is for your purposes, for instance in
  74. // GCC 4.2.4 it is set to 20080519 but in GCC 4.3.0 it is set to 20080305.
  75. // Although 4.3.0 was released earlier than 4.2.4, it has better C++0x support
  76. // than any release in the 4.2 series."
  77. //
  78. // Another resource for understanding stdlibc++ features is:
  79. // http://gcc.gnu.org/onlinedocs/libstdc++/manual/status.html#manual.intro.status.standard.200x
  80. // C++0x headers in GCC 4.3.0 and later
  81. //
  82. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  83. # define BOOST_NO_0X_HDR_ARRAY
  84. # define BOOST_NO_0X_HDR_RANDOM
  85. # define BOOST_NO_0X_HDR_REGEX
  86. # define BOOST_NO_0X_HDR_TUPLE
  87. # define BOOST_NO_0X_HDR_TYPE_TRAITS
  88. # define BOOST_NO_STD_UNORDERED // deprecated; see following
  89. # define BOOST_NO_0X_HDR_UNORDERED_MAP
  90. # define BOOST_NO_0X_HDR_UNORDERED_SET
  91. #endif
  92. // C++0x headers in GCC 4.4.0 and later
  93. //
  94. #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
  95. # define BOOST_NO_0X_HDR_CHRONO
  96. # define BOOST_NO_0X_HDR_CONDITION_VARIABLE
  97. # define BOOST_NO_0X_HDR_FORWARD_LIST
  98. # define BOOST_NO_0X_HDR_INITIALIZER_LIST
  99. # define BOOST_NO_0X_HDR_MUTEX
  100. # define BOOST_NO_0X_HDR_RATIO
  101. # define BOOST_NO_0X_HDR_SYSTEM_ERROR
  102. # define BOOST_NO_0X_HDR_THREAD
  103. #endif
  104. // C++0x headers not yet implemented
  105. //
  106. # define BOOST_NO_0X_HDR_CODECVT
  107. # define BOOST_NO_0X_HDR_CONCEPTS
  108. # define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
  109. # define BOOST_NO_0X_HDR_FUTURE
  110. # define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
  111. # define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
  112. // --- end ---