fix haiku build
This commit is contained in:
parent
1baf5eabdf
commit
a0a63341c7
7
Jamfile
7
Jamfile
|
@ -93,6 +93,12 @@ rule linking ( properties * )
|
|||
result += <library>netkit <library>gcc ;
|
||||
}
|
||||
|
||||
if <target-os>haiku in $(properties)
|
||||
{
|
||||
result += <library>libnetwork <library>gcc ;
|
||||
}
|
||||
|
||||
|
||||
if <target-os>solaris in $(properties)
|
||||
{
|
||||
result += <library>libsocket <library>libnsl ;
|
||||
|
@ -589,6 +595,7 @@ lib dl : : <link>shared <name>dl ;
|
|||
|
||||
lib libsocket : : <use>libnsl <name>socket <link>shared <search>/usr/sfw/lib <link>shared ;
|
||||
lib libnsl : : <name>nsl <link>shared <search>/usr/sfw/lib <link>shared ;
|
||||
lib libnetwork : : <name>network <link>shared ;
|
||||
|
||||
# socket libraries on windows
|
||||
lib wsock32 : : <name>wsock32 <link>shared ;
|
||||
|
|
|
@ -49,6 +49,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include <iostream>
|
||||
#include <atomic>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
|
||||
#if BOOST_ASIO_DYN_LINK
|
||||
#if BOOST_VERSION >= 104500
|
||||
|
@ -104,17 +105,6 @@ std::atomic<int> num_suggest(0);
|
|||
// the number of requests made from suggested pieces
|
||||
std::atomic<int> num_suggested_requests(0);
|
||||
|
||||
void sleep_ms(int milliseconds)
|
||||
{
|
||||
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
|
||||
Sleep(milliseconds);
|
||||
#elif defined TORRENT_BEOS
|
||||
snooze_until(system_time() + std::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
|
||||
#else
|
||||
usleep(milliseconds * 1000);
|
||||
#endif
|
||||
}
|
||||
|
||||
std::string leaf_path(std::string f)
|
||||
{
|
||||
if (f.empty()) return "";
|
||||
|
@ -1096,7 +1086,7 @@ int main(int argc, char* argv[])
|
|||
else if (test_mode == dual_test) seed = (i & 1);
|
||||
conns.push_back(new peer_conn(ios[i % num_threads], ti.num_pieces(), ti.piece_length() / 16 / 1024
|
||||
, ep, (char const*)&ti.info_hash()[0], seed, churn, corrupt));
|
||||
sleep_ms(1);
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1));
|
||||
ios[i % num_threads].poll_one(ec);
|
||||
if (ec)
|
||||
{
|
||||
|
|
|
@ -307,6 +307,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#ifndef TORRENT_USE_ICONV
|
||||
#define TORRENT_USE_ICONV 0
|
||||
#endif
|
||||
#define TORRENT_USE_MEMALIGN 1
|
||||
|
||||
// ==== GNU/Hurd ===
|
||||
#elif defined __GNU__
|
||||
|
|
|
@ -35,10 +35,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
|||
#include "libtorrent/assert.hpp" // for print_backtrace
|
||||
#include <cstdint>
|
||||
|
||||
#if defined TORRENT_BEOS
|
||||
#include <kernel/OS.h>
|
||||
#include <stdlib.h> // malloc/free
|
||||
#elif !defined TORRENT_WINDOWS
|
||||
#if !defined TORRENT_WINDOWS
|
||||
#include <cstdlib> // posix_memalign/free
|
||||
#include <unistd.h> // _SC_PAGESIZE
|
||||
#endif
|
||||
|
@ -119,10 +116,6 @@ namespace libtorrent {
|
|||
ret = ::memalign(std::size_t(page_size()), std::size_t(bytes));
|
||||
#elif defined TORRENT_WINDOWS
|
||||
ret = ::_aligned_malloc(std::size_t(bytes), std::size_t(page_size()));
|
||||
#elif defined TORRENT_BEOS
|
||||
area_id id = create_area("", &ret, B_ANY_ADDRESS
|
||||
, (bytes + page_size() - 1) & (page_size() - 1), B_NO_LOCK, B_READ_AREA | B_WRITE_AREA);
|
||||
if (id < B_OK) return nullptr;
|
||||
#else
|
||||
ret = valloc(std::size_t(bytes));
|
||||
#endif
|
||||
|
@ -188,10 +181,6 @@ namespace libtorrent {
|
|||
|
||||
#ifdef TORRENT_WINDOWS
|
||||
_aligned_free(block);
|
||||
#elif defined TORRENT_BEOS
|
||||
area_id id = area_for(block);
|
||||
if (id < B_OK) return;
|
||||
delete_area(id);
|
||||
#else
|
||||
::free(block);
|
||||
#endif // TORRENT_WINDOWS
|
||||
|
|
|
@ -1681,6 +1681,7 @@ constexpr disk_job_flags_t disk_interface::cache_hit;
|
|||
{
|
||||
TORRENT_ASSERT(r.length <= default_block_size);
|
||||
TORRENT_ASSERT(r.length <= 16 * 1024);
|
||||
TORRENT_ASSERT(buf != nullptr);
|
||||
|
||||
bool exceeded = false;
|
||||
disk_buffer_holder buffer(*this, m_disk_cache.allocate_buffer(exceeded, o, "receive buffer"), 0x4000);
|
||||
|
|
|
@ -790,7 +790,7 @@ int _System __libsocket_sysctl(int* mib, u_int namelen, void *oldp, size_t *oldl
|
|||
udp::resolver::iterator i = r.resolve(udp::resolver::query(boost::asio::ip::host_name(ec), "0"), ec);
|
||||
if (ec) return ret;
|
||||
ip_interface iface;
|
||||
for (;i != udp::resolver_iterator(); ++i)
|
||||
for (;i != udp::resolver::iterator(); ++i)
|
||||
{
|
||||
iface.interface_address = i->endpoint().address();
|
||||
iface.name[0] = '\0';
|
||||
|
@ -815,6 +815,7 @@ int _System __libsocket_sysctl(int* mib, u_int namelen, void *oldp, size_t *oldl
|
|||
{
|
||||
std::vector<ip_route> ret;
|
||||
TORRENT_UNUSED(ios);
|
||||
TORRENT_UNUSED(ec);
|
||||
|
||||
#ifdef TORRENT_BUILD_SIMULATOR
|
||||
|
||||
|
|
|
@ -6233,7 +6233,7 @@ namespace aux {
|
|||
template <typename Socket>
|
||||
void set_tos(Socket& s, int v, error_code& ec)
|
||||
{
|
||||
#if TORRENT_USE_IPV6
|
||||
#if TORRENT_USE_IPV6 && defined IPV6_TCLASS
|
||||
if (s.local_endpoint(ec).address().is_v6())
|
||||
s.set_option(traffic_class(char(v)), ec);
|
||||
else if (!ec)
|
||||
|
|
Loading…
Reference in New Issue