Fixes for compilation under Windows (specifically MSVC). Also added MSVC supported "_inline", and fixed some WIN32 specific warnings.
This commit is contained in:

committed by
Marcelo Roberto Jimenez

parent
fed316ff3e
commit
92ea719804
@@ -922,7 +922,8 @@ static UPNP_INLINE int ithread_cleanup_thread(void) {
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(PTHREAD_MUTEX_RECURSIVE) && !defined(__DragonFly__)
|
||||
#if !defined(PTHREAD_MUTEX_RECURSIVE) && !defined(__DragonFly__) && !defined(UPNP_USE_MSVCPP)
|
||||
/* !defined(UPNP_USE_MSVCPP) should probably also have pthreads version check - but it's not clear if that is possible */
|
||||
/* NK: Added for satisfying the gcc compiler */
|
||||
EXPORT_SPEC int pthread_mutexattr_setkind_np(pthread_mutexattr_t *attr, int kind);
|
||||
#endif
|
||||
|
@@ -292,8 +292,8 @@ static int SetPriority(
|
||||
/*! . */
|
||||
ThreadPriority priority)
|
||||
{
|
||||
int retVal = 0;
|
||||
#if defined(_POSIX_PRIORITY_SCHEDULING) && _POSIX_PRIORITY_SCHEDULING > 0
|
||||
int retVal = 0;
|
||||
int currentPolicy;
|
||||
int minPriority = 0;
|
||||
int maxPriority = 0;
|
||||
@@ -325,11 +325,12 @@ static int SetPriority(
|
||||
|
||||
sched_result = pthread_setschedparam(ithread_self(), currentPolicy, &newPriority);
|
||||
retVal = (sched_result == 0 || errno == EPERM) ? 0 : sched_result;
|
||||
#else
|
||||
retVal = 0;
|
||||
#endif
|
||||
exit_function:
|
||||
return retVal;
|
||||
#else
|
||||
return 0;
|
||||
priority = priority;
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Reference in New Issue
Block a user