forked from boostorg/conversion
Get rid of BOOST_LCAST_HAS_INT128 macro and use BOOST_HAS_INT128 instead (refs #8790)
[SVN r85073]
This commit is contained in:
@@ -69,11 +69,6 @@
|
|||||||
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
|
throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// GCC 4.6 has some issues with int128 and uint128. Issues were fixed in GCC 4.7
|
|
||||||
#if defined(BOOST_HAS_INT128) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
|
|
||||||
#define BOOST_LCAST_HAS_INT128
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
// exception used to indicate runtime lexical_cast failure
|
// exception used to indicate runtime lexical_cast failure
|
||||||
@@ -316,7 +311,7 @@ namespace boost {
|
|||||||
> {};
|
> {};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
template <> struct stream_char_common< boost::int128_type >: public boost::mpl::identity< char > {};
|
template <> struct stream_char_common< boost::int128_type >: public boost::mpl::identity< char > {};
|
||||||
template <> struct stream_char_common< boost::uint128_type >: public boost::mpl::identity< char > {};
|
template <> struct stream_char_common< boost::uint128_type >: public boost::mpl::identity< char > {};
|
||||||
#endif
|
#endif
|
||||||
@@ -613,7 +608,7 @@ namespace boost {
|
|||||||
BOOST_LCAST_DEF(unsigned __int64)
|
BOOST_LCAST_DEF(unsigned __int64)
|
||||||
BOOST_LCAST_DEF( __int64)
|
BOOST_LCAST_DEF( __int64)
|
||||||
#endif
|
#endif
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
BOOST_LCAST_DEF(boost::int128_type)
|
BOOST_LCAST_DEF(boost::int128_type)
|
||||||
BOOST_LCAST_DEF(boost::uint128_type)
|
BOOST_LCAST_DEF(boost::uint128_type)
|
||||||
#endif
|
#endif
|
||||||
@@ -1836,7 +1831,7 @@ namespace boost {
|
|||||||
bool operator<<( __int64 n) { return shl_signed(n); }
|
bool operator<<( __int64 n) { return shl_signed(n); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
bool operator<<(const boost::uint128_type& n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
|
bool operator<<(const boost::uint128_type& n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
|
||||||
bool operator<<(const boost::int128_type& n) { return shl_signed(n); }
|
bool operator<<(const boost::int128_type& n) { return shl_signed(n); }
|
||||||
#endif
|
#endif
|
||||||
@@ -2048,7 +2043,7 @@ namespace boost {
|
|||||||
bool operator>>(__int64& output) { return shr_signed(output); }
|
bool operator>>(__int64& output) { return shr_signed(output); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
bool operator>>(boost::uint128_type& output) { return shr_unsigned(output); }
|
bool operator>>(boost::uint128_type& output) { return shr_unsigned(output); }
|
||||||
bool operator>>(boost::int128_type& output) { return shr_signed(output); }
|
bool operator>>(boost::int128_type& output) { return shr_signed(output); }
|
||||||
#endif
|
#endif
|
||||||
@@ -2728,7 +2723,6 @@ namespace boost {
|
|||||||
|
|
||||||
#undef BOOST_LCAST_THROW_BAD_CAST
|
#undef BOOST_LCAST_THROW_BAD_CAST
|
||||||
#undef BOOST_LCAST_NO_WCHAR_T
|
#undef BOOST_LCAST_NO_WCHAR_T
|
||||||
#undef BOOST_LCAST_HAS_INT128
|
|
||||||
|
|
||||||
#endif // BOOST_LEXICAL_CAST_INCLUDED
|
#endif // BOOST_LEXICAL_CAST_INCLUDED
|
||||||
|
|
||||||
|
@@ -48,10 +48,6 @@
|
|||||||
#define BOOST_LCAST_NO_WCHAR_T
|
#define BOOST_LCAST_NO_WCHAR_T
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(BOOST_HAS_INT128) && (!defined(__GNUC__) || __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6))
|
|
||||||
#define BOOST_LCAST_HAS_INT128
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Test all 65536 values if true:
|
// Test all 65536 values if true:
|
||||||
bool const lcast_test_small_integral_types_completely = false;
|
bool const lcast_test_small_integral_types_completely = false;
|
||||||
|
|
||||||
@@ -75,7 +71,7 @@ void test_conversion_from_to_uintmax_t();
|
|||||||
void test_conversion_from_to_longlong();
|
void test_conversion_from_to_longlong();
|
||||||
void test_conversion_from_to_ulonglong();
|
void test_conversion_from_to_ulonglong();
|
||||||
#endif
|
#endif
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
void test_conversion_from_to_int128();
|
void test_conversion_from_to_int128();
|
||||||
void test_conversion_from_to_uint128();
|
void test_conversion_from_to_uint128();
|
||||||
#endif
|
#endif
|
||||||
@@ -99,7 +95,7 @@ unit_test::test_suite *init_unit_test_suite(int, char *[])
|
|||||||
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_longlong));
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_longlong));
|
||||||
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_ulonglong));
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_ulonglong));
|
||||||
#endif
|
#endif
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_int128));
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_int128));
|
||||||
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_uint128));
|
suite->add(BOOST_TEST_CASE(&test_conversion_from_to_uint128));
|
||||||
#endif
|
#endif
|
||||||
@@ -557,7 +553,7 @@ void test_conversion_from_to_ulonglong()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
|
|
||||||
template <bool Specialized, class T>
|
template <bool Specialized, class T>
|
||||||
struct test_if_specialized {
|
struct test_if_specialized {
|
||||||
@@ -621,7 +617,7 @@ void test_integral_conversions_on_min_max()
|
|||||||
test_integral_conversions_on_min_max_impl<__int64>();
|
test_integral_conversions_on_min_max_impl<__int64>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef BOOST_LCAST_HAS_INT128
|
#ifdef BOOST_HAS_INT128
|
||||||
test_integral_conversions_on_min_max_impl<boost::int128_type>();
|
test_integral_conversions_on_min_max_impl<boost::int128_type>();
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user