QDateTime: work around bitfield bug on msvc x86
Somehow, when mixing types in a bitfield, MSVC will use a lot more space than expected. So ShortData ended up being 16 bytes causing various static_asserts to trigger. Change-Id: Ia0032e71621772db27e2917d9c71598046730107 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit a901afcd79fe0ac7cf257f2ed45c72a7cfaf028a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
a09b9aaba9
commit
352cbfd3c8
@ -253,18 +253,25 @@ class QDateTimePrivate;
|
|||||||
class Q_CORE_EXPORT QDateTime
|
class Q_CORE_EXPORT QDateTime
|
||||||
{
|
{
|
||||||
struct ShortData {
|
struct ShortData {
|
||||||
#if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
|
|
||||||
quintptr status : 8;
|
|
||||||
#endif
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(7,0,0) || defined(QT_BOOTSTRAPPED)
|
#if QT_VERSION >= QT_VERSION_CHECK(7,0,0) || defined(QT_BOOTSTRAPPED)
|
||||||
|
# if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
|
||||||
|
qint64 status : 8;
|
||||||
|
# endif
|
||||||
qint64 msecs : 56;
|
qint64 msecs : 56;
|
||||||
|
|
||||||
|
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||||
|
qint64 status : 8;
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
|
# if Q_BYTE_ORDER == Q_LITTLE_ENDIAN
|
||||||
|
quintptr status : 8;
|
||||||
|
# endif
|
||||||
// note: this is only 24 bits on 32-bit systems...
|
// note: this is only 24 bits on 32-bit systems...
|
||||||
qintptr msecs : sizeof(void *) * 8 - 8;
|
qintptr msecs : sizeof(void *) * 8 - 8;
|
||||||
#endif
|
|
||||||
|
|
||||||
#if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
# if Q_BYTE_ORDER == Q_BIG_ENDIAN
|
||||||
quintptr status : 8;
|
quintptr status : 8;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user