tst_toolsupport: make the i386 case really about i386
Specifically, don't use it for either of the x86-64 ABIs (LP64 and ILP32). The generic case below should work for everyone. Fixes: QTBUG-122720 Change-Id: I01ec3c774d9943adb903fffd17b75fc79095e089 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 24245d2a85cbcd503816027067aa72995e3ac2ac) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
aeb51edf33
commit
8007f6acb1
@ -38,6 +38,7 @@ template <typename T, typename K>
|
|||||||
size_t pmm_to_offsetof(T K:: *pmm)
|
size_t pmm_to_offsetof(T K:: *pmm)
|
||||||
{
|
{
|
||||||
#ifdef Q_CC_MSVC
|
#ifdef Q_CC_MSVC
|
||||||
|
|
||||||
// Even on 64 bit MSVC uses 4 byte offsets.
|
// Even on 64 bit MSVC uses 4 byte offsets.
|
||||||
quint32 ret;
|
quint32 ret;
|
||||||
#else
|
#else
|
||||||
@ -114,10 +115,10 @@ void tst_toolsupport::offsets_data()
|
|||||||
QTestData &data = QTest::newRow("QFilePrivate::fileName")
|
QTestData &data = QTest::newRow("QFilePrivate::fileName")
|
||||||
<< pmm_to_offsetof(&QFilePrivate::fileName);
|
<< pmm_to_offsetof(&QFilePrivate::fileName);
|
||||||
// Please heed the comment at the top of this file when changing one of these lines:
|
// Please heed the comment at the top of this file when changing one of these lines:
|
||||||
#ifdef Q_PROCESSOR_X86
|
#ifdef Q_PROCESSOR_X86_32
|
||||||
// x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in
|
// x86 32-bit has weird alignment rules. Refer to QtPrivate::AlignOf in
|
||||||
// qglobal.h for more details.
|
// qglobal.h for more details.
|
||||||
data << 264 << 424;
|
data << 264 << -1;
|
||||||
#else
|
#else
|
||||||
data << 300 << 424;
|
data << 300 << 424;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user