Haiku support.

This commit is contained in:
David Carlier 2020-07-28 19:03:50 +00:00
parent 8a98e3d186
commit 191124ddb7
5 changed files with 11 additions and 3 deletions

View File

@ -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()

View File

@ -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) {

View File

@ -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

View File

@ -22,7 +22,7 @@
#include <memory>
#include <regex>
#if !defined(__APPLE__) && (__unix || __unix__)
#if (!defined(__APPLE__) && (__unix || __unix__)) || defined(__HAIKU__)
#include <sys/stat.h>
#include <sys/types.h>
#endif

View File

@ -659,6 +659,8 @@ namespace spades {
return "FreeBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(__HAIKU__)
return "Haiku";
#else
return std::string{};
#endif