diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-02-24 14:05:58 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-24 16:12:41 +0100 |
commit | 6813a21c522631e5388b2cbf3f8e4e273b0d27ce (patch) | |
tree | 67c0a352a83fa04f51131bd88b49b1fc5bc30a99 /src | |
parent | f12b0f9a38c792abb13f3e6ecff4542986a6f96b (diff) |
Fix compilation on armv5
Two changes broke compilation on armv5, where we're currently
not CI-testing:
634f82f1f1fda7983abf70b58e43c580b1f01df0 changed the signature
in a function definition without changing its declaration, while
it was actually intending to add this as a new overload.
bfe0db6fbea6376dbe395af6d76995a54bbc3b49 added an #error
condition without fixing compilation on armv5. I don't know
if the fix is correct, but at least it compiles.
Task-number: QTBUG-37034
Change-Id: If99142fafb9bd55afc20b17f8b3cce5ee0ffec13
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/arch/qatomic_armv5.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/corelib/arch/qatomic_armv5.h b/src/corelib/arch/qatomic_armv5.h index 6939650c54..253b9263de 100644 --- a/src/corelib/arch/qatomic_armv5.h +++ b/src/corelib/arch/qatomic_armv5.h @@ -54,6 +54,7 @@ QT_END_NAMESPACE #pragma qt_sync_stop_processing #endif +#define Q_ATOMIC_INT32_IS_SUPPORTED #define Q_ATOMIC_INT_REFERENCE_COUNTING_IS_NOT_NATIVE #define Q_ATOMIC_INT_TEST_AND_SET_IS_NOT_NATIVE #define Q_ATOMIC_INT_FETCH_AND_STORE_IS_ALWAYS_NATIVE @@ -98,6 +99,7 @@ template <int size> struct QBasicAtomicOps: QGenericAtomicOps<QBasicAtomicOps<si static Q_DECL_CONSTEXPR bool isTestAndSetNative() Q_DECL_NOTHROW { return false; } static Q_DECL_CONSTEXPR bool isTestAndSetWaitFree() Q_DECL_NOTHROW { return false; } template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW; + template <typename T> static bool testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW; template <typename T> static T fetchAndStoreRelaxed(T &_q_value, T newValue) Q_DECL_NOTHROW; template <typename T> static T fetchAndAddRelaxed(T &_q_value, typename QAtomicAdditiveType<T>::AdditiveT valueToAdd) Q_DECL_NOTHROW; @@ -133,6 +135,18 @@ bool QBasicAtomicOps<4>::deref(T &_q_value) Q_DECL_NOTHROW } template<> template <typename T> inline +bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue) Q_DECL_NOTHROW +{ + T originalValue; + do { + originalValue = _q_value; + if (originalValue != expectedValue) + return false; + } while (_q_cmpxchg(expectedValue, newValue, &_q_value) != 0); + return true; +} + +template<> template <typename T> inline bool QBasicAtomicOps<4>::testAndSetRelaxed(T &_q_value, T expectedValue, T newValue, T *currentValue) Q_DECL_NOTHROW { T originalValue; |