qarraydata.h: use __has_builtin directly
All our supported compilers support __has_builtin; also, no need to check for old GCC versions; we require at least GCC 8. Change-Id: I86d955188e71d6da5ebd1b2455e0f7fad8072bfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
a4ea58bf04
commit
1687f4c963
@ -139,7 +139,7 @@ struct QTypedArrayData
|
|||||||
static_assert(sizeof(QTypedArrayData) == sizeof(QArrayData));
|
static_assert(sizeof(QTypedArrayData) == sizeof(QArrayData));
|
||||||
QArrayData *d;
|
QArrayData *d;
|
||||||
void *result = QArrayData::allocate(&d, sizeof(T), alignof(AlignmentDummy), capacity, option);
|
void *result = QArrayData::allocate(&d, sizeof(T), alignof(AlignmentDummy), capacity, option);
|
||||||
#if (defined(Q_CC_GNU) && Q_CC_GNU >= 407) || QT_HAS_BUILTIN(__builtin_assume_aligned)
|
#if __has_builtin(__builtin_assume_aligned)
|
||||||
result = __builtin_assume_aligned(result, Q_ALIGNOF(AlignmentDummy));
|
result = __builtin_assume_aligned(result, Q_ALIGNOF(AlignmentDummy));
|
||||||
#endif
|
#endif
|
||||||
return qMakePair(static_cast<QTypedArrayData *>(d), static_cast<T *>(result));
|
return qMakePair(static_cast<QTypedArrayData *>(d), static_cast<T *>(result));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user