config.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // (C) Copyright John Maddock 2023.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. //
  6. // Core configuration for ccmath functions, basically will they work or not?
  7. #ifndef BOOST_MATH_CCMATH_DETAIL_CONFIG
  8. #define BOOST_MATH_CCMATH_DETAIL_CONFIG
  9. #include <cmath>
  10. #include <type_traits>
  11. #include <limits>
  12. #include <boost/math/tools/is_constant_evaluated.hpp>
  13. #include <boost/math/tools/is_standalone.hpp>
  14. #ifndef BOOST_MATH_STANDALONE
  15. #include <boost/config.hpp>
  16. #ifdef BOOST_MATH_NO_CXX17_IF_CONSTEXPR
  17. # define BOOST_MATH_NO_CCMATH
  18. #endif
  19. #else // BOOST_MATH_STANDALONE
  20. #if defined(_MSC_VER)
  21. #if defined(_MSVC_LANG) && (_MSVC_LANG < 201703)
  22. # define BOOST_MATH_NO_CCMATH
  23. #endif
  24. #else // _MSC_VER
  25. #if (__cplusplus < 201703)
  26. # define BOOST_MATH_NO_CCMATH
  27. #endif
  28. #endif
  29. #endif
  30. #ifndef _MSC_VER
  31. //
  32. // Don't check here for msvc as they didn't get std lib configuration macros at the same time as C++17 <type_traits>
  33. //
  34. #if (defined(__cpp_lib_bool_constant) && __cpp_lib_bool_constant < 201505L) && !defined(BOOST_MATH_NO_CCMATH)
  35. # define BOOST_MATH_NO_CCMATH
  36. #endif
  37. #endif
  38. #endif