|
|
|
@@ -199,28 +199,36 @@ private: |
|
|
|
template<>
|
|
|
|
inline int32 Atomic<int32>::get() const noexcept
|
|
|
|
{
|
|
|
|
#ifdef CARLA_PROPER_CPP11_SUPPORT
|
|
|
|
static_jassert (sizeof (int32) == 4);
|
|
|
|
#endif
|
|
|
|
return castFrom32Bit ((int32) __sync_add_and_fetch (const_cast<volatile int32*>(&value), 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
|
|
|
inline int64 Atomic<int64>::get() const noexcept
|
|
|
|
{
|
|
|
|
#ifdef CARLA_PROPER_CPP11_SUPPORT
|
|
|
|
static_jassert (sizeof (int64) == 8);
|
|
|
|
#endif
|
|
|
|
return castFrom64Bit ((int64) __sync_add_and_fetch (const_cast<volatile int64*>(&value), 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
|
|
|
inline uint32 Atomic<uint32>::get() const noexcept
|
|
|
|
{
|
|
|
|
#ifdef CARLA_PROPER_CPP11_SUPPORT
|
|
|
|
static_jassert (sizeof (uint32) == 4);
|
|
|
|
#endif
|
|
|
|
return castFrom32Bit ((uint32) __sync_add_and_fetch (const_cast<volatile uint32*>(&value), 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
|
|
|
inline uint64 Atomic<uint64>::get() const noexcept
|
|
|
|
{
|
|
|
|
#ifdef CARLA_PROPER_CPP11_SUPPORT
|
|
|
|
static_jassert (sizeof (uint64) == 8);
|
|
|
|
#endif
|
|
|
|
return castFrom64Bit ((uint64) __sync_add_and_fetch (const_cast<volatile uint64*>(&value), 0));
|
|
|
|
}
|
|
|
|
|
|
|
|
|