summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/network/CMakeLists.txt5
-rw-r--r--src/porting.cpp10
-rw-r--r--src/porting.h2
-rw-r--r--src/threading/thread.cpp4
-rw-r--r--src/threading/thread.h4
6 files changed, 24 insertions, 5 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3d6d1b0ea..7e1d0bd39 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -351,6 +351,10 @@ else()
if (ICONV_LIBRARY)
set(PLATFORM_LIBS ${PLATFORM_LIBS} ${ICONV_LIBRARY})
endif()
+ if (HAIKU)
+ set(PLATFORM_LIBS ${PLATFORM_LIBS} intl network)
+ endif()
+
endif()
check_include_files(endian.h HAVE_ENDIAN_H)
diff --git a/src/network/CMakeLists.txt b/src/network/CMakeLists.txt
index c6995ab22..d2e2f52e9 100644
--- a/src/network/CMakeLists.txt
+++ b/src/network/CMakeLists.txt
@@ -16,8 +16,3 @@ if (BUILD_CLIENT)
PARENT_SCOPE
)
endif()
-
-# Haiku networking support
-if(HAIKU)
- set(PLATFORM_LIBS -lnetwork ${PLATFORM_LIBS})
-endif()
diff --git a/src/porting.cpp b/src/porting.cpp
index b3c8cae99..e7ed4e090 100644
--- a/src/porting.cpp
+++ b/src/porting.cpp
@@ -56,6 +56,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <crt_externs.h>
#endif
+#if defined(__HAIKU__)
+ #include <FindDirectory.h>
+#endif
+
#include "config.h"
#include "debug.h"
#include "filesys.h"
@@ -321,6 +325,12 @@ bool getCurrentExecPath(char *buf, size_t len)
return true;
}
+#elif defined(__HAIKU__)
+
+bool getCurrentExecPath(char *buf, size_t len)
+{
+ return find_path(B_APP_IMAGE_SYMBOL, B_FIND_PATH_IMAGE_PATH, NULL, buf, len) == B_OK;
+}
//// Solaris
#elif defined(__sun) || defined(sun)
diff --git a/src/porting.h b/src/porting.h
index f50f0a950..c7adf12a2 100644
--- a/src/porting.h
+++ b/src/porting.h
@@ -309,6 +309,8 @@ inline const char *getPlatformName()
#else
"SunOS"
#endif
+#elif defined(__HAIKU__)
+ "Haiku"
#elif defined(__CYGWIN__)
"Cygwin"
#elif defined(__unix__) || defined(__unix)
diff --git a/src/threading/thread.cpp b/src/threading/thread.cpp
index e0f808c4d..f678a09be 100644
--- a/src/threading/thread.cpp
+++ b/src/threading/thread.cpp
@@ -225,6 +225,10 @@ void Thread::setName(const std::string &name)
pthread_setname_np(name.c_str());
+#elif defined(__HAIKU__)
+
+ rename_thread(find_thread(NULL), name.c_str());
+
#elif defined(_MSC_VER)
// Windows itself doesn't support thread names,
diff --git a/src/threading/thread.h b/src/threading/thread.h
index cea92226f..3946335f5 100644
--- a/src/threading/thread.h
+++ b/src/threading/thread.h
@@ -36,6 +36,10 @@ DEALINGS IN THE SOFTWARE.
#include <sys/thread.h> // for tid_t
#endif
+#ifdef __HAIKU__
+ #include <kernel/OS.h>
+#endif
+
/*
* On platforms using pthreads, these five priority classes correlate to
* even divisions between the minimum and maximum reported thread priority.