From 191124ddb7ffa62e1e825156c5c85d67b582fc66 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Tue, 28 Jul 2020 19:03:50 +0000 Subject: [PATCH] Haiku support. --- Sources/CMakeLists.txt | 6 +++++- Sources/Core/ShellApi.cpp | 2 +- Sources/Core/VersionInfo.cpp | 2 ++ Sources/Gui/Main.cpp | 2 +- Sources/Gui/StartupScreenHelper.cpp | 2 ++ 5 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Sources/CMakeLists.txt b/Sources/CMakeLists.txt index ef0b9b36..558b56e3 100644 --- a/Sources/CMakeLists.txt +++ b/Sources/CMakeLists.txt @@ -117,7 +117,11 @@ endif() if(UNIX) if(NOT(CMAKE_SYSTEM_NAME MATCHES "BSD" OR APPLE)) - target_link_libraries(OpenSpades rt) + if (NOT CMAKE_SYSTEM_NAME MATCHES "Haiku") + target_link_libraries(OpenSpades rt) + else() + target_link_libraries(OpenSpades network) + endif() endif() target_link_libraries(OpenSpades pthread) endif() diff --git a/Sources/Core/ShellApi.cpp b/Sources/Core/ShellApi.cpp index 24d76bdc..17438d11 100644 --- a/Sources/Core/ShellApi.cpp +++ b/Sources/Core/ShellApi.cpp @@ -89,7 +89,7 @@ namespace spades { return false; } } -#elif __unix || __unix__ +#elif (__unix || __unix__) || defined(__HAIKU__) bool ShowDirectoryInShell(const std::string &directoryPath) { // FIXME: escape single quotes if (directoryPath.find("'") != std::string::npos) { diff --git a/Sources/Core/VersionInfo.cpp b/Sources/Core/VersionInfo.cpp index b35f43f5..81636dd6 100644 --- a/Sources/Core/VersionInfo.cpp +++ b/Sources/Core/VersionInfo.cpp @@ -48,6 +48,8 @@ std::string VersionInfo::GetVersionInfo() { return std::string("OpenBSD"); #elif defined(__NetBSD__) return std::string("NetBSD"); +#elif defined(__HAIKU__) + return std::string("Haiku"); #else return std::string("Unknown OS"); #endif diff --git a/Sources/Gui/Main.cpp b/Sources/Gui/Main.cpp index f4a474ea..a71c2776 100644 --- a/Sources/Gui/Main.cpp +++ b/Sources/Gui/Main.cpp @@ -22,7 +22,7 @@ #include #include -#if !defined(__APPLE__) && (__unix || __unix__) +#if (!defined(__APPLE__) && (__unix || __unix__)) || defined(__HAIKU__) #include #include #endif diff --git a/Sources/Gui/StartupScreenHelper.cpp b/Sources/Gui/StartupScreenHelper.cpp index a85915a1..f6b90ce9 100644 --- a/Sources/Gui/StartupScreenHelper.cpp +++ b/Sources/Gui/StartupScreenHelper.cpp @@ -659,6 +659,8 @@ namespace spades { return "FreeBSD"; #elif defined(__OpenBSD__) return "OpenBSD"; +#elif defined(__HAIKU__) + return "Haiku"; #else return std::string{}; #endif