From eb62b96da845bf4aa9aa7f3283b16dbe03c7866d Mon Sep 17 00:00:00 2001 From: Alden Torres Date: Fri, 8 Jan 2021 14:49:14 -0500 Subject: [PATCH] moved platform_util.hpp, puff.hpp and union_endpoint.hpp to aux --- CMakeLists.txt | 6 +++--- Makefile | 6 +++--- include/libtorrent/{ => aux_}/platform_util.hpp | 6 ++++-- include/libtorrent/{ => aux_}/puff.hpp | 0 include/libtorrent/aux_/tracker_manager.hpp | 2 +- include/libtorrent/{ => aux_}/union_endpoint.hpp | 2 +- include/libtorrent/kademlia/node_entry.hpp | 10 ++++------ src/gzip.cpp | 2 +- src/platform_util.cpp | 4 ++-- src/puff.cpp | 2 +- src/session_impl.cpp | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) rename include/libtorrent/{ => aux_}/platform_util.hpp (53%) rename include/libtorrent/{ => aux_}/puff.hpp (100%) rename include/libtorrent/{ => aux_}/union_endpoint.hpp (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a13ea279b..26bac01be16 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,10 +77,8 @@ set(libtorrent_include_files pex_flags piece_block piece_picker - platform_util portmap proxy_base - puff random read_resume_data session @@ -107,7 +105,6 @@ set(libtorrent_include_files torrent_info torrent_status tracker_event - union_endpoint units upnp version @@ -214,11 +211,13 @@ set(libtorrent_aux_include_files peer_connection peer_list piece_block_progress + platform_util polymorphic_socket pool portmap posix_part_file proxy_settings + puff range receive_buffer request_blocks @@ -256,6 +255,7 @@ set(libtorrent_aux_include_files tracker_manager udp_socket udp_tracker_connection + union_endpoint unique_ptr utf8 utp_socket_manager diff --git a/Makefile b/Makefile index 8e7290e5968..5f12894e593 100644 --- a/Makefile +++ b/Makefile @@ -477,11 +477,9 @@ HEADERS = \ pex_flags.hpp \ piece_block.hpp \ piece_picker.hpp \ - platform_util.hpp \ portmap.hpp \ posix_disk_io.hpp \ proxy_base.hpp \ - puff.hpp \ random.hpp \ read_resume_data.hpp \ session.hpp \ @@ -510,7 +508,6 @@ HEADERS = \ torrent_info.hpp \ torrent_status.hpp \ tracker_event.hpp \ - union_endpoint.hpp \ units.hpp \ upnp.hpp \ version.hpp \ @@ -590,12 +587,14 @@ HEADERS = \ aux_/peer_connection.hpp \ aux_/peer_list.hpp \ aux_/piece_block_progress.hpp \ + aux_/platform_util.hpp \ aux_/polymorphic_socket.hpp \ aux_/pool.hpp \ aux_/portmap.hpp \ aux_/posix_part_file.hpp \ aux_/posix_storage.hpp \ aux_/proxy_settings.hpp \ + aux_/puff.hpp \ aux_/range.hpp \ aux_/receive_buffer.hpp \ aux_/request_blocks.hpp \ @@ -635,6 +634,7 @@ HEADERS = \ aux_/tracker_manager.hpp \ aux_/udp_socket.hpp \ aux_/udp_tracker_connection.hpp \ + aux_/union_endpoint.hpp \ aux_/unique_ptr.hpp \ aux_/utf8.hpp \ aux_/utp_socket_manager.hpp \ diff --git a/include/libtorrent/platform_util.hpp b/include/libtorrent/aux_/platform_util.hpp similarity index 53% rename from include/libtorrent/platform_util.hpp rename to include/libtorrent/aux_/platform_util.hpp index 0934e0d56b9..b1bd1a8d2ff 100644 --- a/include/libtorrent/platform_util.hpp +++ b/include/libtorrent/aux_/platform_util.hpp @@ -1,11 +1,13 @@ #ifndef TORRENT_PLATFORM_UTIL_HPP #define TORRENT_PLATFORM_UTIL_HPP +#include "libtorrent/aux_/export.hpp" + #include -namespace libtorrent { +namespace libtorrent::aux { - int max_open_files(); + TORRENT_EXTRA_EXPORT int max_open_files(); } diff --git a/include/libtorrent/puff.hpp b/include/libtorrent/aux_/puff.hpp similarity index 100% rename from include/libtorrent/puff.hpp rename to include/libtorrent/aux_/puff.hpp diff --git a/include/libtorrent/aux_/tracker_manager.hpp b/include/libtorrent/aux_/tracker_manager.hpp index 8c1f00a91e7..340e74fb2da 100644 --- a/include/libtorrent/aux_/tracker_manager.hpp +++ b/include/libtorrent/aux_/tracker_manager.hpp @@ -34,7 +34,7 @@ see LICENSE file. #include "libtorrent/peer_id.hpp" #include "libtorrent/aux_/peer.hpp" // peer_entry #include "libtorrent/deadline_timer.hpp" -#include "libtorrent/union_endpoint.hpp" +#include "libtorrent/aux_/union_endpoint.hpp" #include "libtorrent/io_context.hpp" #include "libtorrent/span.hpp" #include "libtorrent/time.hpp" diff --git a/include/libtorrent/union_endpoint.hpp b/include/libtorrent/aux_/union_endpoint.hpp similarity index 98% rename from include/libtorrent/union_endpoint.hpp rename to include/libtorrent/aux_/union_endpoint.hpp index 4fbcd016e24..e9fdf681061 100644 --- a/include/libtorrent/union_endpoint.hpp +++ b/include/libtorrent/aux_/union_endpoint.hpp @@ -14,7 +14,7 @@ see LICENSE file. #include "libtorrent/socket.hpp" #include "libtorrent/address.hpp" -namespace libtorrent { +namespace libtorrent::aux { struct union_address { diff --git a/include/libtorrent/kademlia/node_entry.hpp b/include/libtorrent/kademlia/node_entry.hpp index e9153ae6e99..b53e1f5c201 100644 --- a/include/libtorrent/kademlia/node_entry.hpp +++ b/include/libtorrent/kademlia/node_entry.hpp @@ -15,12 +15,11 @@ see LICENSE file. #include "libtorrent/kademlia/node_id.hpp" #include "libtorrent/socket.hpp" #include "libtorrent/address.hpp" -#include "libtorrent/union_endpoint.hpp" +#include "libtorrent/aux_/union_endpoint.hpp" #include "libtorrent/time.hpp" // for time_point #include "libtorrent/aux_/time.hpp" // for time_now -namespace libtorrent { -namespace dht { +namespace libtorrent::dht { struct TORRENT_EXTRA_EXPORT node_entry { @@ -55,7 +54,7 @@ struct TORRENT_EXTRA_EXPORT node_entry node_id id{nullptr}; - union_endpoint endpoint; + aux::union_endpoint endpoint; // the average RTT of this node std::uint16_t rtt = 0xffff; @@ -68,7 +67,6 @@ struct TORRENT_EXTRA_EXPORT node_entry bool verified = false; }; -} // namespace dht -} // namespace libtorrent +} // namespace libtorrent::dht #endif diff --git a/src/gzip.cpp b/src/gzip.cpp index f12ec86e52c..f6b7bc76c91 100644 --- a/src/gzip.cpp +++ b/src/gzip.cpp @@ -9,7 +9,7 @@ see LICENSE file. */ #include "libtorrent/assert.hpp" -#include "libtorrent/puff.hpp" +#include "libtorrent/aux_/puff.hpp" #include "libtorrent/gzip.hpp" #include diff --git a/src/platform_util.cpp b/src/platform_util.cpp index ebde3c2d863..da511a28608 100644 --- a/src/platform_util.cpp +++ b/src/platform_util.cpp @@ -10,7 +10,7 @@ see LICENSE file. */ #include "libtorrent/config.hpp" -#include "libtorrent/platform_util.hpp" +#include "libtorrent/aux_/platform_util.hpp" #include #include @@ -39,7 +39,7 @@ const rlim_t rlim_infinity = RLIM_INFINITY; #include "libtorrent/aux_/disable_warnings_pop.hpp" -namespace libtorrent { +namespace libtorrent::aux { int max_open_files() { diff --git a/src/puff.cpp b/src/puff.cpp index d100416d8eb..6b054d0d4ee 100644 --- a/src/puff.cpp +++ b/src/puff.cpp @@ -84,7 +84,7 @@ #include /* for setjmp(), longjmp(), and jmp_buf */ #include /* for nullptr */ -#include "libtorrent/puff.hpp" /* prototype for puff() */ +#include "libtorrent/aux_/puff.hpp" /* prototype for puff() */ #define local static /* for local function definitions */ diff --git a/src/session_impl.cpp b/src/session_impl.cpp index d8626ff6a79..f93e1f6165d 100644 --- a/src/session_impl.cpp +++ b/src/session_impl.cpp @@ -75,7 +75,7 @@ see LICENSE file. #include "libtorrent/torrent_handle.hpp" #include "libtorrent/aux_/choker.hpp" #include "libtorrent/error.hpp" -#include "libtorrent/platform_util.hpp" +#include "libtorrent/aux_/platform_util.hpp" #include "libtorrent/aux_/bind_to_device.hpp" #include "libtorrent/hex.hpp" // to_hex, from_hex #include "libtorrent/aux_/scope_end.hpp"