Files
haikuports/net-libs/libtorrent-rasterbar/patches/libtorrent_rasterbar-1.1.4.patchset
2017-09-30 15:03:51 +02:00

153 lines
4.4 KiB
Plaintext

From 74689dea505a419387d2179bcd584a94a9cb0e40 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Fri, 8 Sep 2017 09:25:29 +0300
Subject: Replace BeOS support code with Haiku
diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp
index be22e9c..b3293dc 100644
--- a/include/libtorrent/config.hpp
+++ b/include/libtorrent/config.hpp
@@ -321,14 +321,15 @@ POSSIBILITY OF SUCH DAMAGE.
#define TORRENT_HAVE_MMAP 1
#define TORRENT_USE_SOLARIS_ATOMIC 1
-// ==== BEOS ===
-#elif defined __BEOS__ || defined __HAIKU__
-#define TORRENT_BEOS
-#include <storage/StorageDefs.h> // B_PATH_NAME_LENGTH
+// ==== Haiku ===
+#elif defined __HAIKU__
+#define TORRENT_HAIKU
+#include <StorageDefs.h> // B_PATH_NAME_LENGTH
#define TORRENT_HAS_FALLOCATE 0
#define TORRENT_USE_BEOS_ATOMIC 1
#ifndef TORRENT_USE_ICONV
#define TORRENT_USE_ICONV 0
+#define TORRENT_USE_IFCONF 1
#endif
// ==== GNU/Hurd ===
diff --git a/include/libtorrent/thread.hpp b/include/libtorrent/thread.hpp
index 4ef92bb..70d629e 100644
--- a/include/libtorrent/thread.hpp
+++ b/include/libtorrent/thread.hpp
@@ -44,10 +44,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include <winsock2.h>
#endif
-#if defined TORRENT_BEOS
-#include <kernel/OS.h>
-#endif
-
#include <memory> // for auto_ptr required by asio
#include <boost/asio/detail/thread.hpp>
@@ -81,7 +77,6 @@ namespace libtorrent
HANDLE m_sem;
mutex m_mutex;
int m_num_waiters;
-#elif defined TORRENT_BEOS
sem_id m_sem;
mutex m_mutex;
int m_num_waiters;
diff --git a/src/allocator.cpp b/src/allocator.cpp
index a21ac74..6e55176 100644
--- a/src/allocator.cpp
+++ b/src/allocator.cpp
@@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE.
#include <unistd.h> // _SC_PAGESIZE
#endif
-#if TORRENT_USE_MEMALIGN || TORRENT_USE_POSIX_MEMALIGN || defined TORRENT_WINDOWS
+#if TORRENT_USE_MEMALIGN || TORRENT_USE_POSIX_MEMALIGN || defined TORRENT_WINDOWS || defined TORRENT_HAIKU
#include <malloc.h> // memalign and _aligned_malloc
#include <stdlib.h> // _aligned_malloc on mingw
#endif
diff --git a/src/enum_net.cpp b/src/enum_net.cpp
index f38fb11..9c15de3 100644
--- a/src/enum_net.cpp
+++ b/src/enum_net.cpp
@@ -88,6 +88,10 @@ POSSIBILITY OF SUCH DAMAGE.
#include <ifaddrs.h>
#endif
+#if defined __HAIKU__
+#include <sys/sockio.h>
+#endif
+
#if TORRENT_USE_IFADDRS || TORRENT_USE_IFCONF || TORRENT_USE_NETLINK || TORRENT_USE_SYSCTL
// capture this here where warnings are disabled (the macro generates warnings)
const unsigned long siocgifmtu = SIOCGIFMTU;
diff --git a/src/thread.cpp b/src/thread.cpp
index eec8c10..8042f03 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -33,10 +33,6 @@ POSSIBILITY OF SUCH DAMAGE.
#include "libtorrent/thread.hpp"
#include "libtorrent/assert.hpp"
-#ifdef TORRENT_BEOS
-#include <kernel/OS.h>
-#endif
-
#ifdef BOOST_HAS_PTHREADS
#include <sys/time.h> // for gettimeofday()
#include <boost/cstdint.hpp>
@@ -51,8 +47,6 @@ namespace libtorrent
{
#if defined TORRENT_WINDOWS || defined TORRENT_CYGWIN
Sleep(milliseconds);
-#elif defined TORRENT_BEOS
- snooze_until(system_time() + boost::int64_t(milliseconds) * 1000, B_SYSTEM_TIMEBASE);
#else
usleep(milliseconds * 1000);
#endif
@@ -146,7 +140,7 @@ namespace libtorrent
{
ReleaseSemaphore(m_sem, (std::min)(m_num_waiters, 1), 0);
}
-#elif defined TORRENT_BEOS
+#elif defined TORRENT_HAIKU
condition_variable::condition_variable()
: m_num_waiters(0)
{
--
2.13.1
From b8fd200de6a5bd06d42a0d508a622e341406c812 Mon Sep 17 00:00:00 2001
From: arvidn <arvid@cs.umu.se>
Date: Tue, 11 Jul 2017 23:16:50 -0700
Subject: use the official boost.config header
diff --git a/include/libtorrent/export.hpp b/include/libtorrent/export.hpp
index 87536af..503afe2 100644
--- a/include/libtorrent/export.hpp
+++ b/include/libtorrent/export.hpp
@@ -33,19 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
#ifndef TORRENT_EXPORT_HPP_INCLUDED
#define TORRENT_EXPORT_HPP_INCLUDED
-#if !defined(BOOST_COMPILER_CONFIG) && !defined(BOOST_NO_COMPILER_CONFIG)
-# include <boost/config/select_compiler_config.hpp>
-#endif
-#ifdef BOOST_COMPILER_CONFIG
-# include BOOST_COMPILER_CONFIG
-#endif
-
-#if !defined(BOOST_PLATFORM_CONFIG) && !defined(BOOST_NO_PLATFORM_CONFIG)
-# include <boost/config/select_platform_config.hpp>
-#endif
-#ifdef BOOST_PLATFORM_CONFIG
-# include BOOST_PLATFORM_CONFIG
-#endif
+#include <boost/config.hpp>
// backwards compatibility with older versions of boost
#if !defined BOOST_SYMBOL_EXPORT && !defined BOOST_SYMBOL_IMPORT
--
2.13.1