2
0
mirror of https://github.com/boostorg/math.git synced 2026-01-30 20:12:09 +00:00

Fix Intel/Linux compile failures, and reinstate some old workarounds for broken std::fpclassify implementations.

[SVN r50161]
This commit is contained in:
John Maddock
2008-12-06 16:06:15 +00:00
parent ae98d17de0
commit adb945b074
2 changed files with 35 additions and 20 deletions

View File

@@ -224,29 +224,14 @@ int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag)
return FP_NAN;
}
#if defined(BOOST_HAS_FPCLASSIFY)
template<class T, class U>
inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, const U&)
#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
template <>
inline int fpclassify_imp<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
{
return BOOST_FPCLASSIFY_PREFIX fpclassify BOOST_NO_MACRO_EXPAND(x);
}
#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
|| defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
|| (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))
// The native fpclassify broken for long doubles
// use portable one instead....
template<class U>
inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(long double t, const U&)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
typedef generic_tag<std::numeric_limits<T>::is_specialized> method;
#else
typedef generic_tag<false> method;
#endif
return fpclassify_imp BOOST_NO_MACRO_EXPAND(t, method(), t);
return boost::math::detail::fpclassify_imp(t, generic_tag<true>());
}
#endif
#endif
} // namespace detail
template <class T>
@@ -299,6 +284,14 @@ namespace detail {
return a != traits::exponent;
}
#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
template <>
inline bool isfinite_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
{
return boost::math::detail::isfinite_impl(t, generic_tag<true>());
}
#endif
}
template<class T>
@@ -348,6 +341,14 @@ namespace detail {
return (a != 0) && (a < traits::exponent);
}
#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
template <>
inline bool isnormal_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
{
return boost::math::detail::isnormal_impl(t, generic_tag<true>());
}
#endif
}
template<class T>
@@ -414,6 +415,14 @@ namespace detail {
return x == 0;
}
#if defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
template <>
inline bool isinf_impl<long double> BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
{
return boost::math::detail::isinf_impl(t, generic_tag<true>());
}
#endif
} // namespace detail
template<class T>

View File

@@ -82,6 +82,12 @@
# 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))
# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
#endif
#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
# include "boost/type.hpp"