libupnp: patch to build on Haiku

* this would need getifaddrs().
This commit is contained in:
Jerome Duval
2015-02-09 21:58:55 +00:00
parent 0edd73c47c
commit 49660c3a91
2 changed files with 50 additions and 0 deletions

View File

@@ -24,6 +24,8 @@ if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
fi
SECONDARY_ARCHITECTURES="x86"
PATCHES="libupnp-$portVersion.patchset"
PROVIDES="
libupnp$secondaryArchSuffix = $portVersion
lib:libupnp$secondaryArchSuffix = 6.3.3 compat >= 6

View File

@@ -0,0 +1,48 @@
From c56e47ea8692b5e679e4144b2017153e750ad381 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 9 Feb 2015 20:43:28 +0000
Subject: Haiku build fix
diff --git a/threadutil/src/ThreadPool.c b/threadutil/src/ThreadPool.c
index fcf7108..17715fc 100644
--- a/threadutil/src/ThreadPool.c
+++ b/threadutil/src/ThreadPool.c
@@ -419,7 +419,7 @@ static void SetSeed(void)
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id().p);
#elif defined(BSD) || defined(__OSX__) || defined(__APPLE__) || defined(__FreeBSD_kernel__)
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
-#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__)
+#elif defined(__linux__) || defined(__sun) || defined(__CYGWIN__) || defined(__GLIBC__) || defined(__HAIKU__)
srand((unsigned int)t.tv_usec + (unsigned int)ithread_get_current_thread_id());
#else
{
diff --git a/upnp/src/api/upnpapi.c b/upnp/src/api/upnpapi.c
index cbd7aea..3429f59 100644
--- a/upnp/src/api/upnpapi.c
+++ b/upnp/src/api/upnpapi.c
@@ -3438,6 +3438,10 @@ int UpnpGetIfInfo(const char *IfName)
inet_ntop(AF_INET, &v4_addr, gIF_IPV4, sizeof(gIF_IPV4));
inet_ntop(AF_INET6, &v6_addr, gIF_IPV6, sizeof(gIF_IPV6));
gIF_INDEX = if_nametoindex(gIF_NAME);
+#elif defined(__HAIKU__)
+ UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
+ "failed to find list of addresses\n");
+ return UPNP_E_INIT;
#else
char szBuffer[MAX_INTERFACES * sizeof(struct ifreq)];
struct ifconf ifConf;
@@ -3900,6 +3904,10 @@ int getlocalhostname(char *out, size_t out_len)
freeifaddrs(ifap);
ret = ifa ? UPNP_E_SUCCESS : UPNP_E_INIT;
+#elif defined(__HAIKU__)
+ UpnpPrintf(UPNP_CRITICAL, API, __FILE__, __LINE__,
+ "failed to find list of addresses\n");
+ return UPNP_E_INIT;
#else
char szBuffer[MAX_INTERFACES * sizeof (struct ifreq)];
struct ifconf ifConf;
--
1.8.3.4