forked from premiere/premiere-libtorrent
fixed more link issues on windows. examples build with shared linking on windows
This commit is contained in:
parent
1e654220fa
commit
bd881ac154
4
Jamfile
4
Jamfile
|
@ -447,6 +447,10 @@ local usage-requirements =
|
||||||
<toolset>msvc,<variant>release:<linkflags>/OPT:REF
|
<toolset>msvc,<variant>release:<linkflags>/OPT:REF
|
||||||
# disable warning C4503: decorated name length exceeded, name was truncated
|
# disable warning C4503: decorated name length exceeded, name was truncated
|
||||||
<toolset>msvc:<cxxflags>/wd4503
|
<toolset>msvc:<cxxflags>/wd4503
|
||||||
|
# disable warning C4275: non-dll interface class 'x' used as base for dll-interface struct 'y'
|
||||||
|
<toolset>msvc:<cxxflags>/wd4275
|
||||||
|
# disable warning C4251: 'x' needs to have dll-interface to be used by clients of class 'y'
|
||||||
|
<toolset>msvc:<cxxflags>/wd4251
|
||||||
# disable some warnings for gcc
|
# disable some warnings for gcc
|
||||||
<toolset>gcc:<cflags>-fno-strict-aliasing
|
<toolset>gcc:<cflags>-fno-strict-aliasing
|
||||||
<toolset>gcc:<cflags>-Wno-missing-braces
|
<toolset>gcc:<cflags>-Wno-missing-braces
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace libtorrent
|
||||||
// determines if the operating system supports IPv6
|
// determines if the operating system supports IPv6
|
||||||
TORRENT_EXPORT bool supports_ipv6();
|
TORRENT_EXPORT bool supports_ipv6();
|
||||||
|
|
||||||
int common_bits(unsigned char const* b1
|
TORRENT_EXPORT int common_bits(unsigned char const* b1
|
||||||
, unsigned char const* b2, int n);
|
, unsigned char const* b2, int n);
|
||||||
|
|
||||||
TORRENT_EXPORT address guess_local_address(io_service&);
|
TORRENT_EXPORT address guess_local_address(io_service&);
|
||||||
|
|
|
@ -181,7 +181,7 @@ namespace libtorrent
|
||||||
mutable int total_used_buffers;
|
mutable int total_used_buffers;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct disk_buffer_pool : boost::noncopyable
|
struct TORRENT_EXPORT disk_buffer_pool : boost::noncopyable
|
||||||
{
|
{
|
||||||
disk_buffer_pool(int block_size);
|
disk_buffer_pool(int block_size);
|
||||||
#ifdef TORRENT_DEBUG
|
#ifdef TORRENT_DEBUG
|
||||||
|
@ -255,7 +255,7 @@ namespace libtorrent
|
||||||
|
|
||||||
// this is a singleton consisting of the thread and a queue
|
// this is a singleton consisting of the thread and a queue
|
||||||
// of disk io jobs
|
// of disk io jobs
|
||||||
struct disk_io_thread : disk_buffer_pool
|
struct TORRENT_EXPORT disk_io_thread : disk_buffer_pool
|
||||||
{
|
{
|
||||||
disk_io_thread(io_service& ios
|
disk_io_thread(io_service& ios
|
||||||
, boost::function<void()> const& queue_callback
|
, boost::function<void()> const& queue_callback
|
||||||
|
|
|
@ -42,27 +42,27 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
boost::array<char, 3 + std::numeric_limits<size_type>::digits10> TORRENT_EXPORT to_string(size_type n);
|
TORRENT_EXPORT boost::array<char, 3 + std::numeric_limits<size_type>::digits10> to_string(size_type n);
|
||||||
bool TORRENT_EXPORT is_alpha(char c);
|
TORRENT_EXPORT bool is_alpha(char c);
|
||||||
bool TORRENT_EXPORT is_digit(char c);
|
TORRENT_EXPORT bool is_digit(char c);
|
||||||
bool TORRENT_EXPORT is_print(char c);
|
TORRENT_EXPORT bool is_print(char c);
|
||||||
bool TORRENT_EXPORT is_space(char c);
|
TORRENT_EXPORT bool is_space(char c);
|
||||||
char TORRENT_EXPORT to_lower(char c);
|
TORRENT_EXPORT char to_lower(char c);
|
||||||
|
|
||||||
int TORRENT_EXPORT split_string(char const** tags, int buf_size, char* in);
|
TORRENT_EXPORT int split_string(char const** tags, int buf_size, char* in);
|
||||||
bool TORRENT_EXPORT string_begins_no_case(char const* s1, char const* s2);
|
TORRENT_EXPORT bool string_begins_no_case(char const* s1, char const* s2);
|
||||||
bool TORRENT_EXPORT string_equal_no_case(char const* s1, char const* s2);
|
TORRENT_EXPORT bool string_equal_no_case(char const* s1, char const* s2);
|
||||||
|
|
||||||
std::string TORRENT_EXPORT unescape_string(std::string const& s, error_code& ec);
|
TORRENT_EXPORT std::string unescape_string(std::string const& s, error_code& ec);
|
||||||
// replaces all disallowed URL characters by their %-encoding
|
// replaces all disallowed URL characters by their %-encoding
|
||||||
std::string TORRENT_EXPORT escape_string(const char* str, int len);
|
TORRENT_EXPORT std::string escape_string(const char* str, int len);
|
||||||
// same as escape_string but does not encode '/'
|
// same as escape_string but does not encode '/'
|
||||||
std::string TORRENT_EXPORT escape_path(const char* str, int len);
|
TORRENT_EXPORT std::string escape_path(const char* str, int len);
|
||||||
// if the url does not appear to be encoded, and it contains illegal url characters
|
// if the url does not appear to be encoded, and it contains illegal url characters
|
||||||
// it will be encoded
|
// it will be encoded
|
||||||
std::string TORRENT_EXPORT maybe_url_encode(std::string const& url);
|
TORRENT_EXPORT std::string maybe_url_encode(std::string const& url);
|
||||||
|
|
||||||
bool TORRENT_EXPORT need_encoding(char const* str, int len);
|
TORRENT_EXPORT bool need_encoding(char const* str, int len);
|
||||||
|
|
||||||
// encodes a string using the base64 scheme
|
// encodes a string using the base64 scheme
|
||||||
TORRENT_EXPORT std::string base64encode(std::string const& s);
|
TORRENT_EXPORT std::string base64encode(std::string const& s);
|
||||||
|
|
|
@ -74,7 +74,7 @@ typedef boost::function<void(http_connection&, std::list<tcp::endpoint>&)> http_
|
||||||
|
|
||||||
// when bottled, the last two arguments to the handler
|
// when bottled, the last two arguments to the handler
|
||||||
// will always be 0
|
// will always be 0
|
||||||
struct http_connection : boost::enable_shared_from_this<http_connection>, boost::noncopyable
|
struct TORRENT_EXPORT http_connection : boost::enable_shared_from_this<http_connection>, boost::noncopyable
|
||||||
{
|
{
|
||||||
http_connection(io_service& ios, connection_queue& cc
|
http_connection(io_service& ios, connection_queue& cc
|
||||||
, http_handler const& handler, bool bottled = true
|
, http_handler const& handler, bool bottled = true
|
||||||
|
|
|
@ -55,7 +55,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
|
|
||||||
class http_parser
|
class TORRENT_EXPORT http_parser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
http_parser();
|
http_parser();
|
||||||
|
|
|
@ -37,6 +37,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
#include <libtorrent/config.hpp>
|
||||||
#include <libtorrent/kademlia/routing_table.hpp>
|
#include <libtorrent/kademlia/routing_table.hpp>
|
||||||
#include <libtorrent/kademlia/rpc_manager.hpp>
|
#include <libtorrent/kademlia/rpc_manager.hpp>
|
||||||
#include <libtorrent/kademlia/node_id.hpp>
|
#include <libtorrent/kademlia/node_id.hpp>
|
||||||
|
@ -67,7 +68,7 @@ namespace libtorrent { namespace dht
|
||||||
TORRENT_DECLARE_LOG(node);
|
TORRENT_DECLARE_LOG(node);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class traversal_algorithm;
|
struct traversal_algorithm;
|
||||||
|
|
||||||
struct key_desc_t
|
struct key_desc_t
|
||||||
{
|
{
|
||||||
|
@ -99,7 +100,7 @@ struct torrent_entry
|
||||||
|
|
||||||
// this is the entry for a torrent that has been published
|
// this is the entry for a torrent that has been published
|
||||||
// in the DHT.
|
// in the DHT.
|
||||||
struct search_torrent_entry
|
struct TORRENT_EXPORT search_torrent_entry
|
||||||
{
|
{
|
||||||
search_torrent_entry(): total_tag_points(0), total_name_points(0) {}
|
search_torrent_entry(): total_tag_points(0), total_name_points(0) {}
|
||||||
|
|
||||||
|
|
|
@ -35,6 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include <boost/cstdint.hpp>
|
#include <boost/cstdint.hpp>
|
||||||
|
#include "libtorrent/config.hpp"
|
||||||
#include "libtorrent/peer_id.hpp"
|
#include "libtorrent/peer_id.hpp"
|
||||||
#include "libtorrent/assert.hpp"
|
#include "libtorrent/assert.hpp"
|
||||||
|
|
||||||
|
@ -45,16 +46,16 @@ typedef libtorrent::big_number node_id;
|
||||||
|
|
||||||
// returns the distance between the two nodes
|
// returns the distance between the two nodes
|
||||||
// using the kademlia XOR-metric
|
// using the kademlia XOR-metric
|
||||||
node_id distance(node_id const& n1, node_id const& n2);
|
node_id TORRENT_EXPORT distance(node_id const& n1, node_id const& n2);
|
||||||
|
|
||||||
// returns true if: distance(n1, ref) < distance(n2, ref)
|
// returns true if: distance(n1, ref) < distance(n2, ref)
|
||||||
bool compare_ref(node_id const& n1, node_id const& n2, node_id const& ref);
|
bool TORRENT_EXPORT compare_ref(node_id const& n1, node_id const& n2, node_id const& ref);
|
||||||
|
|
||||||
// returns n in: 2^n <= distance(n1, n2) < 2^(n+1)
|
// returns n in: 2^n <= distance(n1, n2) < 2^(n+1)
|
||||||
// usefult for finding out which bucket a node belongs to
|
// usefult for finding out which bucket a node belongs to
|
||||||
int distance_exp(node_id const& n1, node_id const& n2);
|
int TORRENT_EXPORT distance_exp(node_id const& n1, node_id const& n2);
|
||||||
|
|
||||||
node_id generate_id();
|
node_id TORRENT_EXPORT generate_id();
|
||||||
|
|
||||||
} } // namespace libtorrent::dht
|
} } // namespace libtorrent::dht
|
||||||
|
|
||||||
|
|
|
@ -156,7 +156,7 @@ namespace aux
|
||||||
|
|
||||||
} // namespace aux
|
} // namespace aux
|
||||||
|
|
||||||
class routing_table
|
class TORRENT_EXPORT routing_table
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
typedef aux::routing_table_iterator iterator;
|
typedef aux::routing_table_iterator iterator;
|
||||||
|
|
|
@ -35,6 +35,8 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
#ifndef TORRENT_PE_CRYPTO_HPP_INCLUDED
|
#ifndef TORRENT_PE_CRYPTO_HPP_INCLUDED
|
||||||
#define TORRENT_PE_CRYPTO_HPP_INCLUDED
|
#define TORRENT_PE_CRYPTO_HPP_INCLUDED
|
||||||
|
|
||||||
|
#include "libtorrent/config.hpp"
|
||||||
|
|
||||||
#ifdef TORRENT_USE_GCRYPT
|
#ifdef TORRENT_USE_GCRYPT
|
||||||
#include <gcrypt.h>
|
#include <gcrypt.h>
|
||||||
#elif defined TORRENT_USE_OPENSSL
|
#elif defined TORRENT_USE_OPENSSL
|
||||||
|
@ -46,8 +48,8 @@ struct rc4 {
|
||||||
unsigned char buf[256];
|
unsigned char buf[256];
|
||||||
};
|
};
|
||||||
|
|
||||||
void rc4_init(const unsigned char* in, unsigned long len, rc4 *state);
|
void TORRENT_EXPORT rc4_init(const unsigned char* in, unsigned long len, rc4 *state);
|
||||||
unsigned long rc4_encrypt(unsigned char *out, unsigned long outlen, rc4 *state);
|
unsigned long TORRENT_EXPORT rc4_encrypt(unsigned char *out, unsigned long outlen, rc4 *state);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "libtorrent/peer_id.hpp" // For sha1_hash
|
#include "libtorrent/peer_id.hpp" // For sha1_hash
|
||||||
|
@ -55,7 +57,7 @@ unsigned long rc4_encrypt(unsigned char *out, unsigned long outlen, rc4 *state);
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
class dh_key_exchange
|
class TORRENT_EXPORT dh_key_exchange
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
dh_key_exchange();
|
dh_key_exchange();
|
||||||
|
|
|
@ -122,14 +122,14 @@ namespace libtorrent
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
ptime TORRENT_EXPORT time_now_hires();
|
TORRENT_EXPORT ptime time_now_hires();
|
||||||
ptime TORRENT_EXPORT min_time();
|
TORRENT_EXPORT ptime min_time();
|
||||||
ptime TORRENT_EXPORT max_time();
|
TORRENT_EXPORT ptime max_time();
|
||||||
|
|
||||||
char const* time_now_string();
|
TORRENT_EXPORT char const* time_now_string();
|
||||||
std::string TORRENT_EXPORT log_time();
|
TORRENT_EXPORT std::string log_time();
|
||||||
|
|
||||||
ptime const& TORRENT_EXPORT time_now();
|
TORRENT_EXPORT ptime const& time_now();
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -121,7 +121,7 @@ namespace libtorrent
|
||||||
{ enum { value = 4 }; };
|
{ enum { value = 4 }; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct socket_type
|
struct TORRENT_EXPORT socket_type
|
||||||
{
|
{
|
||||||
typedef stream_socket::lowest_layer_type lowest_layer_type;
|
typedef stream_socket::lowest_layer_type lowest_layer_type;
|
||||||
typedef stream_socket::endpoint_type endpoint_type;
|
typedef stream_socket::endpoint_type endpoint_type;
|
||||||
|
|
|
@ -41,31 +41,31 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
char const* time_now_string();
|
TORRENT_EXPORT char const* time_now_string();
|
||||||
std::string TORRENT_EXPORT log_time();
|
TORRENT_EXPORT std::string log_time();
|
||||||
|
|
||||||
ptime TORRENT_EXPORT time_now_hires();
|
TORRENT_EXPORT ptime time_now_hires();
|
||||||
ptime TORRENT_EXPORT min_time();
|
TORRENT_EXPORT ptime min_time();
|
||||||
ptime TORRENT_EXPORT max_time();
|
TORRENT_EXPORT ptime max_time();
|
||||||
|
|
||||||
#if defined TORRENT_USE_BOOST_DATE_TIME
|
#if defined TORRENT_USE_BOOST_DATE_TIME
|
||||||
|
|
||||||
time_duration TORRENT_EXPORT seconds(int s);
|
TORRENT_EXPORT time_duration seconds(int s);
|
||||||
time_duration TORRENT_EXPORT milliseconds(int s);
|
TORRENT_EXPORT time_duration milliseconds(int s);
|
||||||
time_duration TORRENT_EXPORT microsec(int s);
|
TORRENT_EXPORT time_duration microsec(int s);
|
||||||
time_duration TORRENT_EXPORT minutes(int s);
|
TORRENT_EXPORT time_duration minutes(int s);
|
||||||
time_duration TORRENT_EXPORT hours(int s);
|
TORRENT_EXPORT time_duration hours(int s);
|
||||||
|
|
||||||
int TORRENT_EXPORT total_seconds(time_duration td);
|
TORRENT_EXPORT int total_seconds(time_duration td);
|
||||||
int TORRENT_EXPORT total_milliseconds(time_duration td);
|
TORRENT_EXPORT int total_milliseconds(time_duration td);
|
||||||
boost::int64_t TORRENT_EXPORT total_microseconds(time_duration td);
|
TORRENT_EXPORT boost::int64_t total_microseconds(time_duration td);
|
||||||
|
|
||||||
#elif defined TORRENT_USE_QUERY_PERFORMANCE_TIMER
|
#elif defined TORRENT_USE_QUERY_PERFORMANCE_TIMER
|
||||||
|
|
||||||
namespace aux
|
namespace aux
|
||||||
{
|
{
|
||||||
boost::int64_t TORRENT_EXPORT performance_counter_to_microseconds(boost::int64_t pc);
|
TORRENT_EXPORT boost::int64_t performance_counter_to_microseconds(boost::int64_t pc);
|
||||||
boost::int64_t TORRENT_EXPORT microseconds_to_performance_counter(boost::int64_t ms);
|
TORRENT_EXPORT boost::int64_t microseconds_to_performance_counter(boost::int64_t ms);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int total_seconds(time_duration td)
|
inline int total_seconds(time_duration td)
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace libtorrent
|
||||||
// fixes invalid UTF-8 sequences and
|
// fixes invalid UTF-8 sequences and
|
||||||
// replaces characters that are invalid
|
// replaces characters that are invalid
|
||||||
// in paths
|
// in paths
|
||||||
bool verify_encoding(std::string& target, bool fix_paths = false)
|
TORRENT_EXPORT bool verify_encoding(std::string& target, bool fix_paths = false)
|
||||||
{
|
{
|
||||||
std::string tmp_path;
|
std::string tmp_path;
|
||||||
bool valid_encoding = true;
|
bool valid_encoding = true;
|
||||||
|
@ -223,7 +223,7 @@ namespace libtorrent
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string sanitize_path(std::string const& p)
|
TORRENT_EXPORT std::string sanitize_path(std::string const& p)
|
||||||
{
|
{
|
||||||
std::string new_path;
|
std::string new_path;
|
||||||
std::string split = split_path(p);
|
std::string split = split_path(p);
|
||||||
|
|
|
@ -787,7 +787,7 @@ struct parse_state
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
void find_control_url(int type, char const* string, parse_state& state)
|
TORRENT_EXPORT void find_control_url(int type, char const* string, parse_state& state)
|
||||||
{
|
{
|
||||||
if (type == xml_start_tag)
|
if (type == xml_start_tag)
|
||||||
{
|
{
|
||||||
|
|
|
@ -58,7 +58,7 @@ using namespace boost::tuples;
|
||||||
using boost::bind;
|
using boost::bind;
|
||||||
|
|
||||||
namespace libtorrent {
|
namespace libtorrent {
|
||||||
std::string sanitize_path(std::string const& p);
|
TORRENT_EXPORT std::string sanitize_path(std::string const& p);
|
||||||
}
|
}
|
||||||
|
|
||||||
sha1_hash to_hash(char const* s)
|
sha1_hash to_hash(char const* s)
|
||||||
|
@ -358,10 +358,10 @@ struct parse_state
|
||||||
namespace libtorrent
|
namespace libtorrent
|
||||||
{
|
{
|
||||||
// defined in torrent_info.cpp
|
// defined in torrent_info.cpp
|
||||||
bool verify_encoding(std::string& target, bool path = true);
|
TORRENT_EXPORT bool verify_encoding(std::string& target, bool path = true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void find_control_url(int type, char const* string, parse_state& state);
|
TORRENT_EXPORT void find_control_url(int type, char const* string, parse_state& state);
|
||||||
|
|
||||||
int test_main()
|
int test_main()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue