fix dynamic linking of test library on windows

This commit is contained in:
Arvid Norberg 2013-06-23 17:36:00 +00:00
parent d77e3cb59f
commit aa58f26985
5 changed files with 43 additions and 24 deletions

View File

@ -12,8 +12,15 @@ lib libtorrent_test
setup_transfer.cpp
dht_server.cpp
peer_server.cpp
: # requirements
<library>/torrent//torrent/<link>shared/<boost-link>shared/<export-extra>on
# this is used to determine whether
# symbols are exported or imported
<link>shared:<define>TORRENT_BUILDING_TEST_SHARED
: # default build
<link>shared
;
project

View File

@ -35,11 +35,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h> // for exit()
#include "setup_transfer.hpp" // for tests_failure
int test_main();
extern bool tests_failure;
#include "libtorrent/assert.hpp"
#include "libtorrent/file.hpp"
#include <signal.h>

View File

@ -33,6 +33,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <fstream>
#include <deque>
#include "setup_transfer.hpp"
#include "libtorrent/session.hpp"
#include "libtorrent/hasher.hpp"
#include "libtorrent/http_parser.hpp"
@ -533,7 +535,7 @@ int start_tracker()
}
boost::detail::atomic_count g_udp_tracker_requests(0);
boost::detail::atomic_count g_http_tracker_requests(0);
boost::detail::atomic_count g_http_tracker_requests(0);
void on_udp_receive(error_code const& ec, size_t bytes_transferred, udp::endpoint const* from, char* buffer, udp::socket* sock)
{

View File

@ -35,6 +35,13 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/session.hpp"
#include <boost/tuple/tuple.hpp>
#include "libtorrent/config.hpp"
#ifdef TORRENT_BUILDING_TEST_SHARED
#define EXPORT BOOST_SYMBOL_EXPORT
#else
#define EXPORT BOOST_SYMBOL_IMPORT
#endif
namespace libtorrent
{
@ -43,47 +50,51 @@ namespace libtorrent
struct session_status;
}
std::auto_ptr<libtorrent::alert> TORRENT_EXPORT wait_for_alert(libtorrent::session& ses, int type);
extern EXPORT bool tests_failure;
void TORRENT_EXPORT print_ses_rate(float time
void EXPORT report_failure(char const* err, char const* file, int line);
std::auto_ptr<libtorrent::alert> EXPORT wait_for_alert(libtorrent::session& ses, int type);
void EXPORT print_ses_rate(float time
, libtorrent::torrent_status const* st1
, libtorrent::torrent_status const* st2
, libtorrent::torrent_status const* st3 = NULL);
bool TORRENT_EXPORT print_alerts(libtorrent::session& ses, char const* name
bool EXPORT print_alerts(libtorrent::session& ses, char const* name
, bool allow_disconnects = false
, bool allow_no_torrents = false
, bool allow_failed_fastresume = false
, bool (*)(libtorrent::alert*) = 0
, bool no_output = false);
void TORRENT_EXPORT wait_for_listen(libtorrent::session& ses, char const* name);
void TORRENT_EXPORT test_sleep(int millisec);
void EXPORT wait_for_listen(libtorrent::session& ses, char const* name);
void EXPORT test_sleep(int millisec);
extern boost::detail::atomic_count g_udp_tracker_requests;
extern boost::detail::atomic_count g_http_tracker_requests;
extern EXPORT boost::detail::atomic_count g_udp_tracker_requests;
extern EXPORT boost::detail::atomic_count g_http_tracker_requests;
void TORRENT_EXPORT create_random_files(std::string const& path, const int file_sizes[], int num_files);
void EXPORT create_random_files(std::string const& path, const int file_sizes[], int num_files);
boost::intrusive_ptr<libtorrent::torrent_info> TORRENT_EXPORT create_torrent(std::ostream* file = 0
boost::intrusive_ptr<libtorrent::torrent_info> EXPORT create_torrent(std::ostream* file = 0
, int piece_size = 16 * 1024, int num_pieces = 13, bool add_tracker = true, bool encrypted = false);
boost::tuple<libtorrent::torrent_handle
, libtorrent::torrent_handle
, libtorrent::torrent_handle>
TORRENT_EXPORT setup_transfer(libtorrent::session* ses1, libtorrent::session* ses2
EXPORT setup_transfer(libtorrent::session* ses1, libtorrent::session* ses2
, libtorrent::session* ses3, bool clear_files, bool use_metadata_transfer = true
, bool connect = true, std::string suffix = "", int piece_size = 16 * 1024
, boost::intrusive_ptr<libtorrent::torrent_info>* torrent = 0, bool super_seeding = false
, libtorrent::add_torrent_params const* p = 0, bool stop_lsd = true, bool encrypted_torrent = false);
int TORRENT_EXPORT start_web_server(bool ssl = false, bool chunked = false);
void TORRENT_EXPORT stop_web_server();
int TORRENT_EXPORT start_proxy(int type);
void TORRENT_EXPORT stop_proxy(int port);
int EXPORT start_web_server(bool ssl = false, bool chunked = false);
void EXPORT stop_web_server();
int EXPORT start_proxy(int type);
void EXPORT stop_proxy(int port);
void TORRENT_EXPORT stop_tracker();
int TORRENT_EXPORT start_tracker();
void EXPORT stop_tracker();
int EXPORT start_tracker();
#endif

View File

@ -71,11 +71,11 @@ namespace libtorrent {
TORRENT_EXPORT std::string sanitize_path(std::string const& p);
#ifndef TORRENT_DISABLE_DHT
namespace dht
{
TORRENT_EXPORT libtorrent::dht::node_id generate_id_impl(
address const& ip_, boost::uint32_t r);
}
// namespace dht
// {
// TORRENT_EXPORT libtorrent::dht::node_id generate_id_impl(
// address const& ip_, boost::uint32_t r);
// }
#endif
}