mirror of
https://github.com/yann64/haikuports.git
synced 2026-05-05 06:28:55 +02:00
156 lines
5.7 KiB
Diff
156 lines
5.7 KiB
Diff
diff -Naur transmission-1.42-original/libtransmission/platform.c transmission-1.42/libtransmission/platform.c
|
|
--- transmission-1.42-original/libtransmission/platform.c 2009-01-10 18:04:07.000000000 +0000
|
|
+++ transmission-1.42/libtransmission/platform.c 2009-01-10 18:56:46.000000000 +0000
|
|
@@ -22,6 +22,8 @@
|
|
#else
|
|
#ifdef SYS_DARWIN
|
|
#include <CoreFoundation/CoreFoundation.h>
|
|
+ #elif defined(__HAIKU__)
|
|
+ #include <FindDirectory.h>
|
|
#endif
|
|
|
|
#define _XOPEN_SOURCE 500 /* needed for recursive locks. */
|
|
@@ -298,7 +300,7 @@
|
|
|
|
if( !path )
|
|
{
|
|
-#ifdef __BEOS__
|
|
+#if defined(__BEOS__) || defined(__HAIKU__)
|
|
char buf[MAX_PATH_LENGTH];
|
|
find_directory( B_USER_SETTINGS_DIRECTORY,
|
|
dev_for_path( "/boot" ), true,
|
|
@@ -348,7 +350,7 @@
|
|
|
|
if( !path )
|
|
{
|
|
-#if defined( __BEOS__ ) || defined( WIN32 )
|
|
+#if defined( __BEOS__ ) || defined(__HAIKU__) || defined( WIN32 )
|
|
path = tr_buildPath( getOldConfigDir( ), "Cache", NULL );
|
|
#elif defined( SYS_DARWIN )
|
|
path = tr_buildPath( getHomeDir( ), "Library", "Caches", "Transmission", NULL );
|
|
@@ -467,6 +469,9 @@
|
|
#ifdef SYS_DARWIN
|
|
s = tr_buildPath( getHomeDir( ), "Library",
|
|
"Application Support", "Transmission", NULL );
|
|
+#elif defined(__HAIKU__)
|
|
+ s = tr_buildPath( getHomeDir( ), "config",
|
|
+ "settings", "Transmission", NULL );
|
|
#elif defined( WIN32 )
|
|
char appdata[MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
|
|
SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
|
|
diff -Naur transmission-1.42-original/third-party/libevent/test/bench.c transmission-1.42/third-party/libevent/test/bench.c
|
|
--- transmission-1.42-original/third-party/libevent/test/bench.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libevent/test/bench.c 2009-01-10 18:56:45.000000000 +0000
|
|
@@ -44,7 +44,7 @@
|
|
#include <windows.h>
|
|
#else
|
|
#include <sys/socket.h>
|
|
-#include <sys/signal.h>
|
|
+#include <signal.h>
|
|
#include <sys/resource.h>
|
|
#endif
|
|
#include <fcntl.h>
|
|
diff -Naur transmission-1.42-original/third-party/libevent/test/regress.c transmission-1.42/third-party/libevent/test/regress.c
|
|
--- transmission-1.42-original/third-party/libevent/test/regress.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libevent/test/regress.c 2009-01-10 18:56:45.000000000 +0000
|
|
@@ -43,7 +43,7 @@
|
|
#ifndef WIN32
|
|
#include <sys/socket.h>
|
|
#include <sys/wait.h>
|
|
-#include <sys/signal.h>
|
|
+#include <signal.h>
|
|
#include <unistd.h>
|
|
#include <netdb.h>
|
|
#endif
|
|
diff -Naur transmission-1.42-original/third-party/libevent/test/regress_dns.c transmission-1.42/third-party/libevent/test/regress_dns.c
|
|
--- transmission-1.42-original/third-party/libevent/test/regress_dns.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libevent/test/regress_dns.c 2009-01-10 18:56:45.000000000 +0000
|
|
@@ -42,7 +42,7 @@
|
|
#include <sys/queue.h>
|
|
#ifndef WIN32
|
|
#include <sys/socket.h>
|
|
-#include <sys/signal.h>
|
|
+#include <signal.h>
|
|
#include <netinet/in.h>
|
|
#include <arpa/inet.h>
|
|
#include <unistd.h>
|
|
@@ -89,7 +89,7 @@
|
|
|
|
switch (type) {
|
|
case DNS_IPv6_AAAA: {
|
|
-#if defined(HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP)
|
|
+#if defined(HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
|
struct in6_addr *in6_addrs = addresses;
|
|
char buf[INET6_ADDRSTRLEN+1];
|
|
int i;
|
|
@@ -258,7 +258,7 @@
|
|
break;
|
|
}
|
|
case DNS_IPv6_AAAA: {
|
|
-#if defined (HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP)
|
|
+#if defined (HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
|
struct in6_addr *in6_addrs = addresses;
|
|
char buf[INET6_ADDRSTRLEN+1];
|
|
if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
|
|
diff -Naur transmission-1.42-original/third-party/libevent/test/regress_http.c transmission-1.42/third-party/libevent/test/regress_http.c
|
|
--- transmission-1.42-original/third-party/libevent/test/regress_http.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libevent/test/regress_http.c 2009-01-10 18:56:45.000000000 +0000
|
|
@@ -42,7 +42,7 @@
|
|
#include <sys/queue.h>
|
|
#ifndef WIN32
|
|
#include <sys/socket.h>
|
|
-#include <sys/signal.h>
|
|
+#include <signal.h>
|
|
#include <unistd.h>
|
|
#include <netdb.h>
|
|
#endif
|
|
diff -Naur transmission-1.42-original/third-party/libevent/test/regress_rpc.c transmission-1.42/third-party/libevent/test/regress_rpc.c
|
|
--- transmission-1.42-original/third-party/libevent/test/regress_rpc.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libevent/test/regress_rpc.c 2009-01-10 18:56:45.000000000 +0000
|
|
@@ -42,7 +42,7 @@
|
|
#include <sys/queue.h>
|
|
#ifndef WIN32
|
|
#include <sys/socket.h>
|
|
-#include <sys/signal.h>
|
|
+#include <signal.h>
|
|
#include <unistd.h>
|
|
#include <netdb.h>
|
|
#endif
|
|
diff -Naur transmission-1.42-original/third-party/libnatpmp/getgateway.c transmission-1.42/third-party/libnatpmp/getgateway.c
|
|
--- transmission-1.42-original/third-party/libnatpmp/getgateway.c 2009-01-10 18:03:59.000000000 +0000
|
|
+++ transmission-1.42/third-party/libnatpmp/getgateway.c 2009-01-10 19:34:17.000000000 +0000
|
|
@@ -37,6 +37,18 @@
|
|
#undef USE_SYSCTL_NET_ROUTE
|
|
#endif
|
|
|
|
+#ifdef __HAIKU__
|
|
+#undef USE_PROC_NET_ROUTE
|
|
+#undef USE_SOCKET_ROUTE
|
|
+#undef USE_SYSCTL_NET_ROUTE
|
|
+/* Note: 2009-jan-10
|
|
+ *
|
|
+ * Haiku uses a BSD-like network stack.
|
|
+ * However its network stack is not yet feature complete.
|
|
+ * So for now, a workaround is needed */
|
|
+#define USE_HAIKU_WORKAROUND
|
|
+#endif
|
|
+
|
|
#ifdef __APPLE__
|
|
#undef USE_PROC_NET_ROUTE
|
|
#undef USE_SOCKET_ROUTE
|
|
@@ -82,6 +94,14 @@
|
|
#define FAILED (-1)
|
|
#endif
|
|
|
|
+
|
|
+#ifdef USE_HAIKU_WORKAROUND
|
|
+int getdefaultgateway(in_addr_t * addr)
|
|
+{
|
|
+ return FAILED;
|
|
+}
|
|
+#endif
|
|
+
|
|
#ifdef USE_PROC_NET_ROUTE
|
|
int getdefaultgateway(in_addr_t * addr)
|
|
{
|