This PR adds the code of Boost.Math as of version 1.89 into the third-party directory, as discussed in a recent RFC [1]. The goal is for this code to be used as a back-end for the C++17 Math Special Functions. As explained in third-paty/README.md, this code is cleared for usage inside libc++ for the Math Special functions, however the LLVM Foundation should be consulted before using this code anywhere else in the LLVM project, due to the fact that it is under the Boost Software License (as opposed to the usual LLVM license). See the RFC [1] for more details. [1]: https://discourse.llvm.org/t/rfc-libc-taking-a-dependency-on-boost-math-for-the-c-17-math-special-functions
53 lines
1.2 KiB
C++
53 lines
1.2 KiB
C++
// (C) Copyright John Maddock 2023.
|
|
// Use, modification and distribution are subject to the
|
|
// Boost Software License, Version 1.0. (See accompanying file
|
|
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
//
|
|
// Core configuration for ccmath functions, basically will they work or not?
|
|
|
|
#ifndef BOOST_MATH_CCMATH_DETAIL_CONFIG
|
|
#define BOOST_MATH_CCMATH_DETAIL_CONFIG
|
|
|
|
#include <cmath>
|
|
#include <type_traits>
|
|
#include <limits>
|
|
#include <boost/math/tools/is_constant_evaluated.hpp>
|
|
#include <boost/math/tools/is_standalone.hpp>
|
|
|
|
#ifndef BOOST_MATH_STANDALONE
|
|
|
|
#include <boost/config.hpp>
|
|
#ifdef BOOST_MATH_NO_CXX17_IF_CONSTEXPR
|
|
# define BOOST_MATH_NO_CCMATH
|
|
#endif
|
|
|
|
#else // BOOST_MATH_STANDALONE
|
|
|
|
#if defined(_MSC_VER)
|
|
|
|
#if defined(_MSVC_LANG) && (_MSVC_LANG < 201703)
|
|
# define BOOST_MATH_NO_CCMATH
|
|
#endif
|
|
|
|
#else // _MSC_VER
|
|
|
|
#if (__cplusplus < 201703)
|
|
# define BOOST_MATH_NO_CCMATH
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#ifndef _MSC_VER
|
|
//
|
|
// Don't check here for msvc as they didn't get std lib configuration macros at the same time as C++17 <type_traits>
|
|
//
|
|
#if (defined(__cpp_lib_bool_constant) && __cpp_lib_bool_constant < 201505L) && !defined(BOOST_MATH_NO_CCMATH)
|
|
# define BOOST_MATH_NO_CCMATH
|
|
#endif
|
|
#endif
|
|
|
|
|
|
#endif
|