From 12dd8a872324d30d2e8de5c4a67f08a7169cd5dd Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 26 Apr 2009 21:21:31 +0000 Subject: [PATCH] build windows python bindings with geoip support. fixes some warnings in msvc --- bindings/python/setup.py.in | 4 ++-- include/libtorrent/bitfield.hpp | 4 ++-- include/libtorrent/config.hpp | 2 ++ include/libtorrent/piece_picker.hpp | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/bindings/python/setup.py.in b/bindings/python/setup.py.in index 60e73e54d..b5bd74936 100644 --- a/bindings/python/setup.py.in +++ b/bindings/python/setup.py.in @@ -30,7 +30,7 @@ def arch(): if platform.system() == 'Windows': # on windows, build using bjam and build an installer import shutil - if os.system('bjam boost=source link=static boost-link=static release msvc-7.1 optimization=space') != 0: + if os.system('bjam boost=source link=static geoip=static boost-link=static release msvc-7.1 optimization=space') != 0: print 'build failed' sys.exit(1) try: os.mkdir(r'build') @@ -39,7 +39,7 @@ if platform.system() == 'Windows': except: pass try: os.mkdir(r'libtorrent') except: pass - shutil.copyfile(r'bin\msvc-7.1\release\boost-source\link-static\optimization-space\threading-multi\libtorrent.pyd', r'.\build\lib\libtorrent.pyd') + shutil.copyfile(r'bin\msvc-7.1\release\boost-source\geoip-static\link-static\optimization-space\threading-multi\libtorrent.pyd', r'.\build\lib\libtorrent.pyd') setup( name='python-libtorrent', version='@PACKAGE_VERSION@', author = 'Arvid Norberg', diff --git a/include/libtorrent/bitfield.hpp b/include/libtorrent/bitfield.hpp index 7685b40e2..40bb3d329 100644 --- a/include/libtorrent/bitfield.hpp +++ b/include/libtorrent/bitfield.hpp @@ -70,7 +70,7 @@ namespace libtorrent { TORRENT_ASSERT(index >= 0); TORRENT_ASSERT(index < m_size); - return m_bytes[index / 8] & (0x80 >> (index & 7)); + return (m_bytes[index / 8] & (0x80 >> (index & 7))) != 0; } void clear_bit(int index) @@ -135,7 +135,7 @@ namespace libtorrent typedef bool& reference; typedef std::forward_iterator_tag iterator_category; - bool operator*() { return *byte & bit; } + bool operator*() { return (*byte & bit) != 0; } const_iterator& operator++() { inc(); return *this; } const_iterator operator++(int) { const_iterator ret(*this); inc(); return ret; } diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp index 9bb496635..247cba154 100644 --- a/include/libtorrent/config.hpp +++ b/include/libtorrent/config.hpp @@ -52,6 +52,8 @@ POSSIBILITY OF SUCH DAMAGE. #elif defined(BOOST_MSVC) +#pragma warning(disable: 4258) + # if defined(TORRENT_BUILDING_SHARED) # define TORRENT_EXPORT __declspec(dllexport) # elif defined(TORRENT_LINKING_SHARED) diff --git a/include/libtorrent/piece_picker.hpp b/include/libtorrent/piece_picker.hpp index 1294e1e6a..b216d0c8d 100644 --- a/include/libtorrent/piece_picker.hpp +++ b/include/libtorrent/piece_picker.hpp @@ -58,7 +58,7 @@ namespace libtorrent class torrent; class peer_connection; - class bitfield; + struct bitfield; struct TORRENT_EXPORT piece_block {