From cafbf2ca1d3b12a6e6b2e805af1d109a4c2ab53d Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 20 Mar 2012 03:53:07 +0000 Subject: [PATCH] more work on minimizing shared object export symbol table --- CMakeLists.txt | 1 + Jamfile | 1 + examples/make_torrent.cpp | 1 + include/libtorrent/ConvertUTF.h | 9 +- include/libtorrent/create_torrent.hpp | 36 +----- include/libtorrent/http_connection.hpp | 2 +- include/libtorrent/http_parser.hpp | 2 +- include/libtorrent/http_seed_connection.hpp | 2 +- .../libtorrent/http_tracker_connection.hpp | 2 +- include/libtorrent/kademlia/dht_tracker.hpp | 4 +- include/libtorrent/kademlia/node.hpp | 2 +- include/libtorrent/kademlia/observer.hpp | 8 +- include/libtorrent/kademlia/routing_table.hpp | 2 +- include/libtorrent/kademlia/rpc_manager.hpp | 2 +- include/libtorrent/peer_connection.hpp | 2 +- include/libtorrent/rss.hpp | 2 +- include/libtorrent/utf8.hpp | 62 +---------- src/Makefile.am | 1 + src/create_torrent.cpp | 35 +++++- src/escape_string.cpp | 8 +- src/torrent_info.cpp | 4 +- src/utf8.cpp | 104 ++++++++++++++++++ src/utp_stream.cpp | 2 +- 23 files changed, 173 insertions(+), 121 deletions(-) create mode 100644 src/utf8.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 677ebe9d8..302e86535 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ set(sources torrent_info tracker_manager http_tracker_connection + utf8 udp_tracker_connection udp_socket upnp diff --git a/Jamfile b/Jamfile index 9c159ff7e..af1d371d5 100755 --- a/Jamfile +++ b/Jamfile @@ -492,6 +492,7 @@ SOURCES = timestamp_history udp_socket upnp + utf8 utp_socket_manager utp_stream logger diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index fa24d7f38..41f1383ed 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -38,6 +38,7 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/hasher.hpp" #include "libtorrent/create_torrent.hpp" #include "libtorrent/file.hpp" +#include "libtorrent/file_pool.hpp" #include diff --git a/include/libtorrent/ConvertUTF.h b/include/libtorrent/ConvertUTF.h index 64bc326aa..42384e128 100644 --- a/include/libtorrent/ConvertUTF.h +++ b/include/libtorrent/ConvertUTF.h @@ -97,7 +97,6 @@ typedef boost::uint16_t UTF16; typedef boost::uint8_t UTF8; extern "C" { #else -#define TORRENT_EXPORT #ifdef _MSC_VER // msvc doesn't seem to have stdint.h typedef unsigned __int32 UTF32; @@ -132,19 +131,19 @@ typedef enum { lenientConversion } ConversionFlags; -TORRENT_EXPORT ConversionResult ConvertUTF8toUTF16 ( +ConversionResult ConvertUTF8toUTF16 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF16** targetStart, UTF16* targetEnd, ConversionFlags flags); -TORRENT_EXPORT ConversionResult ConvertUTF16toUTF8 ( +ConversionResult ConvertUTF16toUTF8 ( const UTF16** sourceStart, const UTF16* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); -TORRENT_EXPORT ConversionResult ConvertUTF8toUTF32 ( +ConversionResult ConvertUTF8toUTF32 ( const UTF8** sourceStart, const UTF8* sourceEnd, UTF32** targetStart, UTF32* targetEnd, ConversionFlags flags); -TORRENT_EXPORT ConversionResult ConvertUTF32toUTF8 ( +ConversionResult ConvertUTF32toUTF8 ( const UTF32** sourceStart, const UTF32* sourceEnd, UTF8** targetStart, UTF8* targetEnd, ConversionFlags flags); diff --git a/include/libtorrent/create_torrent.hpp b/include/libtorrent/create_torrent.hpp index 6df06b937..b40b5c77e 100644 --- a/include/libtorrent/create_torrent.hpp +++ b/include/libtorrent/create_torrent.hpp @@ -36,7 +36,6 @@ POSSIBILITY OF SUCH DAMAGE. #include "libtorrent/bencode.hpp" #include "libtorrent/peer_id.hpp" #include "libtorrent/file_storage.hpp" -#include "libtorrent/file_pool.hpp" #include "libtorrent/config.hpp" #include "libtorrent/storage.hpp" #include "libtorrent/hasher.hpp" @@ -188,8 +187,8 @@ namespace libtorrent inline void nop(int i) {} - int TORRENT_EXPORT get_file_attributes(std::string const& p); - std::string TORRENT_EXPORT get_symlink_path(std::string const& p); + int get_file_attributes(std::string const& p); + std::string get_symlink_path(std::string const& p); TORRENT_EXPORT void add_files_impl(file_storage& fs, std::string const& p , std::string const& l, boost::function pred @@ -253,35 +252,8 @@ namespace libtorrent , filename(utf8), detail::default_pred, flags); } - template - void set_piece_hashes(create_torrent& t, std::wstring const& p, Fun f - , error_code& ec) - { - file_pool fp; - std::string utf8; - wchar_utf8(p, utf8); - boost::scoped_ptr st( - default_storage_constructor(const_cast(t.files()), 0, utf8, fp - , std::vector())); - - // calculate the hash for all pieces - int num = t.num_pieces(); - std::vector buf(t.piece_length()); - for (int i = 0; i < num; ++i) - { - // read hits the disk and will block. Progress should - // be updated in between reads - st->read(&buf[0], i, 0, t.piece_size(i)); - if (st->error()) - { - ec = st->error(); - return; - } - hasher h(&buf[0], t.piece_size(i)); - t.set_hash(i, h.final()); - f(i); - } - } + void TORRENT_EXPORT set_piece_hashes(create_torrent& t, std::wstring const& p + , boost::function const& f, error_code& ec); #ifndef BOOST_NO_EXCEPTIONS template diff --git a/include/libtorrent/http_connection.hpp b/include/libtorrent/http_connection.hpp index 984d0d3d8..e536a82a5 100644 --- a/include/libtorrent/http_connection.hpp +++ b/include/libtorrent/http_connection.hpp @@ -73,7 +73,7 @@ typedef boost::function&)> http_ // when bottled, the last two arguments to the handler // will always be 0 -struct TORRENT_EXPORT http_connection : boost::enable_shared_from_this, boost::noncopyable +struct TORRENT_EXTRA_EXPORT http_connection : boost::enable_shared_from_this, boost::noncopyable { http_connection(io_service& ios, connection_queue& cc , http_handler const& handler, bool bottled = true diff --git a/include/libtorrent/http_parser.hpp b/include/libtorrent/http_parser.hpp index 594033965..19195cb6e 100644 --- a/include/libtorrent/http_parser.hpp +++ b/include/libtorrent/http_parser.hpp @@ -62,7 +62,7 @@ namespace libtorrent // return true if the status code is a redirect bool is_redirect(int http_status); - class TORRENT_EXPORT http_parser + class TORRENT_EXTRA_EXPORT http_parser { public: enum flags_t { dont_parse_chunks = 1 }; diff --git a/include/libtorrent/http_seed_connection.hpp b/include/libtorrent/http_seed_connection.hpp index c98518a52..dba6b1355 100644 --- a/include/libtorrent/http_seed_connection.hpp +++ b/include/libtorrent/http_seed_connection.hpp @@ -72,7 +72,7 @@ namespace libtorrent struct session_impl; } - class TORRENT_EXPORT http_seed_connection + class TORRENT_EXTRA_EXPORT http_seed_connection : public web_connection_base { friend class invariant_access; diff --git a/include/libtorrent/http_tracker_connection.hpp b/include/libtorrent/http_tracker_connection.hpp index 7ee112211..383bd3231 100644 --- a/include/libtorrent/http_tracker_connection.hpp +++ b/include/libtorrent/http_tracker_connection.hpp @@ -61,7 +61,7 @@ namespace libtorrent struct session_settings; namespace aux { struct session_impl; } - class TORRENT_EXPORT http_tracker_connection + class TORRENT_EXTRA_EXPORT http_tracker_connection : public tracker_connection { friend class tracker_manager; diff --git a/include/libtorrent/kademlia/dht_tracker.hpp b/include/libtorrent/kademlia/dht_tracker.hpp index d0ea0a20e..afe51aa11 100644 --- a/include/libtorrent/kademlia/dht_tracker.hpp +++ b/include/libtorrent/kademlia/dht_tracker.hpp @@ -68,8 +68,8 @@ namespace libtorrent { namespace dht struct dht_tracker; - TORRENT_EXPORT void intrusive_ptr_add_ref(dht_tracker const*); - TORRENT_EXPORT void intrusive_ptr_release(dht_tracker const*); + TORRENT_EXTRA_EXPORT void intrusive_ptr_add_ref(dht_tracker const*); + TORRENT_EXTRA_EXPORT void intrusive_ptr_release(dht_tracker const*); struct dht_tracker { diff --git a/include/libtorrent/kademlia/node.hpp b/include/libtorrent/kademlia/node.hpp index 846b6b7e3..45bbbe660 100644 --- a/include/libtorrent/kademlia/node.hpp +++ b/include/libtorrent/kademlia/node.hpp @@ -93,7 +93,7 @@ struct key_desc_t }; }; -bool TORRENT_EXPORT verify_message(lazy_entry const* msg, key_desc_t const desc[] +bool TORRENT_EXTRA_EXPORT verify_message(lazy_entry const* msg, key_desc_t const desc[] , lazy_entry const* ret[], int size , char* error, int error_size); // this is the entry for every peer diff --git a/include/libtorrent/kademlia/observer.hpp b/include/libtorrent/kademlia/observer.hpp index 051ae9e71..2c6ccf7e2 100644 --- a/include/libtorrent/kademlia/observer.hpp +++ b/include/libtorrent/kademlia/observer.hpp @@ -48,8 +48,8 @@ struct msg; struct traversal_algorithm; // defined in rpc_manager.cpp -TORRENT_EXPORT void intrusive_ptr_add_ref(observer const*); -TORRENT_EXPORT void intrusive_ptr_release(observer const*); +TORRENT_EXTRA_EXPORT void intrusive_ptr_add_ref(observer const*); +TORRENT_EXTRA_EXPORT void intrusive_ptr_release(observer const*); // intended struct layout (on 32 bit architectures) // offset size alignment field @@ -64,8 +64,8 @@ TORRENT_EXPORT void intrusive_ptr_release(observer const*); struct observer : boost::noncopyable { - friend TORRENT_EXPORT void intrusive_ptr_add_ref(observer const*); - friend TORRENT_EXPORT void intrusive_ptr_release(observer const*); + friend TORRENT_EXTRA_EXPORT void intrusive_ptr_add_ref(observer const*); + friend TORRENT_EXTRA_EXPORT void intrusive_ptr_release(observer const*); observer(boost::intrusive_ptr const& a , udp::endpoint const& ep, node_id const& id) diff --git a/include/libtorrent/kademlia/routing_table.hpp b/include/libtorrent/kademlia/routing_table.hpp index f6bfe9d74..72567923c 100644 --- a/include/libtorrent/kademlia/routing_table.hpp +++ b/include/libtorrent/kademlia/routing_table.hpp @@ -83,7 +83,7 @@ struct routing_table_node // bucket has failed, then it is put in the replacement // cache (just like in the paper). -class TORRENT_EXPORT routing_table +class TORRENT_EXTRA_EXPORT routing_table { public: routing_table(node_id const& id, int bucket_size diff --git a/include/libtorrent/kademlia/rpc_manager.hpp b/include/libtorrent/kademlia/rpc_manager.hpp index 7061d50bd..92c430e0e 100644 --- a/include/libtorrent/kademlia/rpc_manager.hpp +++ b/include/libtorrent/kademlia/rpc_manager.hpp @@ -65,7 +65,7 @@ struct null_observer : public observer class routing_table; -class TORRENT_EXPORT rpc_manager +class TORRENT_EXTRA_EXPORT rpc_manager { public: typedef bool (*send_fun)(void* userdata, entry&, udp::endpoint const&, int); diff --git a/include/libtorrent/peer_connection.hpp b/include/libtorrent/peer_connection.hpp index 381997ce2..60483ded0 100644 --- a/include/libtorrent/peer_connection.hpp +++ b/include/libtorrent/peer_connection.hpp @@ -140,7 +140,7 @@ namespace libtorrent { return pb.block == block; } }; - class TORRENT_EXPORT peer_connection + class TORRENT_EXTRA_EXPORT peer_connection : public bandwidth_socket , public boost::noncopyable { diff --git a/include/libtorrent/rss.hpp b/include/libtorrent/rss.hpp index 44a1947df..6cde3901d 100644 --- a/include/libtorrent/rss.hpp +++ b/include/libtorrent/rss.hpp @@ -136,7 +136,7 @@ namespace libtorrent // RSS feed. All user interaction with this object // goes through the feed_handle, which makes sure all calls // are posted to the network thread - struct TORRENT_EXPORT feed : boost::enable_shared_from_this + struct TORRENT_EXTRA_EXPORT feed : boost::enable_shared_from_this { friend void parse_feed(feed_state& f, int token, char const* name, char const* val); diff --git a/include/libtorrent/utf8.hpp b/include/libtorrent/utf8.hpp index 7587ab36e..a7061ab9e 100644 --- a/include/libtorrent/utf8.hpp +++ b/include/libtorrent/utf8.hpp @@ -42,68 +42,10 @@ POSSIBILITY OF SUCH DAMAGE. #include #include -#include "libtorrent/ConvertUTF.h" - namespace libtorrent { - inline int utf8_wchar(const std::string &utf8, std::wstring &wide) - { - // allocate space for worst-case - wide.resize(utf8.size()); - wchar_t const* dst_start = wide.c_str(); - char const* src_start = utf8.c_str(); - ConversionResult ret; - if (sizeof(wchar_t) == sizeof(UTF32)) - { - ret = ConvertUTF8toUTF32((const UTF8**)&src_start, (const UTF8*)src_start - + utf8.size(), (UTF32**)&dst_start, (UTF32*)dst_start + wide.size() - , lenientConversion); - wide.resize(dst_start - wide.c_str()); - return ret; - } - else if (sizeof(wchar_t) == sizeof(UTF16)) - { - ret = ConvertUTF8toUTF16((const UTF8**)&src_start, (const UTF8*)src_start - + utf8.size(), (UTF16**)&dst_start, (UTF16*)dst_start + wide.size() - , lenientConversion); - wide.resize(dst_start - wide.c_str()); - return ret; - } - else - { - return sourceIllegal; - } - } - - inline int wchar_utf8(const std::wstring &wide, std::string &utf8) - { - // allocate space for worst-case - utf8.resize(wide.size() * 6); - if (wide.empty()) return 0; - char* dst_start = &utf8[0]; - wchar_t const* src_start = wide.c_str(); - ConversionResult ret; - if (sizeof(wchar_t) == sizeof(UTF32)) - { - ret = ConvertUTF32toUTF8((const UTF32**)&src_start, (const UTF32*)src_start - + wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size() - , lenientConversion); - utf8.resize(dst_start - &utf8[0]); - return ret; - } - else if (sizeof(wchar_t) == sizeof(UTF16)) - { - ret = ConvertUTF16toUTF8((const UTF16**)&src_start, (const UTF16*)src_start - + wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size() - , lenientConversion); - utf8.resize(dst_start - &utf8[0]); - return ret; - } - else - { - return sourceIllegal; - } - } + TORRENT_EXPORT int utf8_wchar(const std::string &utf8, std::wstring &wide); + TORRENT_EXPORT int wchar_utf8(const std::wstring &wide, std::string &utf8); } #endif // !BOOST_NO_STD_WSTRING diff --git a/src/Makefile.am b/src/Makefile.am index edbf569d8..2786af947 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -95,6 +95,7 @@ libtorrent_rasterbar_la_SOURCES = \ upnp.cpp \ ut_metadata.cpp \ ut_pex.cpp \ + utf8.cpp \ utp_socket_manager.cpp \ utp_stream.cpp \ web_peer_connection.cpp \ diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index 7fef0068b..762fdd89b 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -160,8 +160,39 @@ namespace libtorrent char* m_piece; }; - void set_piece_hashes(create_torrent& t, std::string const& p, boost::function f - , error_code& ec) +#if TORRENT_USE_WSTRING + void set_piece_hashes(create_torrent& t, std::wstring const& p + , boost::function const& f, error_code& ec) + { + file_pool fp; + std::string utf8; + wchar_utf8(p, utf8); + boost::scoped_ptr st( + default_storage_constructor(const_cast(t.files()), 0, utf8, fp + , std::vector())); + + // calculate the hash for all pieces + int num = t.num_pieces(); + std::vector buf(t.piece_length()); + for (int i = 0; i < num; ++i) + { + // read hits the disk and will block. Progress should + // be updated in between reads + st->read(&buf[0], i, 0, t.piece_size(i)); + if (st->error()) + { + ec = st->error(); + return; + } + hasher h(&buf[0], t.piece_size(i)); + t.set_hash(i, h.final()); + f(i); + } + } +#endif + + void set_piece_hashes(create_torrent& t, std::string const& p + , boost::function f, error_code& ec) { file_pool fp; boost::scoped_ptr st( diff --git a/src/escape_string.cpp b/src/escape_string.cpp index c1a715df5..021e6c770 100644 --- a/src/escape_string.cpp +++ b/src/escape_string.cpp @@ -510,7 +510,7 @@ namespace libtorrent return url.substr(pos, url.find('&', pos) - pos); } - TORRENT_EXPORT std::string to_hex(std::string const& s) + TORRENT_EXTRA_EXPORT std::string to_hex(std::string const& s) { std::string ret; for (std::string::const_iterator i = s.begin(); i != s.end(); ++i) @@ -521,7 +521,7 @@ namespace libtorrent return ret; } - TORRENT_EXPORT void to_hex(char const *in, int len, char* out) + TORRENT_EXTRA_EXPORT void to_hex(char const *in, int len, char* out) { for (char const* end = in + len; in < end; ++in) { @@ -539,7 +539,7 @@ namespace libtorrent return -1; } - TORRENT_EXPORT bool is_hex(char const *in, int len) + TORRENT_EXTRA_EXPORT bool is_hex(char const *in, int len) { for (char const* end = in + len; in < end; ++in) { @@ -549,7 +549,7 @@ namespace libtorrent return true; } - TORRENT_EXPORT bool from_hex(char const *in, int len, char* out) + TORRENT_EXTRA_EXPORT bool from_hex(char const *in, int len, char* out) { for (char const* end = in + len; in < end; ++in, ++out) { diff --git a/src/torrent_info.cpp b/src/torrent_info.cpp index 91a157b7c..9d934de50 100644 --- a/src/torrent_info.cpp +++ b/src/torrent_info.cpp @@ -92,7 +92,7 @@ namespace libtorrent // fixes invalid UTF-8 sequences and // replaces characters that are invalid // in paths - TORRENT_EXPORT bool verify_encoding(std::string& target, bool fix_paths = false) + TORRENT_EXTRA_EXPORT bool verify_encoding(std::string& target, bool fix_paths = false) { std::string tmp_path; bool valid_encoding = true; @@ -213,7 +213,7 @@ namespace libtorrent } } - TORRENT_EXPORT std::string sanitize_path(std::string const& p) + TORRENT_EXTRA_EXPORT std::string sanitize_path(std::string const& p) { std::string new_path; std::string split = split_path(p); diff --git a/src/utf8.cpp b/src/utf8.cpp new file mode 100644 index 000000000..921eb914e --- /dev/null +++ b/src/utf8.cpp @@ -0,0 +1,104 @@ +/* + +Copyright (c) 2012, Arvid Norberg +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the distribution. + * Neither the name of the author nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +*/ + +#include "libtorrent/config.hpp" +#include "libtorrent/utf8.hpp" +#include "libtorrent/ConvertUTF.h" + +// on windows we need these functions for +// convert_to_native and convert_from_native +#if TORRENT_USE_WSTRING || defined TORRENT_WINDOWS + +namespace libtorrent +{ + int utf8_wchar(const std::string &utf8, std::wstring &wide) + { + // allocate space for worst-case + wide.resize(utf8.size()); + wchar_t const* dst_start = wide.c_str(); + char const* src_start = utf8.c_str(); + ConversionResult ret; + if (sizeof(wchar_t) == sizeof(UTF32)) + { + ret = ConvertUTF8toUTF32((const UTF8**)&src_start, (const UTF8*)src_start + + utf8.size(), (UTF32**)&dst_start, (UTF32*)dst_start + wide.size() + , lenientConversion); + wide.resize(dst_start - wide.c_str()); + return ret; + } + else if (sizeof(wchar_t) == sizeof(UTF16)) + { + ret = ConvertUTF8toUTF16((const UTF8**)&src_start, (const UTF8*)src_start + + utf8.size(), (UTF16**)&dst_start, (UTF16*)dst_start + wide.size() + , lenientConversion); + wide.resize(dst_start - wide.c_str()); + return ret; + } + else + { + return sourceIllegal; + } + } + + int wchar_utf8(const std::wstring &wide, std::string &utf8) + { + // allocate space for worst-case + utf8.resize(wide.size() * 6); + if (wide.empty()) return 0; + char* dst_start = &utf8[0]; + wchar_t const* src_start = wide.c_str(); + ConversionResult ret; + if (sizeof(wchar_t) == sizeof(UTF32)) + { + ret = ConvertUTF32toUTF8((const UTF32**)&src_start, (const UTF32*)src_start + + wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size() + , lenientConversion); + utf8.resize(dst_start - &utf8[0]); + return ret; + } + else if (sizeof(wchar_t) == sizeof(UTF16)) + { + ret = ConvertUTF16toUTF8((const UTF16**)&src_start, (const UTF16*)src_start + + wide.size(), (UTF8**)&dst_start, (UTF8*)dst_start + utf8.size() + , lenientConversion); + utf8.resize(dst_start - &utf8[0]); + return ret; + } + else + { + return sourceIllegal; + } + } +#endif + +} + diff --git a/src/utp_stream.cpp b/src/utp_stream.cpp index 2e2e98016..d76bcd186 100644 --- a/src/utp_stream.cpp +++ b/src/utp_stream.cpp @@ -115,7 +115,7 @@ enum // into account. if lhs is close to UINT_MAX and rhs // is close to 0, lhs is assumed to have wrapped and // considered smaller -TORRENT_EXPORT bool compare_less_wrap(boost::uint32_t lhs, boost::uint32_t rhs, boost::uint32_t mask) +TORRENT_EXTRA_EXPORT bool compare_less_wrap(boost::uint32_t lhs, boost::uint32_t rhs, boost::uint32_t mask) { // distance walking from lhs to rhs, downwards boost::uint32_t dist_down = (lhs - rhs) & mask;