Add Haiku support

This commit is contained in:
Sergei Reznikov 2015-10-20 19:41:40 +03:00
parent febea809b1
commit 34758be52a
14 changed files with 80 additions and 4 deletions

View file

@ -314,6 +314,19 @@ openbsd-* {
CONFIG += upnp_libupnp
}
################################# Haiku ##########################################
haiku-* {
QMAKE_CXXFLAGS *= -Dfseeko64=fseeko -Dftello64=ftello -Dstat64=stat -Dstatvfs64=statvfs -Dfopen64=fopen
OPENPGPSDK_DIR = ../../openpgpsdk/src
INCLUDEPATH *= $${OPENPGPSDK_DIR} ../openpgpsdk
DEFINES *= NO_SQLCIPHER
CONFIG += release
CONFIG += upnp_libupnp
DESTDIR = lib
}
################################### COMMON stuff ##################################
# openpgpsdk

View file

@ -55,6 +55,11 @@ int errno;
#endif
#ifdef __HAIKU__
#include <sys/sockio.h>
#define IFF_RUNNING 0x0001
#endif
/********************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef WINDOWS_SYS

View file

@ -38,6 +38,7 @@
#include <arpa/inet.h>
#include <sys/poll.h>
#include <errno.h>
//socket blocking/options.
#include <fcntl.h>

View file

@ -117,6 +117,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
std::cerr << "RsTryAutoLogin()" << std::endl;
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__
#ifndef WINDOWS_SYS /* UNIX */
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__)
@ -348,6 +349,7 @@ bool RsLoginHandler::tryAutoLogin(const RsPeerId& ssl_id,std::string& ssl_passwd
LocalFree(DataOut.pbData);
return isDecrypt;
#endif
#endif
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
@ -360,6 +362,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
std::cerr << "RsStoreAutoLogin()" << std::endl;
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
#ifndef __HAIKU__
#ifndef WINDOWS_SYS /* UNIX */
#if defined(UBUNTU) || defined(__FreeBSD__) || defined(__OpenBSD__)
if(GNOME_KEYRING_RESULT_OK == gnome_keyring_store_password_sync(&my_schema, NULL, (gchar*)("RetroShare password for SSL Id "+ssl_id.toStdString()).c_str(),(gchar*)ssl_passwd.c_str(),"RetroShare SSL Id",ssl_id.toStdString().c_str(),NULL))
@ -518,6 +521,7 @@ bool RsLoginHandler::enableAutoLogin(const RsPeerId& ssl_id,const std::string& s
/******************************** WINDOWS/UNIX SPECIFIC PART ******************/
return false;
#endif
}
bool RsLoginHandler::clearAutoLogin(const RsPeerId& ssl_id)

View file

@ -35,6 +35,7 @@ static const int kInitStreamTable = 5;
#include <time.h>
#include "udp/udpstack.h"
#include "pqi/pqinetwork.h"
#include "tcpstream.h"
#include <vector>
#include <iostream>
@ -42,6 +43,7 @@ static const int kInitStreamTable = 5;
#include <errno.h>
#define DEBUG_TOU_INTERFACE 1
#define EUSERS 87
struct TcpOnUdp_t
{

View file

@ -27,7 +27,7 @@
// Includes for directory creation.
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/fcntl.h>
#include <fcntl.h>
#include <unistd.h>
#include "util/rsdir.h"

View file

@ -75,7 +75,7 @@ void sockaddr_clear(struct sockaddr_in *addr)
bool rsGetHostByName(const std::string& hostname, in_addr& returned_addr)
{
#if defined(WINDOWS_SYS) || defined(__APPLE__)
#if defined(WINDOWS_SYS) || defined(__APPLE__) || defined(__HAIKU__)
hostent *result = gethostbyname(hostname.c_str()) ;
#else
RsTemporaryMemory mem(8192) ;