From b5923cc7d6a06a08421e439e4c5de353ae2bcd77 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Tue, 7 Jan 2014 23:02:10 +0100
Subject: Link to libnetwork, since we use sockets.


diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt
index 2110879..d1fed38 100644
--- a/server/CMakeLists.txt
+++ b/server/CMakeLists.txt
@@ -19,6 +19,10 @@ endif()
 
 target_link_libraries(vcmiserver vcmi ${Boost_LIBRARIES} ${RT_LIB} ${DL_LIB})
 
+if (HAIKU)
+	target_link_libraries(vcmiserver network)
+endif()
+
 if (NOT APPLE) # Already inside vcmiclient bundle
     install(TARGETS vcmiserver DESTINATION ${BIN_DIR})
 endif()
-- 
1.8.3.4


From 8f2e997081b524b6f97a124df1abed2ec18b23a7 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Wed, 8 Jan 2014 21:14:51 +0100
Subject: Support for renaming threads.


diff --git a/lib/CThreadHelper.cpp b/lib/CThreadHelper.cpp
index 3774c4b..b0aca56 100644
--- a/lib/CThreadHelper.cpp
+++ b/lib/CThreadHelper.cpp
@@ -3,6 +3,8 @@
 
 #ifdef _WIN32
 	#include <windows.h>
+#elif defined(__HAIKU__)
+	#include <OS.h>
 #elif !defined(__APPLE__)
 	#include <sys/prctl.h>
 #endif
@@ -80,6 +82,8 @@ void setThreadName(const std::string &name)
 //not supported
 #endif
 
+#elif defined(__HAIKU__)
+	rename_thread(find_thread(NULL), name.c_str());
 #elif defined(__linux__)
 	prctl(PR_SET_NAME, name.c_str(), 0, 0, 0);
 #endif
-- 
1.8.3.4

