config.hpp 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // (C) Copyright Gennadiy Rozental 2001.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/test for the library home page.
  6. //
  7. //!@file
  8. //!@brief a central place for global configuration switches
  9. // ***************************************************************************
  10. #ifndef BOOST_TEST_CONFIG_HPP_071894GER
  11. #define BOOST_TEST_CONFIG_HPP_071894GER
  12. // Boost
  13. #include <boost/config.hpp> // compilers workarounds
  14. #include <boost/detail/workaround.hpp>
  15. #if defined(_WIN32) && !defined(BOOST_DISABLE_WIN32) && \
  16. (!defined(__COMO__) && !defined(__MWERKS__) && \
  17. !defined(__GNUC__) && !defined(BOOST_EMBTC) || \
  18. BOOST_WORKAROUND(__MWERKS__, >= 0x3000))
  19. # define BOOST_SEH_BASED_SIGNAL_HANDLING
  20. #endif
  21. #if defined(__COMO__) && defined(_MSC_VER)
  22. // eh.h uses type_info without declaring it.
  23. class type_info;
  24. # define BOOST_SEH_BASED_SIGNAL_HANDLING
  25. #endif
  26. //____________________________________________________________________________//
  27. #if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x570)) || \
  28. BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \
  29. (defined __sgi && BOOST_WORKAROUND(_COMPILER_VERSION, BOOST_TESTED_AT(730)))
  30. # define BOOST_TEST_SHIFTED_LINE
  31. #endif
  32. //____________________________________________________________________________//
  33. #if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
  34. # define BOOST_TEST_CALL_DECL __cdecl
  35. #else
  36. # define BOOST_TEST_CALL_DECL /**/
  37. #endif
  38. //____________________________________________________________________________//
  39. #if !defined(BOOST_NO_STD_LOCALE) && !defined(__MWERKS__)
  40. # define BOOST_TEST_USE_STD_LOCALE 1
  41. #endif
  42. //____________________________________________________________________________//
  43. #if BOOST_WORKAROUND(BOOST_BORLANDC, <= 0x570) || \
  44. BOOST_WORKAROUND( __COMO__, <= 0x433 ) || \
  45. BOOST_WORKAROUND( __INTEL_COMPILER, <= 800 ) || \
  46. defined(__sgi) && _COMPILER_VERSION <= 730 || \
  47. BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \
  48. defined(__DECCXX) || \
  49. defined(__DMC__)
  50. # define BOOST_TEST_NO_PROTECTED_USING
  51. #endif
  52. //____________________________________________________________________________//
  53. #if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
  54. #define BOOST_TEST_PROTECTED_VIRTUAL
  55. #else
  56. #define BOOST_TEST_PROTECTED_VIRTUAL virtual
  57. #endif
  58. //____________________________________________________________________________//
  59. #if !defined(BOOST_BORLANDC) && !BOOST_WORKAROUND( __SUNPRO_CC, < 0x5100 )
  60. #define BOOST_TEST_SUPPORT_TOKEN_ITERATOR 1
  61. #endif
  62. //____________________________________________________________________________//
  63. // Sun compiler does not support visibility on enums
  64. #if defined(__SUNPRO_CC)
  65. #define BOOST_TEST_ENUM_SYMBOL_VISIBLE
  66. #else
  67. #define BOOST_TEST_ENUM_SYMBOL_VISIBLE BOOST_SYMBOL_VISIBLE
  68. #endif
  69. //____________________________________________________________________________//
  70. #if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_TEST_DYN_LINK)
  71. # define BOOST_TEST_DYN_LINK
  72. #endif
  73. // in case any of the define from cmake/b2 is set
  74. #if !defined(BOOST_TEST_DYN_LINK) \
  75. && (defined(BOOST_UNIT_TEST_FRAMEWORK_DYN_LINK) \
  76. || defined(BOOST_TEST_EXEC_MONITOR_DYN_LINK) \
  77. || defined(BOOST_PRG_EXEC_MONITOR_DYN_LINK) )
  78. # define BOOST_TEST_DYN_LINK
  79. #endif
  80. #if defined(BOOST_TEST_INCLUDED)
  81. # undef BOOST_TEST_DYN_LINK
  82. #endif
  83. #if defined(BOOST_TEST_DYN_LINK)
  84. # define BOOST_TEST_ALTERNATIVE_INIT_API
  85. # ifdef BOOST_TEST_SOURCE
  86. # define BOOST_TEST_DECL BOOST_SYMBOL_EXPORT BOOST_SYMBOL_VISIBLE
  87. # else
  88. # define BOOST_TEST_DECL BOOST_SYMBOL_IMPORT BOOST_SYMBOL_VISIBLE
  89. # endif // BOOST_TEST_SOURCE
  90. #else
  91. # if defined(BOOST_TEST_INCLUDED)
  92. # define BOOST_TEST_DECL
  93. # else
  94. # define BOOST_TEST_DECL BOOST_SYMBOL_VISIBLE
  95. # endif
  96. #endif
  97. #if !defined(BOOST_TEST_MAIN) && defined(BOOST_AUTO_TEST_MAIN)
  98. #define BOOST_TEST_MAIN BOOST_AUTO_TEST_MAIN
  99. #endif
  100. #if !defined(BOOST_TEST_MAIN) && defined(BOOST_TEST_MODULE)
  101. #define BOOST_TEST_MAIN BOOST_TEST_MODULE
  102. #endif
  103. #ifndef BOOST_PP_VARIADICS /* we can change this only if not already defined */
  104. #ifdef __PGI
  105. #define BOOST_PP_VARIADICS 1
  106. #endif
  107. #if BOOST_CLANG
  108. #define BOOST_PP_VARIADICS 1
  109. #endif
  110. #if defined(BOOST_GCC) && (BOOST_GCC >= 4 * 10000 + 8 * 100)
  111. #define BOOST_PP_VARIADICS 1
  112. #endif
  113. #if defined(__NVCC__)
  114. #define BOOST_PP_VARIADICS 1
  115. #endif
  116. #endif /* ifndef BOOST_PP_VARIADICS */
  117. // some versions of VC exibit a manifest error with this BOOST_UNREACHABLE_RETURN
  118. #if BOOST_WORKAROUND(BOOST_MSVC, < 1910)
  119. # define BOOST_TEST_UNREACHABLE_RETURN(x) return x
  120. #else
  121. # define BOOST_TEST_UNREACHABLE_RETURN(x) BOOST_UNREACHABLE_RETURN(x)
  122. #endif
  123. //____________________________________________________________________________//
  124. // string_view support
  125. //____________________________________________________________________________//
  126. // note the code should always be compatible with compiled version of boost.test
  127. // using a pre-c++17 compiler
  128. #ifndef BOOST_NO_CXX17_HDR_STRING_VIEW
  129. #define BOOST_TEST_STRING_VIEW
  130. #endif
  131. #endif // BOOST_TEST_CONFIG_HPP_071894GER