config.hpp 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
  2. // Use, modification and distribution are subject to the Boost Software License,
  3. // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt).
  5. //
  6. // See http://www.boost.org/libs/type_traits for most recent version including documentation.
  7. #ifndef BOOST_TT_CONFIG_HPP_INCLUDED
  8. #define BOOST_TT_CONFIG_HPP_INCLUDED
  9. #ifndef BOOST_CONFIG_HPP
  10. #include <boost/config.hpp>
  11. #endif
  12. #include <boost/version.hpp>
  13. #include <boost/config/workaround.hpp>
  14. //
  15. // whenever we have a conversion function with ellipses
  16. // it needs to be declared __cdecl to suppress compiler
  17. // warnings from MS and Borland compilers (this *must*
  18. // appear before we include is_same.hpp below):
  19. #if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
  20. # define BOOST_TT_DECL __cdecl
  21. #else
  22. # define BOOST_TT_DECL /**/
  23. #endif
  24. # if (BOOST_WORKAROUND(__MWERKS__, < 0x3000) \
  25. || BOOST_WORKAROUND(__IBMCPP__, < 600 ) \
  26. || BOOST_WORKAROUND(__BORLANDC__, < 0x5A0) \
  27. || defined(__ghs) \
  28. || BOOST_WORKAROUND(__HP_aCC, < 60700) \
  29. || BOOST_WORKAROUND(MPW_CPLUS, BOOST_TESTED_AT(0x890)) \
  30. || BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x580))) \
  31. && defined(BOOST_NO_IS_ABSTRACT)
  32. # define BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION 1
  33. #endif
  34. #ifndef BOOST_TT_NO_CONFORMING_IS_CLASS_IMPLEMENTATION
  35. # define BOOST_TT_HAS_CONFORMING_IS_CLASS_IMPLEMENTATION 1
  36. #endif
  37. //
  38. // define BOOST_TT_TEST_MS_FUNC_SIGS
  39. // when we want to test __stdcall etc function types with is_function etc
  40. // (Note, does not work with Borland, even though it does support __stdcall etc):
  41. //
  42. #if defined(_MSC_EXTENSIONS) && !defined(__BORLANDC__)
  43. # define BOOST_TT_TEST_MS_FUNC_SIGS
  44. #endif
  45. //
  46. // define BOOST_TT_NO_CV_FUNC_TEST
  47. // if tests for cv-qualified member functions don't
  48. // work in is_member_function_pointer
  49. //
  50. #if BOOST_WORKAROUND(__MWERKS__, < 0x3000) || BOOST_WORKAROUND(__IBMCPP__, <= 600)
  51. # define BOOST_TT_NO_CV_FUNC_TEST
  52. #endif
  53. //
  54. // Macros that have been deprecated, defined here for backwards compatibility:
  55. //
  56. #define BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(x)
  57. #define BOOST_TT_BROKEN_COMPILER_SPEC(x)
  58. //
  59. // Can we implement "accurate" binary operator detection:
  60. //
  61. #if !defined(BOOST_NO_SFINAE_EXPR) && !defined(BOOST_NO_CXX11_DECLTYPE) && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(BOOST_GCC, < 40900)
  62. # define BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION
  63. #endif
  64. #if defined(__clang__) && (__clang_major__ == 3) && (__clang_minor__ < 2) && defined(BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION)
  65. #undef BOOST_TT_HAS_ACCURATE_BINARY_OPERATOR_DETECTION
  66. #endif
  67. //
  68. // Can we implement accurate is_function/is_member_function_pointer (post C++03)?
  69. //
  70. #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !BOOST_WORKAROUND(BOOST_GCC, < 40805)\
  71. && !BOOST_WORKAROUND(BOOST_MSVC, < 1900) && !BOOST_WORKAROUND(__clang_major__, <= 4)
  72. # define BOOST_TT_HAS_ASCCURATE_IS_FUNCTION
  73. #endif
  74. #if defined(_MSVC_LANG) && (_MSVC_LANG >= 201703)
  75. # define BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM
  76. #endif
  77. #if defined(__APPLE_CC__) && defined(__clang_major__) && (__clang_major__ == 9) && (__clang_minor__ == 0)
  78. # define BOOST_TT_NO_DEDUCED_NOEXCEPT_PARAM
  79. # define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE
  80. #endif
  81. //
  82. // If we have the SD6 macros (check for C++11's __cpp_rvalue_references), and we don't have __cpp_noexcept_function_type
  83. // set, then don't treat noexcept functions as seperate types. This is a fix for msvc with the /Zc:noexceptTypes- flag set.
  84. //
  85. #if defined(__cpp_rvalue_references) && !defined(__cpp_noexcept_function_type) && !defined(BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE)
  86. # define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE
  87. #endif
  88. //
  89. // Check MSVC specific macro on older msvc compilers that don't support the SD6 macros, we don't rely on this
  90. // if the SD6 macros *are* available as it appears to be undocumented.
  91. //
  92. #if defined(BOOST_MSVC) && !defined(__cpp_rvalue_references) && !defined(BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE) && !defined(_NOEXCEPT_TYPES_SUPPORTED)
  93. # define BOOST_TT_NO_NOEXCEPT_SEPARATE_TYPE
  94. #endif
  95. #endif // BOOST_TT_CONFIG_HPP_INCLUDED