From 4e07a2dea8c94337702d35d0d02d4b7234f86e29 Mon Sep 17 00:00:00 2001 From: Kostadin Damyanov Date: Mon, 25 May 2015 03:49:24 +0300 Subject: Haiku: fix building with UNIX_ENABLED. --- drivers/unix/packet_peer_udp_posix.cpp | 6 +++++- drivers/unix/stream_peer_tcp_posix.cpp | 9 +++++++-- drivers/unix/tcp_server_posix.cpp | 6 +++++- platform/haiku/detect.py | 6 ++++-- platform/haiku/os_haiku.cpp | 5 +++++ 5 files changed, 26 insertions(+), 6 deletions(-) diff --git a/drivers/unix/packet_peer_udp_posix.cpp b/drivers/unix/packet_peer_udp_posix.cpp index 26a0b29228..94b4c35923 100644 --- a/drivers/unix/packet_peer_udp_posix.cpp +++ b/drivers/unix/packet_peer_udp_posix.cpp @@ -13,7 +13,11 @@ #include #ifndef NO_FCNTL -#include + #ifdef __HAIKU__ + #include + #else + #include + #endif #else #include #endif diff --git a/drivers/unix/stream_peer_tcp_posix.cpp b/drivers/unix/stream_peer_tcp_posix.cpp index 2301d8b6c4..2db7d9f6ec 100644 --- a/drivers/unix/stream_peer_tcp_posix.cpp +++ b/drivers/unix/stream_peer_tcp_posix.cpp @@ -39,7 +39,11 @@ #include #include #ifndef NO_FCNTL -#include + #ifdef __HAIKU__ + #include + #else + #include + #endif #else #include #endif @@ -202,7 +206,8 @@ Error StreamPeerTCPPosix::write(const uint8_t* p_data,int p_bytes, int &r_sent, while (data_to_send) { - int sent_amount = send(sockfd, offset, data_to_send, MSG_NOSIGNAL); + // TODO: handle MSG_NOSIGNAL on __HAIKU__ + int sent_amount = send(sockfd, offset, data_to_send, 0); //printf("Sent TCP data of %d bytes, errno %d\n", sent_amount, errno); if (sent_amount == -1) { diff --git a/drivers/unix/tcp_server_posix.cpp b/drivers/unix/tcp_server_posix.cpp index 4f9ee62cde..aaca0fe0d8 100644 --- a/drivers/unix/tcp_server_posix.cpp +++ b/drivers/unix/tcp_server_posix.cpp @@ -41,7 +41,11 @@ #include #include #ifndef NO_FCNTL -#include + #ifdef __HAIKU__ + #include + #else + #include + #endif #else #include #endif diff --git a/platform/haiku/detect.py b/platform/haiku/detect.py index 992c73ee79..5dad2af033 100644 --- a/platform/haiku/detect.py +++ b/platform/haiku/detect.py @@ -34,9 +34,11 @@ def configure(env): env["bits"]="32" env.Append(CPPPATH = ['#platform/haiku']) + + # TODO: add clang and try gcc2 too env["CC"] = "gcc-x86" env["CXX"] = "g++-x86" - env.Append(CPPFLAGS = ['-DDEBUG_METHODS_ENABLED']) + env.Append(CPPFLAGS = ['-DDEBUG_METHODS_ENABLED']) env.Append(CPPFLAGS = ['-DUNIX_ENABLED']) - #env.Append(LIBS = ['be']) + env.Append(LIBS = ['be']) diff --git a/platform/haiku/os_haiku.cpp b/platform/haiku/os_haiku.cpp index e69de29bb2..8841306b7a 100644 --- a/platform/haiku/os_haiku.cpp +++ b/platform/haiku/os_haiku.cpp @@ -0,0 +1,5 @@ +#include "os_haiku.h" + +String OS_Haiku::get_name() { + return "Haiku"; +} -- cgit v1.2.3