remove resolve countries build configuration from the public API (make linking easier)

This commit is contained in:
Arvid Norberg 2013-04-09 00:37:53 +00:00
parent 3142317b85
commit 4395437c3b
6 changed files with 9 additions and 18 deletions

View File

@ -81,12 +81,6 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_CFG_UNICODE ansi_
#endif
#ifdef TORRENT_DISABLE_RESOLVE_COUNTRIES
#define TORRENT_CFG_RESOLVE noresolvecountries_
#else
#define TORRENT_CFG_RESOLVE resolvecountries_
#endif
#ifdef TORRENT_NO_DEPRECATE
#define TORRENT_CFG_DEPR nodeprecate_
#else
@ -110,10 +104,9 @@ POSSIBILITY OF SUCH DAMAGE.
BOOST_PP_CAT(TORRENT_CFG_TIME, \
BOOST_PP_CAT(TORRENT_CFG_POOL, \
BOOST_PP_CAT(TORRENT_CFG_LOG, \
BOOST_PP_CAT(TORRENT_CFG_RESOLVE, \
BOOST_PP_CAT(TORRENT_CFG_DEPR, \
BOOST_PP_CAT(TORRENT_CFG_DHT, \
TORRENT_CFG_EXT)))))))
TORRENT_CFG_EXT))))))
#define TORRENT_CFG_STRING BOOST_PP_STRINGIZE(TORRENT_CFG)

View File

@ -133,13 +133,11 @@ namespace libtorrent
// the number of failed hashes for this peer
int num_hashfails;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
// in case the session settings is set
// to resolve countries, this is set to
// the two character country code this
// peer resides in.
char country[2];
#endif
#ifndef TORRENT_DISABLE_GEO_IP
// atonomous system this peer belongs to

View File

@ -1202,7 +1202,6 @@ namespace libtorrent
// paused or auto_managed from the resume data
bool m_override_resume_data:1;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
// this is true while there is a country
// resolution in progress. To avoid flodding
// the DNS request queue, only one ip is resolved
@ -1212,9 +1211,6 @@ namespace libtorrent
// this is true if the user has enabled
// country resolution in this torrent
bool m_resolve_countries:1;
#else
unsigned int m_dummy_padding_bits_to_align:2;
#endif
// set to false when saving resume data. Set to true
// whenever something is downloaded

View File

@ -255,10 +255,8 @@ namespace libtorrent
void queue_position_top() const;
void queue_position_bottom() const;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
void resolve_countries(bool r);
bool resolve_countries() const;
#endif
void set_ssl_certificate(std::string const& certificate
, std::string const& private_key

View File

@ -3705,6 +3705,8 @@ namespace libtorrent
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
p.country[0] = m_country[0];
p.country[1] = m_country[1];
#else
std::fill(p.country, p.country + 2, 0);
#endif
p.total_download = statistics().total_payload_download();

View File

@ -931,20 +931,24 @@ namespace libtorrent
TORRENT_ASYNC_CALL1(super_seeding, on);
}
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
void torrent_handle::resolve_countries(bool r)
{
INVARIANT_CHECK;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
TORRENT_ASYNC_CALL1(resolve_countries, r);
#endif
}
bool torrent_handle::resolve_countries() const
{
INVARIANT_CHECK;
#ifndef TORRENT_DISABLE_RESOLVE_COUNTRIES
TORRENT_SYNC_CALL_RET(bool, false, resolving_countries);
return r;
}
#else
return false;
#endif
}
void torrent_handle::get_full_peer_list(std::vector<peer_list_entry>& v) const
{