diff options
author | João Abecasis <joao.abecasis@nokia.com> | 2012-03-12 17:14:48 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-23 19:43:00 +0100 |
commit | accfdc85e5cb1816b3eda02ec8d37474259c247e (patch) | |
tree | e2c0369b07eaac3982f155adc8890532e6799e0a /src/corelib/tools/qhash.h | |
parent | 98c3b8a44220096a4e2a3967a4e9742c3605a5cd (diff) |
Fallback implementation of Q_ALIGNOF
For all practical purposes, the fallback introduced here returns the
desired value. Having a fallback enables unconditional use of Q_ALIGNOF.
For compilers that provide native support for it, Q_ALIGNOF is otherwise
#defined in qcompilerdetection.h.
Change-Id: Ie148ca8936cbbf8b80fe87771a14797c39a9d30c
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qhash.h')
-rw-r--r-- | src/corelib/tools/qhash.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 73162b6cf1..ef003c8a71 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -257,13 +257,8 @@ class QHash return reinterpret_cast<Node *>(node); } -#ifdef Q_ALIGNOF static inline int alignOfNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(Node)); } static inline int alignOfDummyNode() { return qMax<int>(sizeof(void*), Q_ALIGNOF(DummyNode)); } -#else - static inline int alignOfNode() { return 0; } - static inline int alignOfDummyNode() { return 0; } -#endif public: inline QHash() : d(const_cast<QHashData *>(&QHashData::shared_null)) { } |