forked from premiere/premiere-libtorrent
fix GCC-4.9 build
This commit is contained in:
parent
2e5e7bb8dd
commit
8af89da689
6
Jamfile
6
Jamfile
|
@ -548,6 +548,7 @@ lib crypto
|
|||
<openssl-version>pre1.1
|
||||
<name>libeay32
|
||||
<conditional>@openssl-lib-path
|
||||
<link>shared
|
||||
: # default-build
|
||||
: # usage-requirements
|
||||
<conditional>@openssl-include-path
|
||||
|
@ -565,6 +566,7 @@ lib ssl
|
|||
<name>ssleay32
|
||||
<use>crypto
|
||||
<conditional>@openssl-lib-path
|
||||
<link>shared
|
||||
: # default-build
|
||||
: # usage-requirments
|
||||
<conditional>@openssl-include-path
|
||||
|
@ -575,8 +577,8 @@ lib ssl
|
|||
;
|
||||
|
||||
|
||||
lib crypto : : <name>crypto <use>z <conditional>@openssl-lib-path : : <conditional>@openssl-include-path ;
|
||||
lib ssl : : <name>ssl <use>crypto <conditional>@openssl-lib-path : : <conditional>@openssl-include-path ;
|
||||
lib crypto : : <name>crypto <use>z <conditional>@openssl-lib-path <link>shared : : <conditional>@openssl-include-path ;
|
||||
lib ssl : : <name>ssl <use>crypto <conditional>@openssl-lib-path <link>shared : : <conditional>@openssl-include-path ;
|
||||
|
||||
lib dbghelp : : <name>dbghelp ;
|
||||
|
||||
|
|
|
@ -45,6 +45,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/assert.hpp"
|
||||
#include "libtorrent/span.hpp"
|
||||
#include "libtorrent/string_view.hpp"
|
||||
#include "libtorrent/aux_/noexcept_movable.hpp"
|
||||
|
||||
/*
|
||||
|
||||
|
@ -283,10 +284,10 @@ struct TORRENT_EXPORT bdecode_node
|
|||
};
|
||||
|
||||
// the type of this node. See type_t.
|
||||
type_t type() const;
|
||||
type_t type() const noexcept;
|
||||
|
||||
// returns true if type() != none_t.
|
||||
explicit operator bool() const;
|
||||
explicit operator bool() const noexcept;
|
||||
|
||||
// return a non-owning reference to this node. This is useful to refer to
|
||||
// the root node without copying it in assignments.
|
||||
|
@ -296,7 +297,7 @@ struct TORRENT_EXPORT bdecode_node
|
|||
// buffer where this node is defined. For a dictionary for instance, this
|
||||
// starts with ``d`` and ends with ``e``, and has all the content of the
|
||||
// dictionary in between.
|
||||
span<char const> data_section() const;
|
||||
span<char const> data_section() const noexcept;
|
||||
|
||||
// functions with the ``list_`` prefix operate on lists. These functions are
|
||||
// only valid if ``type()`` == ``list_t``. ``list_at()`` returns the item
|
||||
|
@ -359,7 +360,7 @@ struct TORRENT_EXPORT bdecode_node
|
|||
// this buffer *MUST* be identical to the one originally parsed. This
|
||||
// operation is only defined on owning root nodes, i.e. the one passed in to
|
||||
// decode().
|
||||
void switch_underlying_buffer(char const* buf);
|
||||
void switch_underlying_buffer(char const* buf) noexcept;
|
||||
|
||||
// returns true if there is a non-fatal error in the bencoding of this node
|
||||
// or its children
|
||||
|
@ -372,7 +373,7 @@ private:
|
|||
// if this is the root node, that owns all the tokens, they live in this
|
||||
// vector. If this is a sub-node, this field is not used, instead the
|
||||
// m_root_tokens pointer points to the root node's token.
|
||||
std::vector<detail::bdecode_token> m_tokens;
|
||||
aux::noexcept_movable<std::vector<detail::bdecode_token>> m_tokens;
|
||||
|
||||
// this points to the root nodes token vector
|
||||
// for the root node, this points to its own m_tokens member
|
||||
|
|
|
@ -282,7 +282,7 @@ namespace {
|
|||
m_last_token = -1;
|
||||
}
|
||||
|
||||
void bdecode_node::switch_underlying_buffer(char const* buf)
|
||||
void bdecode_node::switch_underlying_buffer(char const* buf) noexcept
|
||||
{
|
||||
TORRENT_ASSERT(!m_tokens.empty());
|
||||
if (m_tokens.empty()) return;
|
||||
|
@ -379,16 +379,16 @@ namespace {
|
|||
return false;
|
||||
}
|
||||
|
||||
bdecode_node::type_t bdecode_node::type() const
|
||||
bdecode_node::type_t bdecode_node::type() const noexcept
|
||||
{
|
||||
if (m_token_idx == -1) return none_t;
|
||||
return static_cast<bdecode_node::type_t>(m_root_tokens[m_token_idx].type);
|
||||
}
|
||||
|
||||
bdecode_node::operator bool() const
|
||||
bdecode_node::operator bool() const noexcept
|
||||
{ return m_token_idx != -1; }
|
||||
|
||||
span<char const> bdecode_node::data_section() const
|
||||
span<char const> bdecode_node::data_section() const noexcept
|
||||
{
|
||||
if (m_token_idx == -1) return {};
|
||||
|
||||
|
|
Loading…
Reference in New Issue