Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r85073 - in trunk: boost libs/conversion/test
From: antoshkka_at_[hidden]
Date: 2013-07-18 05:13:41


Author: apolukhin
Date: 2013-07-18 05:13:41 EDT (Thu, 18 Jul 2013)
New Revision: 85073
URL: http://svn.boost.org/trac/boost/changeset/85073

Log:
Get rid of BOOST_LCAST_HAS_INT128 macro and use BOOST_HAS_INT128 instead (refs #8790)

Text files modified:
   trunk/boost/lexical_cast.hpp | 14 ++++----------
   trunk/libs/conversion/test/lexical_cast_integral_types_test.cpp | 12 ++++--------
   2 files changed, 8 insertions(+), 18 deletions(-)

Modified: trunk/boost/lexical_cast.hpp
==============================================================================
--- trunk/boost/lexical_cast.hpp Thu Jul 18 04:45:09 2013 (r85072)
+++ trunk/boost/lexical_cast.hpp 2013-07-18 05:13:41 EDT (Thu, 18 Jul 2013) (r85073)
@@ -69,11 +69,6 @@
     throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
 #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
 {
     // exception used to indicate runtime lexical_cast failure
@@ -316,7 +311,7 @@
> {};
 #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::uint128_type >: public boost::mpl::identity< char > {};
 #endif
@@ -613,7 +608,7 @@
         BOOST_LCAST_DEF(unsigned __int64)
         BOOST_LCAST_DEF( __int64)
 #endif
-#ifdef BOOST_LCAST_HAS_INT128
+#ifdef BOOST_HAS_INT128
         BOOST_LCAST_DEF(boost::int128_type)
         BOOST_LCAST_DEF(boost::uint128_type)
 #endif
@@ -1836,7 +1831,7 @@
             bool operator<<( __int64 n) { return shl_signed(n); }
 #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::int128_type& n) { return shl_signed(n); }
 #endif
@@ -2048,7 +2043,7 @@
             bool operator>>(__int64& output) { return shr_signed(output); }
 #endif
 
-#ifdef BOOST_LCAST_HAS_INT128
+#ifdef BOOST_HAS_INT128
             bool operator>>(boost::uint128_type& output) { return shr_unsigned(output); }
             bool operator>>(boost::int128_type& output) { return shr_signed(output); }
 #endif
@@ -2728,7 +2723,6 @@
 
 #undef BOOST_LCAST_THROW_BAD_CAST
 #undef BOOST_LCAST_NO_WCHAR_T
-#undef BOOST_LCAST_HAS_INT128
 
 #endif // BOOST_LEXICAL_CAST_INCLUDED
 

Modified: trunk/libs/conversion/test/lexical_cast_integral_types_test.cpp
==============================================================================
--- trunk/libs/conversion/test/lexical_cast_integral_types_test.cpp Thu Jul 18 04:45:09 2013 (r85072)
+++ trunk/libs/conversion/test/lexical_cast_integral_types_test.cpp 2013-07-18 05:13:41 EDT (Thu, 18 Jul 2013) (r85073)
@@ -48,10 +48,6 @@
 #define BOOST_LCAST_NO_WCHAR_T
 #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:
 bool const lcast_test_small_integral_types_completely = false;
 
@@ -75,7 +71,7 @@
 void test_conversion_from_to_longlong();
 void test_conversion_from_to_ulonglong();
 #endif
-#ifdef BOOST_LCAST_HAS_INT128
+#ifdef BOOST_HAS_INT128
 void test_conversion_from_to_int128();
 void test_conversion_from_to_uint128();
 #endif
@@ -99,7 +95,7 @@
     suite->add(BOOST_TEST_CASE(&test_conversion_from_to_longlong));
     suite->add(BOOST_TEST_CASE(&test_conversion_from_to_ulonglong));
 #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_uint128));
 #endif
@@ -557,7 +553,7 @@
 #endif
 
 
-#ifdef BOOST_LCAST_HAS_INT128
+#ifdef BOOST_HAS_INT128
 
 template <bool Specialized, class T>
 struct test_if_specialized {
@@ -621,7 +617,7 @@
     test_integral_conversions_on_min_max_impl<__int64>();
 #endif
 
-#ifdef BOOST_LCAST_HAS_INT128
+#ifdef BOOST_HAS_INT128
     test_integral_conversions_on_min_max_impl<boost::int128_type>();
 #endif
 #endif


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk