More fixes to Mac OS X and NetBSD from Rene Hexel:

[pupnp-devel] NetBSD & Mac OS X packages and patches
   Okay, I found a couple more things.  I have attached a patch file
against the trunk (version 206) that make the repository code compile
and run on both Mac OS X and NetBSD.

  This fixes the following issues:

  upnp/src/api/upnpapi.c: SIOCGIFCONF didn't work properly, use
getifaddrs() instead (on BSD systems).

  threadutil/src/ThreadPool.c: priorities only work if
_POSIX_PRIORITY_SCHEDULING is defined (and greater than 0).

  threadutil/src/LinkedList.c and threadutil/src/iasnprintf.c: use
stdlib.h instead of malloc.h on all BSD systems (not just FreeBSD).
This is important, because malloc.h does not exist on Darwin/Mac OS X.

  Cheers
      ,
   Rene


git-svn-id: https://pupnp.svn.sourceforge.net/svnroot/pupnp/trunk@207 119443c7-1b9e-41f8-b6fc-b9c35fce742c
This commit is contained in:
Marcelo Roberto Jimenez
2007-06-10 03:54:30 +00:00
parent 837f31bacd
commit 6acffb7ede
4 changed files with 54 additions and 6 deletions

View File

@@ -96,12 +96,14 @@ SetPolicyType( PolicyType in )
#else
#ifdef WIN32
return sched_setscheduler( 0, in);
#else
#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
return 0;
#endif
#endif
}
@@ -123,7 +125,7 @@ SetPolicyType( PolicyType in )
static int
SetPriority( ThreadPriority priority )
{
#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
int currentPolicy;
int minPriority = 0;
int maxPriority = 0;
@@ -155,7 +157,9 @@ SetPriority( ThreadPriority priority )
return pthread_setschedparam( ithread_self(), currentPolicy,
&newPriority );
#else
return 0;
#endif
}
/****************************************************************************