compilation fixes for generic implementation of wxAtomicInt32
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48634 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -111,13 +111,13 @@ inline wxUint32 wxAtomicDec (wxUint32 &value) { return --value; }
|
|||||||
class wxAtomicInt32
|
class wxAtomicInt32
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
wxAtomicInt() { } // non initialized for consistency with basic int type
|
wxAtomicInt32() { } // non initialized for consistency with basic int type
|
||||||
wxAtomicInt(wxInt32 v) : m_value(v) { }
|
wxAtomicInt32(wxInt32 v) : m_value(v) { }
|
||||||
|
|
||||||
operator wxInt32() const { return m_value; }
|
operator wxInt32() const { return m_value; }
|
||||||
operator wxInt32&() { return m_value; }
|
operator volatile wxInt32&() { return m_value; }
|
||||||
|
|
||||||
wxAtomicInt& operator=(wxInt32 v) { m_value = v; return *this; }
|
wxAtomicInt32& operator=(wxInt32 v) { m_value = v; return *this; }
|
||||||
|
|
||||||
void Inc()
|
void Inc()
|
||||||
{
|
{
|
||||||
@@ -134,10 +134,12 @@ public:
|
|||||||
private:
|
private:
|
||||||
volatile wxInt32 m_value;
|
volatile wxInt32 m_value;
|
||||||
wxCriticalSection m_locker;
|
wxCriticalSection m_locker;
|
||||||
|
|
||||||
|
DECLARE_NO_COPY_CLASS(wxAtomicInt32)
|
||||||
};
|
};
|
||||||
|
|
||||||
inline void wxAtomicInc(wxAtomicInt &value) { value.Inc(); }
|
inline void wxAtomicInc(wxAtomicInt32 &value) { value.Inc(); }
|
||||||
inline wxInt32 wxAtomicDec(wxAtomicInt &value) { return value.Dec(); }
|
inline wxInt32 wxAtomicDec(wxAtomicInt32 &value) { return value.Dec(); }
|
||||||
|
|
||||||
#else // !wxHAS_GENERIC_ATOMIC_OPS
|
#else // !wxHAS_GENERIC_ATOMIC_OPS
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user