QDateTime: fix our oversight in Qt 6.0 not changing the ShortData

For 32-bit systems. They're not important (to me), but might as well fix
this oversight.

Change-Id: I755911ae7d0341f49039fffd167b26617db93354
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
Thiago Macieira 2021-05-01 21:44:51 -07:00
parent c4947c1c4c
commit 4d24fcd3e1
2 changed files with 11 additions and 3 deletions

View File

@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Copyright (C) 2021 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -3454,6 +3454,10 @@ inline qint64 QDateTimePrivate::zoneMSecsToEpochMSecs(qint64 zoneMSecs, const QT
*/
QDateTime::QDateTime() noexcept
{
#if QT_VERSION >= QT_VERSION_CHECK(7,0,0) || QT_POINTER_SIZE == 8
static_assert(sizeof(ShortData) == sizeof(qint64));
static_assert(sizeof(Data) == sizeof(qint64));
#endif
}
/*!

View File

@ -1,7 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2020 The Qt Company Ltd.
** Copyright (C) 2016 Intel Corporation.
** Copyright (C) 2021 The Qt Company Ltd.
** Copyright (C) 2021 Intel Corporation.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@ -240,8 +240,12 @@ class Q_CORE_EXPORT QDateTime
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
quintptr status : 8;
#endif
#if QT_VERSION >= QT_VERSION_CHECK(7,0,0)
qint64 msecs : 56;
#else
// note: this is only 24 bits on 32-bit systems...
qintptr msecs : sizeof(void *) * 8 - 8;
#endif
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
quintptr status : 8;