diff options
author | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-26 08:56:28 (GMT) |
---|---|---|
committer | Bradley T. Hughes <bradley.hughes@nokia.com> | 2009-06-26 08:56:28 (GMT) |
commit | 0bbd4db2eed7092c58c36867033fc21d8b86bcd9 (patch) | |
tree | f47b347072e72a2b241ad1e2846bef03bd927015 /src/corelib | |
parent | 36d6dc5666b102d8401daa01243b4736203f8848 (diff) | |
parent | 9ac5755fb53387a79e5d9c007501800ab9963bed (diff) | |
download | Qt-0bbd4db2eed7092c58c36867033fc21d8b86bcd9.zip Qt-0bbd4db2eed7092c58c36867033fc21d8b86bcd9.tar.gz Qt-0bbd4db2eed7092c58c36867033fc21d8b86bcd9.tar.bz2 |
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal.h | 31 | ||||
-rw-r--r-- | src/corelib/kernel/qvariant.h | 2 |
2 files changed, 31 insertions, 2 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index b4b98e1..afc3f58 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -385,6 +385,9 @@ namespace QT_NAMESPACE {} # define Q_OUTOFLINE_TEMPLATE inline # define Q_NO_TEMPLATE_FRIENDS # define QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION +# define Q_ALIGNOF(type) __alignof(type) +# define Q_DECL_ALIGN(n) __declspec(align(n)) + /* Visual C++.Net issues for _MSC_VER >= 1300 */ # if _MSC_VER >= 1300 # define Q_CC_MSVC_NET @@ -471,6 +474,11 @@ namespace QT_NAMESPACE {} # define Q_NO_USING_KEYWORD # define QT_NO_STL_WCHAR # endif +# if __GNUC__ >= 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# endif /* GCC 3.1 and GCC 3.2 wrongly define _SB_CTYPE_MACROS on HP-UX */ # if defined(Q_OS_HPUX) && __GNUC__ == 3 && __GNUC_MINOR__ >= 1 # define Q_WRONG_SB_CTYPE_MACROS @@ -524,6 +532,11 @@ namespace QT_NAMESPACE {} # define Q_OUTOFLINE_TEMPLATE inline # define Q_BROKEN_TEMPLATE_SPECIALIZATION # define Q_CANNOT_DELETE_CONSTANT +# elif __xlC__ >= 0x0600 +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# define Q_PACKED __attribute__((__packed__)) # endif /* Older versions of DEC C++ do not define __EDG__ or __EDG - observed @@ -647,6 +660,13 @@ namespace QT_NAMESPACE {} # if __SUNPRO_CC < 0x570 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS # endif + /* see http://developers.sun.com/sunstudio/support/Ccompare.html */ +# if __SUNPRO_CC >= 0x590 +# define Q_ALIGNOF(type) __alignof__(type) +# define Q_TYPEOF(expr) __typeof__(expr) +# define Q_DECL_ALIGN(n) __attribute__((__aligned__(n))) +# define Q_DECL_EXPORT __attribute__((__visibility__("default"))) +# endif # if !defined(_BOOL) # define Q_NO_BOOL_TYPE # endif @@ -676,8 +696,17 @@ namespace QT_NAMESPACE {} # if defined(__HP_aCC) || __cplusplus >= 199707L # define Q_NO_TEMPLATE_FRIENDS # define Q_CC_HPACC -# ifdef QT_ARCH_PARISC +# if __HP_aCC-0 < 060000 # define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS +# define Q_DECL_EXPORT __declspec(dllexport) +# define Q_DECL_IMPORT __declspec(dllimport) +# endif +# if __HP_aCC-0 >= 061200 +# define Q_DECL_ALIGNED(n) __attribute__((aligned(n))) +# endif +# if __HP_aCC-0 >= 062000 +# define Q_DECL_EXPORT __attribute__((visibility("default")) +# define Q_DECL_IMPORT Q_DECL_EXPORT # endif # else # define Q_CC_HP diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h index 6844d3e..e923844 100644 --- a/src/corelib/kernel/qvariant.h +++ b/src/corelib/kernel/qvariant.h @@ -448,7 +448,7 @@ inline void qVariantSetValue(QVariant &v, const T &t) //if possible we reuse the current QVariant private const int type = qMetaTypeId<T>(reinterpret_cast<T *>(0)); QVariant::Private &d = v.data_ptr(); - if (type <= int(QVariant::Char) || (type == d.type && v.isDetached())) { + if (v.isDetached() && (type <= int(QVariant::Char) || type == d.type)) { d.type = type; T *old = reinterpret_cast<T*>(d.is_shared ? d.data.shared->ptr : &d.data.ptr); if (QTypeInfo<T>::isComplex) |