update boost on linux
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <boost/config/no_tr1/cmath.hpp>
|
||||
#include <boost/limits.hpp>
|
||||
|
||||
#include <boost/math/special_functions/fpclassify.hpp>
|
||||
#include <boost/type_traits/is_integral.hpp>
|
||||
#include <boost/spirit/home/support/char_class.hpp>
|
||||
#include <boost/spirit/home/support/unused.hpp>
|
||||
@@ -68,7 +69,11 @@ namespace boost { namespace spirit { namespace traits
|
||||
typedef unsignedtype type; \
|
||||
static type call(signedtype n) \
|
||||
{ \
|
||||
return (n >= 0) ? n : (unsignedtype)(-n); \
|
||||
/* implementation is well-defined for one's complement, */ \
|
||||
/* two's complement, and signed magnitude architectures */ \
|
||||
/* by the C++ Standard. [conv.integral] [expr.unary.op] */ \
|
||||
return (n >= 0) ? static_cast<type>(n) \
|
||||
: -static_cast<type>(n); \
|
||||
} \
|
||||
} \
|
||||
/**/
|
||||
@@ -84,6 +89,11 @@ namespace boost { namespace spirit { namespace traits
|
||||
} \
|
||||
/**/
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
// unary minus operator applied to unsigned type, result still unsigned
|
||||
# pragma warning(disable: 4146)
|
||||
#endif
|
||||
BOOST_SPIRIT_ABSOLUTE_VALUE(signed char, unsigned char);
|
||||
BOOST_SPIRIT_ABSOLUTE_VALUE(char, unsigned char);
|
||||
BOOST_SPIRIT_ABSOLUTE_VALUE(short, unsigned short);
|
||||
@@ -97,6 +107,9 @@ namespace boost { namespace spirit { namespace traits
|
||||
BOOST_SPIRIT_ABSOLUTE_VALUE(boost::long_long_type, boost::ulong_long_type);
|
||||
BOOST_SPIRIT_ABSOLUTE_VALUE_UNSIGNED(boost::ulong_long_type);
|
||||
#endif
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
|
||||
#undef BOOST_SPIRIT_ABSOLUTE_VALUE
|
||||
#undef BOOST_SPIRIT_ABSOLUTE_VALUE_UNSIGNED
|
||||
@@ -285,7 +298,7 @@ namespace boost { namespace spirit { namespace traits
|
||||
{
|
||||
static bool call(T n)
|
||||
{
|
||||
if (!std::numeric_limits<T>::has_infinity)
|
||||
if (!std::numeric_limits<T>::has_infinity)
|
||||
return false;
|
||||
return (n == std::numeric_limits<T>::infinity()) ? true : false;
|
||||
}
|
||||
@@ -771,4 +784,3 @@ namespace boost { namespace spirit { namespace karma
|
||||
}}}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -105,7 +105,13 @@ namespace boost { namespace spirit { namespace karma
|
||||
if (exp != -dim)
|
||||
++exp;
|
||||
dim = static_cast<U>(-exp);
|
||||
n *= spirit::traits::pow10<U>(exp);
|
||||
// detect and handle denormalized numbers to prevent overflow in pow10
|
||||
if (exp > std::numeric_limits<U>::max_exponent10)
|
||||
{
|
||||
n *= spirit::traits::pow10<U>(std::numeric_limits<U>::max_exponent10);
|
||||
n *= spirit::traits::pow10<U>(exp - std::numeric_limits<U>::max_exponent10);
|
||||
} else
|
||||
n *= spirit::traits::pow10<U>(exp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user