defines for building on Hurd and BSD kernels

This commit is contained in:
Alberto Luaces 2016-05-31 12:58:57 +01:00 committed by Robert Osfield
parent 37258df59c
commit 68baf15806
5 changed files with 14 additions and 4 deletions

View File

@ -33,7 +33,7 @@
#if defined(__linux)
#include <unistd.h>
#include <linux/sockios.h>
#elif defined(__FreeBSD__) || defined(__DragonFly__)
#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__FreeBSD_kernel__)
#include <unistd.h>
#include <sys/sockio.h>
#elif defined(__sgi)
@ -41,6 +41,8 @@
#include <net/soioctl.h>
#elif defined(__CYGWIN__)
#include <unistd.h>
#elif defined (__GNU__)
#include <unistd.h>
#elif defined(__sun)
#include <unistd.h>
#include <sys/sockio.h>
@ -338,7 +340,7 @@ void Receiver::sync( void )
}
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || \
defined(__DragonFly__)
defined(__DragonFly__) || defined(__FreeBSD_kernel__) || defined(__GNU__)
socklen_t
#else
int

View File

@ -45,6 +45,8 @@
#include <net/soioctl.h>
#elif defined(__CYGWIN__)
#include <unistd.h>
#elif defined (__GNU__)
#include <unistd.h>
#elif defined(__sun)
#include <unistd.h>
#include <sys/sockio.h>

View File

@ -122,7 +122,7 @@ void Receiver::sync( void )
return;
}
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ )
#if defined(__linux) || defined(__FreeBSD__) || defined( __APPLE__ ) || defined(__FreeBSD_kernel__) || defined(__GNU__)
socklen_t size;
#else
int size;

View File

@ -43,8 +43,10 @@
#endif
#if defined (__FreeBSD__) || defined (__APPLE__) || defined (__MACH__)
#include <sys/types.h>
#if !defined (__GNU__)
#include <sys/sysctl.h>
#endif
#endif
#if defined(__ANDROID__)
#ifndef PAGE_SIZE
@ -996,7 +998,7 @@ int Thread::microSleep(unsigned int microsec)
//
int OpenThreads::GetNumberOfProcessors()
{
#if defined(__linux__)
#if defined(__linux__) || defined(__GNU__)
long ret = sysconf(_SC_NPROCESSORS_ONLN);
if (ret == -1)
return 0;

View File

@ -30,6 +30,10 @@
using std::tolower;
#endif
#if defined(__GNU__) && !defined(PATH_MAX)
#define PATH_MAX 4096
#endif
using namespace std;
static const char * const PATH_SEPARATORS = "/\\";