diff --git a/src/base/bittorrent/nativesessionextension.cpp b/src/base/bittorrent/nativesessionextension.cpp index 8ce4e9633..6b37a0c4d 100644 --- a/src/base/bittorrent/nativesessionextension.cpp +++ b/src/base/bittorrent/nativesessionextension.cpp @@ -53,12 +53,12 @@ lt::feature_flags_t NativeSessionExtension::implemented_features() return alert_feature; } -std::shared_ptr NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, void *) +std::shared_ptr NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, ClientData) { return std::make_shared(torrentHandle); } #else -boost::shared_ptr NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, void *) +boost::shared_ptr NativeSessionExtension::new_torrent(const lt::torrent_handle &torrentHandle, ClientData) { return boost::make_shared(torrentHandle); } diff --git a/src/base/bittorrent/nativesessionextension.h b/src/base/bittorrent/nativesessionextension.h index 9dd5f6a32..0c01cc555 100644 --- a/src/base/bittorrent/nativesessionextension.h +++ b/src/base/bittorrent/nativesessionextension.h @@ -33,11 +33,17 @@ class NativeSessionExtension final : public lt::plugin { +#if (LIBTORRENT_VERSION_NUM >= 20000) + using ClientData = lt::client_data_t; +#else + using ClientData = void *; +#endif + #if (LIBTORRENT_VERSION_NUM >= 10200) lt::feature_flags_t implemented_features() override; - std::shared_ptr new_torrent(const lt::torrent_handle &torrentHandle, void *userData) override; + std::shared_ptr new_torrent(const lt::torrent_handle &torrentHandle, ClientData) override; #else - boost::shared_ptr new_torrent(const lt::torrent_handle &torrentHandle, void *userData) override; + boost::shared_ptr new_torrent(const lt::torrent_handle &torrentHandle, ClientData) override; #endif void on_alert(const lt::alert *alert) override; };