Review Request: Fix for kdecore/util on Mac OS X: Adding a #ifdef KSDC_TIMEOUTS_SUPPORTED

Gregory Schlomoff gregory.schlomoff at gmail.com
Sat Oct 9 04:50:28 BST 2010


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5559/
-----------------------------------------------------------

Review request for kdelibs and Michael Pyne.


Summary
-------

In kdecore/util/kshareddatacache_p.h we have the following:

bool timeoutsSupported = false;
[...]
#ifdef KSDC_TIMEOUTS_SUPPORTED
    timeoutsSupported = ::sysconf(_SC_TIMEOUTS) >= 200112L;
#endif
[...]
if (timeoutsSupported) {
    tempLock = QSharedPointer<KSDCLock>(new pthreadTimedLock(tempMutex));
}
else {
    tempLock = QSharedPointer<KSDCLock>(new pthreadLock(tempMutex));
}

Mac OS X doesn't support timouts on mutexes, so KSDC_TIMEOUTS_SUPPORTED is not defined. 
So even though logically the branch if (timeoutsSupported) will never be taken, it will still throw a compile-time error because pthreadTimedLock isn't defined. This patch fixes this. Let me know if you find a more elegant solution.


Diffs
-----

  /trunk/KDE/kdelibs/kdecore/util/kshareddatacache_p.h 1183591 

Diff: http://svn.reviewboard.kde.org/r/5559/diff


Testing
-------

Compiles on Mac OS X


Thanks,

Gregory

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20101009/ae0f9701/attachment.htm>


More information about the kde-core-devel mailing list