Skip to content

Commit

Permalink
defines for building on Hurd and BSD kernels
Browse files Browse the repository at this point in the history
  • Loading branch information
aluaces authored and robertosfield committed May 31, 2016
1 parent 37258df commit 68baf15
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
6 changes: 4 additions & 2 deletions applications/present3D/Cluster.cpp
Expand Up @@ -33,14 +33,16 @@
#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)
#include <unistd.h>
#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>
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions examples/osgcluster/broadcaster.cpp
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion examples/osgcluster/receiver.cpp
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion src/OpenThreads/pthreads/PThread.cpp
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions src/osgDB/FileNameUtils.cpp
Expand Up @@ -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 = "/\\";
Expand Down

0 comments on commit 68baf15

Please sign in to comment.