Fish patch for networking

This commit is contained in:
miqlas
2015-09-17 18:01:17 +00:00
parent 67f111e726
commit 56269ce02b
2 changed files with 6 additions and 70 deletions

View File

@@ -18,10 +18,7 @@ PROVIDES="
fish$secondaryArchSuffix = $portVersion
cmd:fish$secondaryArchSuffix = $portVersion
cmd:fish_indent$secondaryArchSuffix = $portVersion
cmd:fish_pager$secondaryArchSuffix = $portVersion
cmd:fishd$secondaryArchSuffix = $portVersion
cmd:mimedb$secondaryArchSuffix = $portVersion
cmd:set_color$secondaryArchSuffix = $portVersion
"
REQUIRES="
haiku$secondaryArchSuffix

View File

@@ -1,8 +1,8 @@
diff --git a/configure.ac b/configure.ac
index 49ff391..7404001 100644
index 49ff391..7d22bf9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -100,6 +100,19 @@ echo "CXXFLAGS: $CXXFLAGS"
@@ -100,6 +100,18 @@ echo "CXXFLAGS: $CXXFLAGS"
#
AC_CONFIG_HEADERS(config.h)
@@ -18,11 +18,10 @@ index 49ff391..7404001 100644
+[Define to be a string corresponding the vendor of the machine.])
+AC_DEFINE_UNQUOTED(OSTYPE, "$host_os",
+[Define to be the name of the operating system.])
+
#
# This adds markup to the code that results in a few extra compile
@@ -210,9 +223,15 @@ CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare"
@@ -210,9 +222,16 @@ CXXFLAGS="$CXXFLAGS -Wall -Wno-sign-compare"
# This is needed in order to get the really cool backtraces on Linux
#
@@ -33,6 +32,7 @@ index 49ff391..7404001 100644
+ darwin* )
+ ;;
+ haiku*)
+ CFLAGS="$CFLAGS -D_BSD_SOURCE" CPPFLAGS="$CPPFLAGS -D_BSD_SOURCE" CXXFLAGS="$CXXFLAGS -D_BSD_SOURCE"
+ ;;
+ *)
+ LDFLAGS_FISH="$LDFLAGS_FISH -rdynamic"
@@ -51,39 +51,10 @@ index 49ff391..7404001 100644
AC_SEARCH_LIBS( shm_open, rt, , [AC_MSG_ERROR([Cannot find the rt library, needed to build this package.] )] )
AC_SEARCH_LIBS( pthread_create, pthread, , [AC_MSG_ERROR([Cannot find the pthread library, needed to build this package.] )] )
diff --git a/env_universal_common.cpp b/env_universal_common.cpp
index b493de2..0b9c8c9 100644
index b493de2..8e8046b 100644
--- a/env_universal_common.cpp
+++ b/env_universal_common.cpp
@@ -36,6 +36,10 @@
#include <notify.h>
#endif
+#ifdef __HAIKU__
+#include <ifaddrs.h>
+#endif
+
// NAME_MAX is not defined on Solaris and suggests the use of pathconf()
// There is no obvious sensible pathconf() for shared memory and _XPG_NAME_MAX
// seems a reasonable choice.
@@ -982,7 +986,7 @@ void env_universal_t::parse_message_internal(const wcstring &msgstr, var_table_t
/* Thanks to Jan Brittenson
http://lists.apple.com/archives/xcode-users/2009/May/msg00062.html
*/
-#ifdef SIOCGIFHWADDR
+#if defined (SIOCGIFHWADDR) && ! defined (__HAIKU__)
/* Linux */
#include <net/if.h>
@@ -1005,7 +1009,7 @@ static bool get_mac_address(unsigned char macaddr[MAC_ADDRESS_MAX_LEN], const ch
return result;
}
-#elif defined(HAVE_GETIFADDRS)
+#elif defined(HAVE_GETIFADDRS) && ! defined (__HAIKU__)
/* OS X and BSD */
#include <ifaddrs.h>
@@ -1102,6 +1106,10 @@ class universal_notifier_shmem_poller_t : public universal_notifier_t
@@ -1102,6 +1102,10 @@ class universal_notifier_shmem_poller_t : public universal_notifier_t
#define SHMEM_MAGIC_NUMBER 0xF154
#define SHMEM_VERSION_CURRENT 1000
@@ -94,35 +65,3 @@ index b493de2..0b9c8c9 100644
private:
long long last_change_time;
uint32_t last_seed;
diff --git a/intern.cpp b/intern.cpp
index 56dec21..cc8a299 100644
--- a/intern.cpp
+++ b/intern.cpp
@@ -20,6 +20,10 @@
#include "common.h"
#include "intern.h"
+#ifdef __HAIKU__
+#include <posix/pthread.h>
+#endif
+
/** Comparison function for intern'd strings */
class string_table_compare_t
{
diff --git a/iothread.cpp b/iothread.cpp
index 1fcd137..f621f8c 100644
--- a/iothread.cpp
+++ b/iothread.cpp
@@ -12,6 +12,12 @@
#include <fcntl.h>
#include <queue>
+#ifdef __HAIKU__
+#include <posix/pthread.h>
+#include <sys/types.h>
+#include <sys/select.h>
+#endif
+
#ifdef _POSIX_THREAD_THREADS_MAX
#if _POSIX_THREAD_THREADS_MAX < 64
#define IO_MAX_THREADS _POSIX_THREAD_THREADS_MAX