Merge of Mac OS X patch from Stéphane Corthésy (davelopper),

SF Bug Tracker [ 1686420 ] Modifications for MacOSX.
Some of the proposed changes were already done by Rene Hexel's patch.


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@213 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez
2007-08-06 02:07:41 +00:00
parent 491f5ffef6
commit 67b51187b9
9 changed files with 130 additions and 115 deletions

View File

@@ -31,7 +31,7 @@
#include "LinkedList.h"
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306)
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
#include <stdlib.h>
#else
#include <malloc.h>

View File

@@ -90,22 +90,23 @@ FreeThreadPoolJob( ThreadPool * tp,
static int
SetPolicyType( PolicyType in )
{
#ifdef __CYGWIN__
/* TODO not currently working... */
return 0;
#else
#ifdef WIN32
#ifdef __CYGWIN__
/* TODO not currently working... */
return 0;
#elif defined(__OSX__)
setpriority(PRIO_PROCESS, 0, 0);
return 0;
#elif defined(WIN32)
return sched_setscheduler( 0, in);
#elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
#elif defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
struct sched_param current;
sched_getparam( 0, &current );
current.sched_priority = DEFAULT_SCHED_PARAM;
return sched_setscheduler( 0, in, &current );
#else
#else
return 0;
#endif
#endif
#endif
}
/****************************************************************************
@@ -364,7 +365,7 @@ static void SetSeed() {
ftime( &t );
#if defined(WIN32)
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id().p );
#elif defined(__FreeBSD__)
#elif defined(__FreeBSD__) || defined(__OSX__)
srand( ( unsigned int )t.millitm + (unsigned int)ithread_get_current_thread_id() );
#elif defined(__linux__)
srand( ( unsigned int )t.millitm + ithread_get_current_thread_id() );

View File

@@ -32,7 +32,7 @@
#include <stdarg.h>
#include <assert.h>
#include <sys/param.h>
#if (defined(BSD) && BSD >= 199306)
#if (defined(BSD) && BSD >= 199306) || defined(__OSX__)
#include <stdlib.h>
#else
#include <malloc.h>