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

Michael Pyne mpyne at kde.org
Sat Oct 9 05:36:56 BST 2010


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

Ship it!


Patch looks good, please commit (although please move the #ifdef and #endif to the beginning of their respective lines for consistency's sake).

- Michael


On 2010-10-09 03:50:27, Gregory Schlomoff wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5559/
> -----------------------------------------------------------
> 
> (Updated 2010-10-09 03:50:27)
> 
> 
> 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/ff9e7673/attachment.htm>


More information about the kde-core-devel mailing list