Haiku build fix
This commit is contained in:
parent
2fbfbd8eac
commit
4f46402afb
|
@ -67,13 +67,13 @@ struct sockaddr_un {
|
||||||
#define PRINT_SOCKET_ERROR(x) perror(x)
|
#define PRINT_SOCKET_ERROR(x) perror(x)
|
||||||
#endif
|
#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
|
#define HAS_IP_MREQN
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
|
#if !defined(HAS_IP_MREQN) && !defined(_WIN32)
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#if defined(__sun)
|
#if defined(__sun) || defined(__HAIKU__)
|
||||||
#include <sys/sockio.h>
|
#include <sys/sockio.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -31,7 +31,7 @@ static const struct {
|
||||||
|
|
||||||
/* Helper function */
|
/* Helper function */
|
||||||
static UNSIGNED_INTEGER
|
static UNSIGNED_INTEGER
|
||||||
atoui(const char * p, int l)
|
my_atoui(const char * p, int l)
|
||||||
{
|
{
|
||||||
UNSIGNED_INTEGER r = 0;
|
UNSIGNED_INTEGER r = 0;
|
||||||
while(l > 0 && *p)
|
while(l > 0 && *p)
|
||||||
|
@ -106,7 +106,7 @@ static void portlisting_data(void * d, const char * data, int l)
|
||||||
pm->remoteHost[l] = '\0';
|
pm->remoteHost[l] = '\0';
|
||||||
break;
|
break;
|
||||||
case NewExternalPort:
|
case NewExternalPort:
|
||||||
pm->externalPort = (unsigned short)atoui(data, l);
|
pm->externalPort = (unsigned short)my_atoui(data, l);
|
||||||
break;
|
break;
|
||||||
case NewProtocol:
|
case NewProtocol:
|
||||||
if(l > 3)
|
if(l > 3)
|
||||||
|
@ -115,21 +115,21 @@ static void portlisting_data(void * d, const char * data, int l)
|
||||||
pm->protocol[l] = '\0';
|
pm->protocol[l] = '\0';
|
||||||
break;
|
break;
|
||||||
case NewInternalPort:
|
case NewInternalPort:
|
||||||
pm->internalPort = (unsigned short)atoui(data, l);
|
pm->internalPort = (unsigned short)my_atoui(data, l);
|
||||||
break;
|
break;
|
||||||
case NewInternalClient:
|
case NewInternalClient:
|
||||||
memcpy(pm->internalClient, data, l);
|
memcpy(pm->internalClient, data, l);
|
||||||
pm->internalClient[l] = '\0';
|
pm->internalClient[l] = '\0';
|
||||||
break;
|
break;
|
||||||
case NewEnabled:
|
case NewEnabled:
|
||||||
pm->enabled = (unsigned char)atoui(data, l);
|
pm->enabled = (unsigned char)my_atoui(data, l);
|
||||||
break;
|
break;
|
||||||
case NewDescription:
|
case NewDescription:
|
||||||
memcpy(pm->description, data, l);
|
memcpy(pm->description, data, l);
|
||||||
pm->description[l] = '\0';
|
pm->description[l] = '\0';
|
||||||
break;
|
break;
|
||||||
case NewLeaseTime:
|
case NewLeaseTime:
|
||||||
pm->leaseTime = atoui(data, l);
|
pm->leaseTime = my_atoui(data, l);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -29,6 +29,7 @@ elif [ "$OS" = 'Haiku' ]; then
|
||||||
CLIB=-lroot
|
CLIB=-lroot
|
||||||
PTHREADLIB=-lroot
|
PTHREADLIB=-lroot
|
||||||
SOCKETLIB=-lnetwork
|
SOCKETLIB=-lnetwork
|
||||||
|
CFLAGS="$CFLAGS -D_BSD_SOURCE"
|
||||||
elif [ "$OS" = 'Win32' ]; then
|
elif [ "$OS" = 'Win32' ]; then
|
||||||
SOCKETLIB=-lws2_32
|
SOCKETLIB=-lws2_32
|
||||||
SOCKETHEADER="#include <winsock2.h>"
|
SOCKETHEADER="#include <winsock2.h>"
|
||||||
|
|
Loading…
Reference in New Issue