Ticket #8941: boost-1.54.0-lexical_cast-int128.patch

File boost-1.54.0-lexical_cast-int128.patch, 2.1 KB (added by Petr Machata <pmachata@…>, 9 years ago)

A fix.

  • boost/lexical_cast.hpp

    diff -up boost/lexical_cast.hpp\~ boost/lexical_cast.hpp
    old new  
    6969    throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
    7070#endif
    7171
    72 #if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
    73 #define BOOST_LCAST_HAS_INT128
    74 #endif
    75 
    76 
    7772namespace boost
    7873{
    7974    // exception used to indicate runtime lexical_cast failure
    namespace boost {  
    316311        > {};
    317312#endif
    318313
    319 #ifdef BOOST_LCAST_HAS_INT128
     314#ifdef BOOST_HAS_INT128
    320315        template <> struct stream_char_common< boost::int128_type >: public boost::mpl::identity< char > {};
    321316        template <> struct stream_char_common< boost::uint128_type >: public boost::mpl::identity< char > {};
    322317#endif
    namespace boost {  
    613608        BOOST_LCAST_DEF(unsigned __int64)
    614609        BOOST_LCAST_DEF(         __int64)
    615610#endif
    616 #ifdef BOOST_LCAST_HAS_INT128
     611#ifdef BOOST_HAS_INT128
    617612        BOOST_LCAST_DEF(boost::int128_type)
    618613        BOOST_LCAST_DEF(boost::uint128_type)
    619614#endif
    namespace boost {  
    18271822            bool operator<<(         __int64 n)         { return shl_signed(n); }
    18281823#endif
    18291824
    1830 #ifdef BOOST_LCAST_HAS_INT128
     1825#ifdef BOOST_HAS_INT128
    18311826        bool operator<<(const boost::uint128_type& n)   { start = lcast_put_unsigned<Traits>(n, finish); return true; }
    18321827        bool operator<<(const boost::int128_type& n)    { return shl_signed(n); }
    18331828#endif
    namespace boost {  
    20392034            bool operator>>(__int64& output)                    { return shr_signed(output); }
    20402035#endif
    20412036
    2042 #ifdef BOOST_LCAST_HAS_INT128
     2037#ifdef BOOST_HAS_INT128
    20432038            bool operator>>(boost::uint128_type& output)        { return shr_unsigned(output); }
    20442039            bool operator>>(boost::int128_type& output)         { return shr_signed(output); }
    20452040#endif
    namespace boost {  
    27192714
    27202715#undef BOOST_LCAST_THROW_BAD_CAST
    27212716#undef BOOST_LCAST_NO_WCHAR_T
    2722 #undef BOOST_LCAST_HAS_INT128
    27232717
    27242718#endif // BOOST_LEXICAL_CAST_INCLUDED
    27252719