diff options
author | Ulf Hermann <[email protected]> | 2025-03-10 08:34:45 +0100 |
---|---|---|
committer | Ulf Hermann <[email protected]> | 2025-03-18 10:53:07 +0100 |
commit | 390c78b394b30d1abdc6268b21dd2a583472bd60 (patch) | |
tree | 3990a9485d60e4ae18949693e434b2eeb4ee0f9b /src/qml/common/qv4compileddata_p.h | |
parent | 0675e10429234b43ab96de22181c1970416a42ef (diff) |
QtQml: Drop checks for compile hash and Qt version from the CUs
The data structure version is supposed to encode any incompatible
changes to our compilation unit format. Checking the compile hash and Qt
version in addition is redundant and excessively restrictive.
[ChangeLog][QtQml] You can now use QML code compiled with Qt Quick
Compiler across Qt versions as long as the compilation unit format
hasn't changed between those versions. You cannot rely on the
compilation unit format to stay unchanged under any specific
circumstances. However, we won't change it unnecessarily.
Change-Id: I8c407b505ac7fa952f53fa25bb6d4e7caf0fba0c
Reviewed-by: Fabian Kosmale <[email protected]>
Diffstat (limited to 'src/qml/common/qv4compileddata_p.h')
-rw-r--r-- | src/qml/common/qv4compileddata_p.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h index 46112c3034..889df101d0 100644 --- a/src/qml/common/qv4compileddata_p.h +++ b/src/qml/common/qv4compileddata_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE // Also change the comment behind the number to describe the latest change. This has the added // benefit that if another patch changes the version too, it will result in a merge conflict, and // not get removed silently. -#define QV4_DATA_STRUCTURE_VERSION 0x44 // added a flag to mark properties as final from QML +#define QV4_DATA_STRUCTURE_VERSION 0x45 // Removed Qt version and compile hash checks class QIODevice; class QQmlTypeNameCache; @@ -1203,7 +1203,6 @@ struct QmlUnit }; static_assert(sizeof(QmlUnit) == 16, "QmlUnit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); -enum { QmlCompileHashSpace = 48 }; static const char magic_str[] = "qv4cdata"; struct Unit @@ -1211,12 +1210,11 @@ struct Unit // DO NOT CHANGE THESE FIELDS EVER char magic[8]; quint32_le version; - quint32_le qtVersion; - qint64_le sourceTimeStamp; - quint32_le unitSize; // Size of the Unit and any depending data. // END DO NOT CHANGE THESE FIELDS EVER - char libraryVersionHash[QmlCompileHashSpace]; + quint32_le reserved; // For predictable alignment and size. Used to be Qt version. + qint64_le sourceTimeStamp; + quint32_le unitSize; // Size of the Unit and any depending data. char md5Checksum[16]; // checksum of all bytes following this field. char dependencyMD5Checksum[16]; @@ -1387,7 +1385,7 @@ struct Unit bool verifyHeader(QDateTime expectedSourceTimeStamp, QString *errorString) const; }; -static_assert(sizeof(Unit) == 248, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Unit) == 200, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct TypeReference { |