Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:24

0001 ///////////////////////////////////////////////////////////////
0002 //  Copyright 2010 - 2021 Douglas Gregor
0003 //  Copyright 2021 Matt Borland.
0004 //  Distributed under the Boost Software License, Version 1.0.
0005 //  See accompanying file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt
0006 //
0007 //  Used to support configuration options depending on standalone context
0008 //  by providing either required support or disabling functionality  
0009 
0010 #ifndef BOOST_MP_STANDALONE_CONFIG_HPP
0011 #define BOOST_MP_STANDALONE_CONFIG_HPP
0012 
0013 #include <climits>
0014 
0015 // Boost.Config is dependency free so it is considered a requirement to use Boost.Multiprecision in standalone mode
0016 #ifdef __has_include
0017 #  if __has_include(<boost/config.hpp>)
0018 #    include <boost/config.hpp>
0019 #    include <boost/config/workaround.hpp>
0020 #  else
0021 #    error "Boost.Config is considered a requirement to use Boost.Multiprecision in standalone mode. A package is provided at https://github.com/boostorg/multiprecision/releases"
0022 #  endif
0023 #else
0024 // Provides the less helpful fatal error: 'boost/config.hpp' file not found if not available
0025 #  include <boost/config.hpp>
0026 #  include <boost/config/workaround.hpp>
0027 #endif
0028 
0029 // Minimum language standard transition
0030  #ifdef _MSVC_LANG
0031  #  if _MSVC_LANG < 201402L
0032  #    pragma warning("The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)");
0033  #  endif
0034  #else
0035  #  if __cplusplus < 201402L
0036  #    warning "The minimum language standard to use Boost.Math will be C++14 starting in July 2023 (Boost 1.82 release)"
0037  #  endif
0038  #endif
0039 
0040 // If any of the most frequently used boost headers are missing assume that standalone mode is supposed to be used
0041 #ifdef __has_include
0042 #if !__has_include(<boost/assert.hpp>) || !__has_include(<boost/lexical_cast.hpp>) || \
0043     !__has_include(<boost/throw_exception.hpp>) || !__has_include(<boost/predef/other/endian.h>)
0044 #   ifndef BOOST_MP_STANDALONE
0045 #       define BOOST_MP_STANDALONE
0046 #   endif
0047 #endif
0048 #endif
0049 
0050 #ifndef BOOST_MP_STANDALONE
0051 
0052 #include <boost/integer.hpp>
0053 #include <boost/integer_traits.hpp>
0054 
0055 // Required typedefs for interoperability with standalone mode
0056 #if defined(BOOST_HAS_INT128) && defined(__cplusplus)
0057 namespace boost { namespace multiprecision {
0058    using int128_type = boost::int128_type;
0059    using uint128_type = boost::uint128_type;
0060 }}
0061 #endif
0062 #if defined(BOOST_HAS_FLOAT128) && defined(__cplusplus)
0063 namespace boost { namespace multiprecision {
0064    using float128_type = boost::float128_type;
0065 }}
0066 #endif
0067 
0068 // Boost.Math available by default
0069 #define BOOST_MP_MATH_AVAILABLE
0070 
0071 #else // Standalone mode
0072 
0073 #ifdef BOOST_MATH_STANDALONE
0074 #  define BOOST_MP_MATH_AVAILABLE
0075 #endif
0076 
0077 #ifndef BOOST_MP_MATH_AVAILABLE
0078 #  define BOOST_MATH_INSTRUMENT_CODE(x)
0079 #endif
0080 
0081 // Prevent Macro sub
0082 #ifndef BOOST_PREVENT_MACRO_SUBSTITUTION
0083 #  define BOOST_PREVENT_MACRO_SUBSTITUTION
0084 #endif
0085 
0086 #if defined(BOOST_HAS_INT128) && defined(__cplusplus)
0087 namespace boost { namespace multiprecision {
0088 #  ifdef __GNUC__
0089    __extension__ typedef __int128 int128_type;
0090    __extension__ typedef unsigned __int128 uint128_type;
0091 #  else
0092    typedef __int128 int128_type;
0093    typedef unsigned __int128 uint128_type;
0094 #  endif
0095 }}
0096 
0097 #endif
0098 // same again for __float128:
0099 #if defined(BOOST_HAS_FLOAT128) && defined(__cplusplus)
0100 namespace boost { namespace multiprecision {
0101 #  ifdef __GNUC__
0102    __extension__ typedef __float128 float128_type;
0103 #  else
0104    typedef __float128 float128_type;
0105 #  endif
0106 }}
0107 
0108 #endif
0109 
0110 #endif // BOOST_MP_STANDALONE
0111 
0112 // Workarounds for numeric limits on old compilers
0113 #ifdef BOOST_HAS_INT128
0114 #  ifndef INT128_MAX
0115 #    define INT128_MAX static_cast<boost::multiprecision::int128_type>((static_cast<boost::multiprecision::uint128_type>(1) << ((__SIZEOF_INT128__ * __CHAR_BIT__) - 1)) - 1)
0116 #  endif
0117 #  ifndef INT128_MIN
0118 #    define INT128_MIN (-INT128_MAX - 1)
0119 #  endif
0120 #  ifndef UINT128_MAX
0121 #    define UINT128_MAX ((2 * static_cast<boost::multiprecision::uint128_type>(INT128_MAX)) + 1)
0122 #  endif
0123 #endif
0124 
0125 #define BOOST_MP_CXX14_CONSTEXPR BOOST_CXX14_CONSTEXPR
0126 //
0127 // Early compiler versions trip over the constexpr code:
0128 //
0129 #if defined(__clang__) && (__clang_major__ < 5)
0130 #undef BOOST_MP_CXX14_CONSTEXPR
0131 #define BOOST_MP_CXX14_CONSTEXPR
0132 #endif
0133 #if defined(__apple_build_version__) && (__clang_major__ < 9)
0134 #undef BOOST_MP_CXX14_CONSTEXPR
0135 #define BOOST_MP_CXX14_CONSTEXPR
0136 #endif
0137 #if defined(BOOST_GCC) && (__GNUC__ < 6)
0138 #undef BOOST_MP_CXX14_CONSTEXPR
0139 #define BOOST_MP_CXX14_CONSTEXPR
0140 #endif
0141 #if defined(BOOST_INTEL)
0142 #undef BOOST_MP_CXX14_CONSTEXPR
0143 #define BOOST_MP_CXX14_CONSTEXPR
0144 #define BOOST_MP_NO_CONSTEXPR_DETECTION
0145 #endif
0146 
0147 
0148 #endif // BOOST_MP_STANDALONE_CONFIG_HPP