14 #include "atomicrefcount.h"
18 #if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
20 #elif defined( __APPLE__ )
21 # include <libkern/OSAtomic.h>
22 #elif defined( HAVE_GCC_ATOMIC_BUILTINS )
25 # include "mutexguard.h"
44 #if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
45 return (
int) ::InterlockedIncrement( (
volatile LONG*)&m_count );
46 #elif defined( __APPLE__ )
47 return (
int) OSAtomicIncrement32Barrier( (
volatile int32_t*)&m_count );
48 #elif defined( HAVE_GCC_ATOMIC_BUILTINS )
50 return (
int) __sync_add_and_fetch( &m_count, 1 );
60 #if defined( _WIN32 ) && !defined( __SYMBIAN32__ )
61 return (
int) ::InterlockedDecrement( (
volatile LONG*)&m_count );
62 #elif defined( __APPLE__ )
63 return (
int) OSAtomicDecrement32Barrier( (
volatile int32_t*)&m_count );
64 #elif defined( HAVE_GCC_ATOMIC_BUILTINS )
66 return (
int) __sync_sub_and_fetch( &m_count, 1 );