snowyu / libtorrent

Automatically exported from code.google.com/p/libtorrent
Other
1 stars 0 forks source link

utp_stream.cpp doesn't compile #637

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Compiling utp_stream.cpp fails with error

src\utp_stream.cpp(1639) : error C2780: 'const _Ty &std::max(const _Ty &,const _
Ty &,_Pr)' : expects 3 arguments - 2 provided
        c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility(
2086) : see declaration of 'std::max'
src\utp_stream.cpp(1639) : error C2782: 'const _Ty &std::max(const _Ty &,const _
Ty &)' : template parameter '_Ty' is ambiguous
        c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xutility(
2078) : see declaration of 'std::max'
        could be 'int'
        or       'boost::int32_t'

Line 1639 in the file:
    h->wnd_size = (std::max)(m_in_buf_size - m_buffered_incoming_bytes
        - m_receive_buffer_size, 0);
I fixed it:
    h->wnd_size = (std::max)(m_in_buf_size - m_buffered_incoming_bytes
        - m_receive_buffer_size, boost::int32_t(0));

Now it compiles!

My system is windows 8 64-bit with visual studio 10.0

Original issue reported on code.google.com by anton...@gmail.com on 19 Jun 2014 at 3:08

GoogleCodeExporter commented 9 years ago
thanks. fixed!

Original comment by arvid.no...@gmail.com on 19 Jun 2014 at 3:34