Skip to content

Commit

Permalink
Haiku support.
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen committed Jul 28, 2020
1 parent 8a98e3d commit 191124d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
6 changes: 5 additions & 1 deletion Sources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion Sources/Core/ShellApi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 2 additions & 0 deletions Sources/Core/VersionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Sources/Gui/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Sources/Gui/StartupScreenHelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -659,6 +659,8 @@ namespace spades {
return "FreeBSD";
#elif defined(__OpenBSD__)
return "OpenBSD";
#elif defined(__HAIKU__)
return "Haiku";
#else
return std::string{};
#endif
Expand Down

0 comments on commit 191124d

Please sign in to comment.