From 2b00f97ab05f144293b26d1e0d8cf4c54d222f92 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 6 Aug 2012 18:03:49 +0200 Subject: 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 Reviewed-by: Thiago Macieira --- src/corelib/thread/qatomic.h | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/corelib/thread/qatomic.h') diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 2eb0a03cc6..7b0f6bc69f 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -78,30 +78,30 @@ public: } #ifdef qdoc - static bool isReferenceCountingNative(); - static bool isReferenceCountingWaitFree(); + static Q_DECL_CONSTEXPR bool isReferenceCountingNative(); + static Q_DECL_CONSTEXPR bool isReferenceCountingWaitFree(); bool ref(); bool deref(); - static bool isTestAndSetNative(); - static bool isTestAndSetWaitFree(); + static Q_DECL_CONSTEXPR bool isTestAndSetNative(); + static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree(); bool testAndSetRelaxed(int expectedValue, int newValue); bool testAndSetAcquire(int expectedValue, int newValue); bool testAndSetRelease(int expectedValue, int newValue); bool testAndSetOrdered(int expectedValue, int newValue); - static bool isFetchAndStoreNative(); - static bool isFetchAndStoreWaitFree(); + static Q_DECL_CONSTEXPR bool isFetchAndStoreNative(); + static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree(); int fetchAndStoreRelaxed(int newValue); int fetchAndStoreAcquire(int newValue); int fetchAndStoreRelease(int newValue); int fetchAndStoreOrdered(int newValue); - static bool isFetchAndAddNative(); - static bool isFetchAndAddWaitFree(); + static Q_DECL_CONSTEXPR bool isFetchAndAddNative(); + static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree(); int fetchAndAddRelaxed(int valueToAdd); int fetchAndAddAcquire(int valueToAdd); @@ -131,24 +131,24 @@ public: } #ifdef qdoc - static bool isTestAndSetNative(); - static bool isTestAndSetWaitFree(); + static Q_DECL_CONSTEXPR bool isTestAndSetNative(); + static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree(); bool testAndSetRelaxed(T *expectedValue, T *newValue); bool testAndSetAcquire(T *expectedValue, T *newValue); bool testAndSetRelease(T *expectedValue, T *newValue); bool testAndSetOrdered(T *expectedValue, T *newValue); - static bool isFetchAndStoreNative(); - static bool isFetchAndStoreWaitFree(); + static Q_DECL_CONSTEXPR bool isFetchAndStoreNative(); + static Q_DECL_CONSTEXPR bool isFetchAndStoreWaitFree(); T *fetchAndStoreRelaxed(T *newValue); T *fetchAndStoreAcquire(T *newValue); T *fetchAndStoreRelease(T *newValue); T *fetchAndStoreOrdered(T *newValue); - static bool isFetchAndAddNative(); - static bool isFetchAndAddWaitFree(); + static Q_DECL_CONSTEXPR bool isFetchAndAddNative(); + static Q_DECL_CONSTEXPR bool isFetchAndAddWaitFree(); T *fetchAndAddRelaxed(qptrdiff valueToAdd); T *fetchAndAddAcquire(qptrdiff valueToAdd); -- cgit v1.2.3