Merge pull request #28 from boostorg/c20170611

Mingw fixes
This commit is contained in:
jzmaddock
2017-06-13 08:57:16 +01:00
committed by GitHub
5 changed files with 12 additions and 5 deletions

View File

@@ -104,6 +104,9 @@ public:
&& (std::numeric_limits<Float>::digits <= (int)bit_count)
&& (std::numeric_limits<Float>::radix == 2)
&& (std::numeric_limits<Float>::is_specialized)
#ifdef BOOST_HAS_FLOAT128
&& !boost::is_same<Float, __float128>::value
#endif
>::type const* = 0)
: m_data(), m_exponent(0), m_sign(false)
{
@@ -117,7 +120,10 @@ public:
&& (std::numeric_limits<Float>::digits > (int)bit_count)
&& (std::numeric_limits<Float>::radix == 2)
&& (std::numeric_limits<Float>::is_specialized)
>::type const* = 0)
#ifdef BOOST_HAS_FLOAT128
&& !boost::is_same<Float, __float128>::value
#endif
>::type const* = 0)
: m_data(), m_exponent(0), m_sign(false)
{
this->assign_float(f);

View File

@@ -2896,7 +2896,7 @@ template <unsigned Digits10, class ExponentType, class Allocator, class ArgType>
inline void eval_scalbn(cpp_dec_float<Digits10, ExponentType, Allocator>& result, const cpp_dec_float<Digits10, ExponentType, Allocator>& val, ArgType e_)
{
using default_ops::eval_multiply;
const ExponentType e = e_;
const ExponentType e = static_cast<ExponentType>(e_);
cpp_dec_float<Digits10, ExponentType, Allocator> t(1.0, e);
eval_multiply(result, val, t);
}

View File

@@ -1479,7 +1479,7 @@ inline typename B::exponent_type eval_ilogb(const B& val)
{
case FP_NAN:
#ifdef FP_ILOGBNAN
return FP_ILOGBNAN;
return FP_ILOGBNAN > 0 ? (std::numeric_limits<typename B::exponent_type>::max)() : (std::numeric_limits<typename B::exponent_type>::min)();
#else
return (std::numeric_limits<typename B::exponent_type>::max)();
#endif

View File

@@ -38,8 +38,9 @@
//
// Thread local storage:
// Note fails on Mingw, see https://sourceforge.net/p/mingw-w64/bugs/527/
//
#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL)
#if !defined(BOOST_NO_CXX11_THREAD_LOCAL) && !defined(BOOST_INTEL) && !defined(__MINGW32__)
# define BOOST_MP_THREAD_LOCAL thread_local
#else
# define BOOST_MP_THREAD_LOCAL

View File

@@ -1263,7 +1263,7 @@ void test_c99_appendix_F()
typename T::backend_type::exponent_type fp_ilogb0 = (std::numeric_limits<typename T::backend_type::exponent_type>::min)();
typename T::backend_type::exponent_type fp_ilogbnan =
#ifdef FP_ILOGBNAN
FP_ILOGBNAN;
FP_ILOGBNAN < 0 ? (std::numeric_limits<typename T::backend_type::exponent_type>::min)() : (std::numeric_limits<typename T::backend_type::exponent_type>::max)();
#else
INT_MAX;
#endif