Haiku build fix

This commit is contained in:
Zoltán Mizsei 2017-11-27 22:22:49 +01:00
parent 2fbfbd8eac
commit 4f46402afb
3 changed files with 8 additions and 7 deletions

View File

@ -67,13 +67,13 @@ struct sockaddr_un {
#define PRINT_SOCKET_ERROR(x) perror(x)
#endif
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__)
#if !defined(__DragonFly__) && !defined(__OpenBSD__) && !defined(__NetBSD__) && !defined(__APPLE__) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(__sun) && !defined(__GNU__) && !defined(__FreeBSD_kernel__) && !defined(__HAIKU__)
#define HAS_IP_MREQN
#endif
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
#include <sys/ioctl.h>
#if defined(__sun)
#if defined(__sun) || defined(__HAIKU__)
#include <sys/sockio.h>
#endif
#endif

View File

@ -31,7 +31,7 @@ static const struct {
/* Helper function */
static UNSIGNED_INTEGER
atoui(const char * p, int l)
my_atoui(const char * p, int l)
{
UNSIGNED_INTEGER r = 0;
while(l > 0 && *p)
@ -106,7 +106,7 @@ static void portlisting_data(void * d, const char * data, int l)
pm->remoteHost[l] = '\0';
break;
case NewExternalPort:
pm->externalPort = (unsigned short)atoui(data, l);
pm->externalPort = (unsigned short)my_atoui(data, l);
break;
case NewProtocol:
if(l > 3)
@ -115,21 +115,21 @@ static void portlisting_data(void * d, const char * data, int l)
pm->protocol[l] = '\0';
break;
case NewInternalPort:
pm->internalPort = (unsigned short)atoui(data, l);
pm->internalPort = (unsigned short)my_atoui(data, l);
break;
case NewInternalClient:
memcpy(pm->internalClient, data, l);
pm->internalClient[l] = '\0';
break;
case NewEnabled:
pm->enabled = (unsigned char)atoui(data, l);
pm->enabled = (unsigned char)my_atoui(data, l);
break;
case NewDescription:
memcpy(pm->description, data, l);
pm->description[l] = '\0';
break;
case NewLeaseTime:
pm->leaseTime = atoui(data, l);
pm->leaseTime = my_atoui(data, l);
break;
default:
break;

View File

@ -29,6 +29,7 @@ elif [ "$OS" = 'Haiku' ]; then
CLIB=-lroot
PTHREADLIB=-lroot
SOCKETLIB=-lnetwork
CFLAGS="$CFLAGS -D_BSD_SOURCE"
elif [ "$OS" = 'Win32' ]; then
SOCKETLIB=-lws2_32
SOCKETHEADER="#include <winsock2.h>"