mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 14:38:51 +02:00
118 lines
3.2 KiB
Plaintext
118 lines
3.2 KiB
Plaintext
From 7258de8d1f9af649bc829b447c93e0f835602d0b Mon Sep 17 00:00:00 2001
|
|
From: Sergei Reznikov <diver@gelios.net>
|
|
Date: Tue, 9 Jun 2015 08:26:30 +0300
|
|
Subject: Replace BeOS support code with Haiku
|
|
|
|
|
|
diff --git a/include/libtorrent/config.hpp b/include/libtorrent/config.hpp
|
|
index 1f17426..c8f36f3 100644
|
|
--- a/include/libtorrent/config.hpp
|
|
+++ b/include/libtorrent/config.hpp
|
|
@@ -245,14 +245,15 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
#define TORRENT_USE_IFCONF 1
|
|
#define TORRENT_HAS_SALEN 0
|
|
|
|
-// ==== 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_MLOCK 0
|
|
#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 70a2b85..9bc9ee3 100644
|
|
--- a/include/libtorrent/thread.hpp
|
|
+++ b/include/libtorrent/thread.hpp
|
|
@@ -41,10 +41,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>
|
|
@@ -75,7 +71,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 310cf0b..4cb2aa8 100644
|
|
--- a/src/allocator.cpp
|
|
+++ b/src/allocator.cpp
|
|
@@ -42,7 +42,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 0994a63..a66d20b 100644
|
|
--- a/src/enum_net.cpp
|
|
+++ b/src/enum_net.cpp
|
|
@@ -92,6 +92,10 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
#define IF_NAMESIZE IFNAMSIZ
|
|
#endif
|
|
|
|
+#if defined __HAIKU__
|
|
+#include <sys/sockio.h>
|
|
+#endif
|
|
+
|
|
namespace libtorrent { namespace
|
|
{
|
|
|
|
diff --git a/src/thread.cpp b/src/thread.cpp
|
|
index c22aeb0..2490d20 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>
|
|
@@ -48,8 +44,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
|
|
@@ -129,7 +123,7 @@ namespace libtorrent
|
|
{
|
|
ReleaseSemaphore(m_sem, m_num_waiters, 0);
|
|
}
|
|
-#elif defined TORRENT_BEOS
|
|
+#elif defined TORRENT_HAIKU
|
|
condition_variable::condition_variable()
|
|
: m_num_waiters(0)
|
|
{
|
|
--
|
|
2.2.2
|
|
|