Hi all, please review the attached patch which applies an important and safe subset of the changes to sal/osl/unx/interlck.c on master to 3.3.2, mostly: http://cgit.freedesktop.org/libreoffice/ure/commit/?id=788072cefdce8cb61d46549a7aede4c754d9fae3 So the commit should have "Jani Monoses <jani.monoses@canonical.com>" as author. Best Regards, Bjoern -- https://launchpad.net/~bjoern-michaelsen
diff --git a/sal/osl/unx/interlck.c b/sal/osl/unx/interlck.c index f164371..184cb5f 100644 --- a/sal/osl/unx/interlck.c +++ b/sal/osl/unx/interlck.c @@ -134,7 +134,16 @@ oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* return nCount; } +#elif ( __GNUC__ > 4 ) || (( __GNUC__ == 4) && ( __GNUC_MINOR__ >= 4 )) +oslInterlockedCount SAL_CALL osl_incrementInterlockedCount(oslInterlockedCount* pCount) +{ + return __sync_add_and_fetch(pCount, 1); +} +oslInterlockedCount SAL_CALL osl_decrementInterlockedCount(oslInterlockedCount* pCount) +{ + return __sync_sub_and_fetch(pCount, 1); +} #else /* use only if nothing else works, expensive due to single mutex for all reference counts */
Attachment:
signature.asc
Description: PGP signature