From kde-devel Tue Apr 22 19:12:43 2008 From: "Bart Van Assche" Date: Tue, 22 Apr 2008 19:12:43 +0000 To: kde-devel Subject: Re: KDE, Qt3 and Amarok Message-Id: X-MARC-Message: https://marc.info/?l=kde-devel&m=120889164705788 On Tue, Apr 22, 2008 at 8:34 AM, Thiago Macieira wrote: > Bart Van Assche wrote: > >Do you know where I can find more information about the portability > >requirements for Qt 3 patches for KDE ? Is it allowed to use gcc > >extensions ? And are other threading libraries than POSIX threads > >supported ? > > Well, since a patch is only a suggestion, you can do whatever you want > with it. If it doesn't compile for other platforms, they can just not > apply your patch. Or they can fix it and send it back to you :-) Something like this ? diff -upr orig/qt-x11-free-3.3.7/src/tools/qshared.h qt-x11-free-3.3.7/src/tools/qshared.h --- orig/qt-x11-free-3.3.7/src/tools/qshared.h 2006-10-19 16:25:03.000000000 +0200 +++ qt-x11-free-3.3.7/src/tools/qshared.h 2008-04-04 14:01:26.000000000 +0200 @@ -46,8 +46,8 @@ struct Q_EXPORT QShared { QShared() : count( 1 ) { } - void ref() { count++; } - bool deref() { return !--count; } + void ref() { __sync_add_and_fetch(&count, 1); } + bool deref() { return ! __sync_sub_and_fetch(&count, 1); } uint count; }; Bart. >> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<