Ticket #5771: warning in basic_binary_iprimitive.hpp.patch

File warning in basic_binary_iprimitive.hpp.patch, 1.4 KB (added by Anton Matosov <anton.matosov@…>, 11 years ago)
  • basic_binary_iprimitive.hpp

     
    143143    void
    144144    load_binary(void *address, std::size_t count);
    145145};
     146#if defined(_MSC_VER) && (_MSC_VER >= 1400) //VC 8.0 +
     147#   define BOOST_sgetn_safe( buf, count ) _Sgetn_s( buf, count, count )
     148#else
     149#   define BOOST_sgetn_safe( buf, count ) sgetn( buf, count )
     150#endif
    146151
    147152template<class Archive, class Elem, class Tr>
    148153inline void
     
    157162    );
    158163    std::streamsize s = static_cast<std::streamsize>(count / sizeof(Elem));
    159164    std::streamsize scount = m_sb.sgetn(
     165    std::streamsize scount = m_sb.BOOST_sgetn_safe(
    160166        static_cast<Elem *>(address),
    161167        s
    162168    );
     
    173179//                archive_exception(archive_exception::stream_error)
    174180//        );
    175181        Elem t;
    176         scount = m_sb.sgetn(& t, 1);
     182        scount = m_sb.BOOST_sgetn_safe(& t, 1);
    177183        if(scount != 1)
    178184            boost::serialization::throw_exception(
    179185                archive_exception(archive_exception::input_stream_error)
     
    181187        std::memcpy(static_cast<char*>(address) + (count - s), &t, s);
    182188    }
    183189}
     190#undef BOOST_sgetn_safe
    184191
    185192} // namespace archive
    186193} // namespace boost