X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Fmath%2Ftools%2Fconfig.hpp;fp=boost%2Fmath%2Ftools%2Fconfig.hpp;h=6dfb629b584bb9f9117407d400a815e38003db3e;hp=f11a0a94bb5888660a1f78a37c71af2f876ce05f;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/math/tools/config.hpp b/boost/math/tools/config.hpp index f11a0a9..6dfb629 100644 --- a/boost/math/tools/config.hpp +++ b/boost/math/tools/config.hpp @@ -10,21 +10,22 @@ #pragma once #endif -#include // for boost::uintmax_t #include +#include // for boost::uintmax_t #include #include // for min and max #include #include +#include #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) # include #endif #include -#include #if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \ - || defined(__hppa) || defined(__NO_LONG_DOUBLE_MATH)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) + || (defined(__hppa) && !defined(__OpenBSD__)) || (defined(__NO_LONG_DOUBLE_MATH) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \ + && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) # define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS #endif #if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) @@ -38,6 +39,13 @@ # define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM) # include #endif +#ifdef __IBMCPP__ +// +// For reasons I don't unserstand, the tests with IMB's compiler all +// pass at long double precision, but fail with real_concept, those tests +// are disabled for now. (JM 2012). +# define BOOST_MATH_NO_REAL_CONCEPT_TESTS +#endif #if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) // // Darwin's rather strange "double double" is rather hard to @@ -90,9 +98,14 @@ # define BOOST_MATH_USE_C99 #endif +#if defined(_LIBCPP_VERSION) && !defined(_MSC_VER) +# define BOOST_MATH_USE_C99 +#endif + #if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \ || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \ - || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99)) + || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\ + || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) # define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY #endif @@ -132,7 +145,7 @@ #endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS -#if defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__) +#if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(BOOST_MATH_SMALL_CONSTANT) // Sun's compiler emits a hard error if a constant underflows, // as does aCC on PA-RISC, while gcc issues a large number of warnings: # define BOOST_MATH_SMALL_CONSTANT(x) 0 @@ -194,6 +207,22 @@ #ifndef BOOST_MATH_INT_VALUE_SUFFIX # define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF #endif +// +// Test whether to support __float128: +// +#if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__) +// +// Only enable this when the compiler really is GCC as clang and probably +// intel too don't support __float128 yet :-( +// +# define BOOST_MATH_USE_FLOAT128 +#endif +// +// Check for WinCE with no iostream support: +// +#if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT) +# define BOOST_MATH_NO_LEXICAL_CAST +#endif // // Helper macro for controlling the FP behaviour: @@ -204,7 +233,7 @@ // // Helper macro for using statements: // -#define BOOST_MATH_STD_USING \ +#define BOOST_MATH_STD_USING_CORE \ using std::abs;\ using std::acos;\ using std::cos;\ @@ -227,15 +256,9 @@ using std::ceil;\ using std::floor;\ using std::log10;\ - using std::sqrt;\ - using boost::math::round;\ - using boost::math::iround;\ - using boost::math::lround;\ - using boost::math::trunc;\ - using boost::math::itrunc;\ - using boost::math::ltrunc;\ - using boost::math::modf; + using std::sqrt; +#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE namespace boost{ namespace math{ namespace tools @@ -252,14 +275,23 @@ inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) { return (std::max)((std::max)(a, b), (std::max)(c, d)); } + } // namespace tools + +template +void suppress_unused_variable_warning(const T&) +{ +} + }} // namespace boost namespace math -#if (defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__) +#if ((defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H) + + #include - #include +# ifdef FE_ALL_EXCEPT - namespace boost{ namespace math{ +namespace boost{ namespace math{ namespace detail { struct fpu_guard @@ -280,20 +312,36 @@ inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) } // namespace detail }} // namespaces -# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object; -# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0); +# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object; +# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0); + +# else + +# define BOOST_FPU_EXCEPTION_GUARD +# define BOOST_MATH_INSTRUMENT_FPU + +# endif + #else // All other platforms. # define BOOST_FPU_EXCEPTION_GUARD # define BOOST_MATH_INSTRUMENT_FPU #endif #ifdef BOOST_MATH_INSTRUMENT -#define BOOST_MATH_INSTRUMENT_CODE(x) \ - std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; -#define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name) + +# include +# include +# include + +# define BOOST_MATH_INSTRUMENT_CODE(x) \ + std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; +# define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name) + #else -#define BOOST_MATH_INSTRUMENT_CODE(x) -#define BOOST_MATH_INSTRUMENT_VARIABLE(name) + +# define BOOST_MATH_INSTRUMENT_CODE(x) +# define BOOST_MATH_INSTRUMENT_VARIABLE(name) + #endif #endif // BOOST_MATH_TOOLS_CONFIG_HPP