diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2012-08-06 18:03:49 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-18 18:35:36 +0200 |
commit | 2b00f97ab05f144293b26d1e0d8cf4c54d222f92 (patch) | |
tree | ef1ff7fa28fdb1449f5e91830adc26c36ef34c6c /src/corelib/arch/qatomic_ia64.h | |
parent | 624911e48174094c80df7e27b28cc2b2d46f4398 (diff) |
Add Q_DECL_CONSTEXPR to the isXXX functions in the new atomics.
This allows one to write code that depends on these values at
compile-time.
Change-Id: I7d78524ed9c70d4141360496d1d764dcbfa92e62
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/arch/qatomic_ia64.h')
-rw-r--r-- | src/corelib/arch/qatomic_ia64.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/arch/qatomic_ia64.h b/src/corelib/arch/qatomic_ia64.h index 0bf3cf78d4..c6387108e1 100644 --- a/src/corelib/arch/qatomic_ia64.h +++ b/src/corelib/arch/qatomic_ia64.h @@ -154,27 +154,27 @@ template <int size> struct QBasicAtomicOps: QGenericAtomicOps<QBasicAtomicOps<si { *static_cast<volatile T *>(&_q_value) = newValue; } - static inline bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; } - static inline bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return size == 4 || size == 8; } + static inline Q_DECL_CONSTEXPR bool isReferenceCountingNative() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree() Q_DECL_NOTHROW { return size == 4 || size == 8; } template <typename T> static bool ref(T &_q_value) Q_DECL_NOTHROW; template <typename T> static bool deref(T &_q_value) Q_DECL_NOTHROW; - static inline bool isTestAndSetNative() Q_DECL_NOTHROW { return true; } - static inline bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return true; } template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW; template <typename T> static bool testAndSetAcquire(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW; template <typename T> static bool testAndSetRelease(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW; template <typename T> static bool testAndSetOrdered(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW; - static inline bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; } - static inline bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isFetchAndStoreNative() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree() Q_DECL_NOTHROW { return true; } template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW; template <typename T> static T fetchAndStoreAcquire(T &_q_value, T newValue) Q_DECL_NOTHROW; template <typename T> static T fetchAndStoreRelease(T &_q_value, T newValue) Q_DECL_NOTHROW; template <typename T> static T fetchAndStoreOrdered(T &_q_value, T newValue) Q_DECL_NOTHROW; - static inline bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; } - static inline bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; } + static inline Q_DECL_CONSTEXPR bool isFetchAndAddNative() Q_DECL_NOTHROW { return true; } + static inline Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree() Q_DECL_NOTHROW { return false; } template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW; template <typename T> static |