From 92ca09147fc239762927595165f71a0d1ecff98f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 13 Sep 2017 19:20:46 -0700 Subject: Restore compatibility with pre-5.9 Keccak calculation Commit 12c5264d9add1826d543c36d893db77262195fc6 fixed the calculation of SHA-3 in QCryptographicHash: we were previously calculating Keccak. Unfortunately, turns out that replacing the algorithm wasn't the best idea: there are people who need to compare with the result obtained from a previous version of Qt and stored somewhere. This commit restores the enum values 7 through 10 to mean Keccak and moves SHA-3 to 12 through 15. The "Sha3_nnn" enums will switch between the two according to the QT_SHA3_KECCAK_COMPAT macro. [ChangeLog][Important Behavior Changes] This version of Qt restores compatibility with pre-5.9.0 calculation of QCryptographicHash algorithms that were labelled "Sha3_nnn": that is, applications compiled with old versions of Qt will continue using the Keccak algorithm. Applications recompiled with this version will use SHA-3, unless QT_SHA3_KECCAK_COMPAT is #define'd prior to #include . [ChangeLog][Binary Compatibility Note] This version of Qt changes the values assigned to enumerations QCryptographicHash::Sha3_nnn. Applications compiled with this version and using those enumerations will not work with Qt 5.9.0 and 5.9.1, unless QT_SHA3_KECCAK_COMPAT is defined. Task-number: QTBUG-62025 Discussed-at: http://lists.qt-project.org/pipermail/development/2017-September/030818.html Change-Id: I6e1fe42ae4b742a7b811fffd14e418fc04f096c3 Reviewed-by: Lars Knoll --- src/corelib/tools/qcryptographichash.cpp | 89 +++++++++++++++++++----- src/corelib/tools/qcryptographichash.h | 24 +++++-- src/corelib/tools/qmessageauthenticationcode.cpp | 12 ++-- 3 files changed, 98 insertions(+), 27 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qcryptographichash.cpp b/src/corelib/tools/qcryptographichash.cpp index 5410adc737..a1b121f1ee 100644 --- a/src/corelib/tools/qcryptographichash.cpp +++ b/src/corelib/tools/qcryptographichash.cpp @@ -181,13 +181,18 @@ public: #endif }; #ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1 - void sha3Finish(int bitCount); + enum class Sha3Variant + { + Sha3, + Keccak + }; + void sha3Finish(int bitCount, Sha3Variant sha3Variant); #endif QByteArray result; }; #ifndef QT_CRYPTOGRAPHICHASH_ONLY_SHA1 -void QCryptographicHashPrivate::sha3Finish(int bitCount) +void QCryptographicHashPrivate::sha3Finish(int bitCount, Sha3Variant sha3Variant) { /* FIPS 202 §6.1 defines SHA-3 in terms of calculating the Keccak function @@ -214,7 +219,15 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount) result.resize(bitCount / 8); SHA3Context copy = sha3Context; - sha3Update(©, reinterpret_cast(&sha3FinalSuffix), 2); + + switch (sha3Variant) { + case Sha3Variant::Sha3: + sha3Update(©, reinterpret_cast(&sha3FinalSuffix), 2); + break; + case Sha3Variant::Keccak: + break; + } + sha3Final(©, reinterpret_cast(result.data())); } #endif @@ -239,6 +252,12 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount) /*! \enum QCryptographicHash::Algorithm + \note In Qt versions before 5.9, when asked to generate a SHA3 hash sum, + QCryptographicHash actually calculated Keccak. If you need compatibility with + SHA-3 hashes produced by those versions of Qt, use the \c{Keccak_} + enumerators. Alternatively, if source compatibility is required, define the + macro \c QT_SHA3_KECCAK_COMPAT. + \value Md4 Generate an MD4 hash sum \value Md5 Generate an MD5 hash sum \value Sha1 Generate an SHA-1 hash sum @@ -250,6 +269,14 @@ void QCryptographicHashPrivate::sha3Finish(int bitCount) \value Sha3_256 Generate an SHA3-256 hash sum. Introduced in Qt 5.1 \value Sha3_384 Generate an SHA3-384 hash sum. Introduced in Qt 5.1 \value Sha3_512 Generate an SHA3-512 hash sum. Introduced in Qt 5.1 + \value Keccak_224 Generate a Keccak-224 hash sum. Introduced in Qt 5.9.2 + \value Keccak_256 Generate a Keccak-256 hash sum. Introduced in Qt 5.9.2 + \value Keccak_384 Generate a Keccak-384 hash sum. Introduced in Qt 5.9.2 + \value Keccak_512 Generate a Keccak-512 hash sum. Introduced in Qt 5.9.2 + \omitvalue RealSha3_224 + \omitvalue RealSha3_256 + \omitvalue RealSha3_384 + \omitvalue RealSha3_512 */ /*! @@ -303,16 +330,20 @@ void QCryptographicHash::reset() case Sha512: SHA512Reset(&d->sha512Context); break; - case Sha3_224: + case RealSha3_224: + case Keccak_224: sha3Init(&d->sha3Context, 224); break; - case Sha3_256: + case RealSha3_256: + case Keccak_256: sha3Init(&d->sha3Context, 256); break; - case Sha3_384: + case RealSha3_384: + case Keccak_384: sha3Init(&d->sha3Context, 384); break; - case Sha3_512: + case RealSha3_512: + case Keccak_512: sha3Init(&d->sha3Context, 512); break; #endif @@ -354,16 +385,20 @@ void QCryptographicHash::addData(const char *data, int length) case Sha512: SHA512Input(&d->sha512Context, reinterpret_cast(data), length); break; - case Sha3_224: + case RealSha3_224: + case Keccak_224: sha3Update(&d->sha3Context, reinterpret_cast(data), length*8); break; - case Sha3_256: + case RealSha3_256: + case Keccak_256: sha3Update(&d->sha3Context, reinterpret_cast(data), length*8); break; - case Sha3_384: + case RealSha3_384: + case Keccak_384: sha3Update(&d->sha3Context, reinterpret_cast(data), length*8); break; - case Sha3_512: + case RealSha3_512: + case Keccak_512: sha3Update(&d->sha3Context, reinterpret_cast(data), length*8); break; #endif @@ -462,20 +497,36 @@ QByteArray QCryptographicHash::result() const SHA512Result(©, reinterpret_cast(d->result.data())); break; } - case Sha3_224: { - d->sha3Finish(224); + case RealSha3_224: { + d->sha3Finish(224, QCryptographicHashPrivate::Sha3Variant::Sha3); + break; + } + case RealSha3_256: { + d->sha3Finish(256, QCryptographicHashPrivate::Sha3Variant::Sha3); + break; + } + case RealSha3_384: { + d->sha3Finish(384, QCryptographicHashPrivate::Sha3Variant::Sha3); + break; + } + case RealSha3_512: { + d->sha3Finish(512, QCryptographicHashPrivate::Sha3Variant::Sha3); + break; + } + case Keccak_224: { + d->sha3Finish(224, QCryptographicHashPrivate::Sha3Variant::Keccak); break; } - case Sha3_256: { - d->sha3Finish(256); + case Keccak_256: { + d->sha3Finish(256, QCryptographicHashPrivate::Sha3Variant::Keccak); break; } - case Sha3_384: { - d->sha3Finish(384); + case Keccak_384: { + d->sha3Finish(384, QCryptographicHashPrivate::Sha3Variant::Keccak); break; } - case Sha3_512: { - d->sha3Finish(512); + case Keccak_512: { + d->sha3Finish(512, QCryptographicHashPrivate::Sha3Variant::Keccak); break; } #endif diff --git a/src/corelib/tools/qcryptographichash.h b/src/corelib/tools/qcryptographichash.h index 0f17baa036..2f74d42405 100644 --- a/src/corelib/tools/qcryptographichash.h +++ b/src/corelib/tools/qcryptographichash.h @@ -65,10 +65,26 @@ public: Sha256, Sha384, Sha512, - Sha3_224, - Sha3_256, - Sha3_384, - Sha3_512 + + Keccak_224 = 7, + Keccak_256, + Keccak_384, + Keccak_512, + RealSha3_224 = 11, + RealSha3_256, + RealSha3_384, + RealSha3_512, +# ifndef QT_SHA3_KECCAK_COMPAT + Sha3_224 = RealSha3_224, + Sha3_256 = RealSha3_256, + Sha3_384 = RealSha3_384, + Sha3_512 = RealSha3_512 +# else + Sha3_224 = Keccak_224, + Sha3_256 = Keccak_256, + Sha3_384 = Keccak_384, + Sha3_512 = Keccak_512 +# endif #endif }; Q_ENUM(Algorithm) diff --git a/src/corelib/tools/qmessageauthenticationcode.cpp b/src/corelib/tools/qmessageauthenticationcode.cpp index 9a84191452..40a1193622 100644 --- a/src/corelib/tools/qmessageauthenticationcode.cpp +++ b/src/corelib/tools/qmessageauthenticationcode.cpp @@ -99,13 +99,17 @@ static int qt_hash_block_size(QCryptographicHash::Algorithm method) return SHA384_Message_Block_Size; case QCryptographicHash::Sha512: return SHA512_Message_Block_Size; - case QCryptographicHash::Sha3_224: + case QCryptographicHash::RealSha3_224: + case QCryptographicHash::Keccak_224: return 144; - case QCryptographicHash::Sha3_256: + case QCryptographicHash::RealSha3_256: + case QCryptographicHash::Keccak_256: return 136; - case QCryptographicHash::Sha3_384: + case QCryptographicHash::RealSha3_384: + case QCryptographicHash::Keccak_384: return 104; - case QCryptographicHash::Sha3_512: + case QCryptographicHash::RealSha3_512: + case QCryptographicHash::Keccak_512: return 72; } return 0; -- cgit v1.2.3 From 370f8ecaa9c9b3a968119e8fb735c3a35c92a0cc Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 15 Sep 2017 14:15:41 -0700 Subject: Fix parsing of tzfile(5) files in QTimeZonePrivate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The leap second record sizes were not properly taken into account. The comments in the code were right, but not the code itself. Fortunately, on most Linux systems the leap seconds are not stored in the tzfiles, so we never ran into a parsing issue. Task-number: QTBUG-63205 Change-Id: I6e1fe42ae4b742a7b811fffd14e4a57f5d142f97 Reviewed-by: Maximilian Baumgartner Reviewed-by: Mårten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/tools/qtimezoneprivate_tz.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index 1714c9802f..4fdc2e36ac 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -277,8 +277,9 @@ static void parseTzLeapSeconds(QDataStream &ds, int tzh_leapcnt, bool longTran) { // Parse tzh_leapcnt x pairs of leap seconds // We don't use leap seconds, so only read and don't store - qint64 val; + qint32 val; if (longTran) { + // v2 file format, each entry is 12 bytes long qint64 time; for (int i = 0; i < tzh_leapcnt && ds.status() == QDataStream::Ok; ++i) { // Parse Leap Occurrence Time, 8 bytes @@ -288,6 +289,7 @@ static void parseTzLeapSeconds(QDataStream &ds, int tzh_leapcnt, bool longTran) ds >> val; } } else { + // v0 file format, each entry is 8 bytes long for (int i = 0; i < tzh_leapcnt && ds.status() == QDataStream::Ok; ++i) { // Parse Leap Occurrence Time, 4 bytes ds >> val; -- cgit v1.2.3 From 2c35ef04ffab5a603e25d50e00d7dc87699effa9 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Fri, 22 Sep 2017 15:45:39 +0200 Subject: doc: fix code snippet of qConstOverload usage Change-Id: I11628d2f9372f21f371ccf93000c26079eb9ef72 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index 1169ad5536..8d4bd36beb 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -617,7 +617,7 @@ template<> class QTypeInfo : public QTypeInfoMerger {}; void overloadedFunction(int, QString); void overloadedFunction(int, QString) const; }; - ... qConstOverload<>(&Foo::overloadedFunction) + ... qConstOverload(&Foo::overloadedFunction) ... qNonConstOverload(&Foo::overloadedFunction) //! [54] -- cgit v1.2.3 From aa4fef88121f536f40760449fa81c03be076d68d Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 11 Sep 2017 18:14:51 +0200 Subject: Make QDateTimeParser a separate feature It was being mis-described in some places by a QT_CONFIG(timezone) test, replacing older QT_BOOTSTRAPPED checks; but it has no time-zone dependency (until 5.10). So make it a separate feature in its own right. It turns out QAbstractSpinBox's presumed dependency on datetimeedit was an illusion caused by use of QDATETIMEEDIT_*_MIN symbols actually provided by datetimeparser; so remove its bogus dependency. Change-Id: Ibc12f4a9ee35acb64a39a1c7a15d2934b5710dc0 Reviewed-by: Thiago Macieira --- src/corelib/configure.json | 8 +++++++- src/corelib/global/qconfig-bootstrapped.h | 1 + src/corelib/tools/qdatetime.cpp | 8 +++++--- src/corelib/tools/qdatetimeparser.cpp | 4 ---- src/corelib/tools/qdatetimeparser_p.h | 6 ++---- src/corelib/tools/qlocale.cpp | 8 +++++--- src/corelib/tools/tools.pri | 7 +++++-- 7 files changed, 25 insertions(+), 17 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 91f7bb4fd6..a5b69a2df6 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -733,10 +733,16 @@ }, "timezone": { "label": "QTimeZone", - "purpose": "Provides support for timezone handling.", + "purpose": "Provides support for time-zone handling.", "section": "Utilities", "output": [ "publicFeature" ] }, + "datetimeparser": { + "label": "QDateTimeParser", + "purpose": "Provides support for parsing date-time texts.", + "section": "Utilities", + "output": [ "privateFeature" ] + }, "commandlineparser": { "label": "QCommandlineParser", "purpose": "Provides support for command line parsing.", diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 0b02ecc8ec..58a9ca918a 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -87,6 +87,7 @@ #define QT_FEATURE_temporaryfile 1 #define QT_NO_THREAD #define QT_FEATURE_timezone -1 +#define QT_FEATURE_datetimeparser -1 #define QT_FEATURE_topleveldomain -1 #define QT_NO_TRANSLATION #define QT_FEATURE_translation -1 diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 11c023f762..9d26207a0f 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -40,7 +40,9 @@ #include "qplatformdefs.h" #include "private/qdatetime_p.h" +#if QT_CONFIG(datetimeparser) #include "private/qdatetimeparser_p.h" +#endif #include "qdatastream.h" #include "qset.h" @@ -1331,7 +1333,7 @@ QDate QDate::fromString(const QString& string, Qt::DateFormat format) QDate QDate::fromString(const QString &string, const QString &format) { QDate date; -#if QT_CONFIG(timezone) +#if QT_CONFIG(datetimeparser) QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString); // dt.setDefaultLocale(QLocale::c()); ### Qt 6 if (dt.parseFormat(format)) @@ -2037,7 +2039,7 @@ QTime QTime::fromString(const QString& string, Qt::DateFormat format) QTime QTime::fromString(const QString &string, const QString &format) { QTime time; -#if QT_CONFIG(timezone) +#if QT_CONFIG(datetimeparser) QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString); // dt.setDefaultLocale(QLocale::c()); ### Qt 6 if (dt.parseFormat(format)) @@ -4997,7 +4999,7 @@ QDateTime QDateTime::fromString(const QString& string, Qt::DateFormat format) QDateTime QDateTime::fromString(const QString &string, const QString &format) { -#if QT_CONFIG(timezone) +#if QT_CONFIG(datetimeparser) QTime time; QDate date; diff --git a/src/corelib/tools/qdatetimeparser.cpp b/src/corelib/tools/qdatetimeparser.cpp index 62dd25e072..3ddbc13fdf 100644 --- a/src/corelib/tools/qdatetimeparser.cpp +++ b/src/corelib/tools/qdatetimeparser.cpp @@ -58,8 +58,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_BOOTSTRAPPED - QDateTimeParser::~QDateTimeParser() { } @@ -1715,6 +1713,4 @@ bool operator==(const QDateTimeParser::SectionNode &s1, const QDateTimeParser::S return (s1.type == s2.type) && (s1.pos == s2.pos) && (s1.count == s2.count); } -#endif // QT_BOOTSTRAPPED - QT_END_NAMESPACE diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h index b50c88b4c1..39abdf555f 100644 --- a/src/corelib/tools/qdatetimeparser_p.h +++ b/src/corelib/tools/qdatetimeparser_p.h @@ -63,6 +63,8 @@ #include "QtCore/qvector.h" #include "QtCore/qcoreapplication.h" +QT_REQUIRE_CONFIG(datetimeparser); + #define QDATETIMEEDIT_TIME_MIN QTime(0, 0, 0, 0) #define QDATETIMEEDIT_TIME_MAX QTime(23, 59, 59, 999) #define QDATETIMEEDIT_DATE_MIN QDate(100, 1, 1) @@ -75,8 +77,6 @@ QT_BEGIN_NAMESPACE -#ifndef QT_BOOTSTRAPPED - class Q_CORE_EXPORT QDateTimeParser { Q_DECLARE_TR_FUNCTIONS(QDateTimeParser) @@ -287,8 +287,6 @@ Q_CORE_EXPORT bool operator==(const QDateTimeParser::SectionNode &s1, const QDat Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::Sections) Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeParser::FieldInfo) -#endif // QT_BOOTSTRAPPED - QT_END_NAMESPACE #endif // QDATETIME_P_H diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 63219b5bab..d65c84c09f 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -54,7 +54,9 @@ #include "qlocale.h" #include "qlocale_p.h" #include "qlocale_tools_p.h" +#if QT_CONFIG(datetimeparser) #include "qdatetimeparser_p.h" +#endif #include "qnamespace.h" #include "qdatetime.h" #include "qstringlist.h" @@ -1862,7 +1864,7 @@ QDateTime QLocale::toDateTime(const QString &string, FormatType format) const QTime QLocale::toTime(const QString &string, const QString &format) const { QTime time; -#ifndef QT_BOOTSTRAPPED +#if QT_CONFIG(datetimeparser) QDateTimeParser dt(QVariant::Time, QDateTimeParser::FromString); dt.setDefaultLocale(*this); if (dt.parseFormat(format)) @@ -1893,7 +1895,7 @@ QTime QLocale::toTime(const QString &string, const QString &format) const QDate QLocale::toDate(const QString &string, const QString &format) const { QDate date; -#ifndef QT_BOOTSTRAPPED +#if QT_CONFIG(datetimeparser) QDateTimeParser dt(QVariant::Date, QDateTimeParser::FromString); dt.setDefaultLocale(*this); if (dt.parseFormat(format)) @@ -1923,7 +1925,7 @@ QDate QLocale::toDate(const QString &string, const QString &format) const #ifndef QT_NO_DATESTRING QDateTime QLocale::toDateTime(const QString &string, const QString &format) const { -#ifndef QT_BOOTSTRAPPED +#if QT_CONFIG(datetimeparser) QTime time; QDate date; diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index b705d4221a..7ba3ff4a8b 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -21,7 +21,6 @@ HEADERS += \ tools/qcryptographichash.h \ tools/qdatetime.h \ tools/qdatetime_p.h \ - tools/qdatetimeparser_p.h \ tools/qdoublescanprint_p.h \ tools/qeasingcurve.h \ tools/qfreelist_p.h \ @@ -82,7 +81,6 @@ SOURCES += \ tools/qcollator.cpp \ tools/qcryptographichash.cpp \ tools/qdatetime.cpp \ - tools/qdatetimeparser.cpp \ tools/qeasingcurve.cpp \ tools/qfreelist.cpp \ tools/qhash.cpp \ @@ -170,6 +168,11 @@ qtConfig(timezone) { SOURCES += tools/qtimezoneprivate_icu.cpp } +qtConfig(datetimeparser) { + HEADERS += tools/qdatetimeparser_p.h + SOURCES += tools/qdatetimeparser.cpp +} + qtConfig(regularexpression) { QMAKE_USE_PRIVATE += pcre2 -- cgit v1.2.3 From 33693473d4bf6b28bee2d5fe740633d6867c26af Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Mon, 25 Sep 2017 19:17:02 +0800 Subject: Remove unnecessary copying in QSet::subtract() Task-number: QTBUG-42810 Change-Id: I5d4793a12b078e34bea034b4500e270d42609de0 Reviewed-by: Thiago Macieira --- src/corelib/tools/qset.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qset.h b/src/corelib/tools/qset.h index 08b38a08c2..7ded120ab7 100644 --- a/src/corelib/tools/qset.h +++ b/src/corelib/tools/qset.h @@ -340,13 +340,14 @@ Q_INLINE_TEMPLATE bool QSet::intersects(const QSet &other) const template Q_INLINE_TEMPLATE QSet &QSet::subtract(const QSet &other) { - QSet copy1(*this); - QSet copy2(other); - typename QSet::const_iterator i = copy1.constEnd(); - while (i != copy1.constBegin()) { - --i; - if (copy2.contains(*i)) + if (&other == this) { + clear(); + } else { + auto i = other.constEnd(); + while (i != other.constBegin()) { + --i; remove(*i); + } } return *this; } -- cgit v1.2.3 From d5ae3b1747f0b323847318e04fcd1677b66e91f1 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 25 Sep 2017 17:02:50 +0200 Subject: Reorder defines to respect alphabetic order in bootstrap config Apparently it's all meant to be in alphabetic order by feature name (except for where it isn't). So move my new addition to it to where that would put it, re-order everything else to follow that rule and add a comment documenting it. Change-Id: I6f00d3d18fc8c492992e9f701520f3e8731739b5 Reviewed-by: Oswald Buddenhagen --- src/corelib/global/qconfig-bootstrapped.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index 58a9ca918a..05a492fb96 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -66,8 +66,7 @@ #define QT_NO_USING_NAMESPACE #define QT_NO_DEPRECATED -#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 -#define QT_NO_DATASTREAM +// Keep feature-test macros in alphabetic order by feature name: #define QT_FEATURE_alloca 1 #define QT_FEATURE_alloca_h -1 #ifdef _WIN32 @@ -75,25 +74,27 @@ #else # define QT_FEATURE_alloca_malloc_h -1 #endif +#define QT_CRYPTOGRAPHICHASH_ONLY_SHA1 +#define QT_NO_DATASTREAM +#define QT_FEATURE_datetimeparser -1 +#define QT_NO_GEOM_VARIANT #define QT_FEATURE_iconv -1 #define QT_FEATURE_icu -1 #define QT_FEATURE_journald -1 #define QT_FEATURE_library -1 #define QT_NO_QOBJECT #define QT_FEATURE_process -1 -#define QT_NO_SYSTEMLOCALE +#define QT_FEATURE_sharedmemory -1 #define QT_FEATURE_slog2 -1 #define QT_FEATURE_syslog -1 +#define QT_NO_SYSTEMLOCALE +#define QT_FEATURE_systemsemaphore -1 #define QT_FEATURE_temporaryfile 1 #define QT_NO_THREAD #define QT_FEATURE_timezone -1 -#define QT_FEATURE_datetimeparser -1 #define QT_FEATURE_topleveldomain -1 #define QT_NO_TRANSLATION #define QT_FEATURE_translation -1 -#define QT_NO_GEOM_VARIANT -#define QT_FEATURE_sharedmemory -1 -#define QT_FEATURE_systemsemaphore -1 #ifdef QT_BUILD_QMAKE #define QT_FEATURE_commandlineparser -1 -- cgit v1.2.3 From 291233a8d05b79a19e3ae2951824d1c0444cbd27 Mon Sep 17 00:00:00 2001 From: Jake Petroules Date: Sun, 1 Oct 2017 16:34:33 -0700 Subject: Fix strict-prototypes warning with qVersion function This is enabled by default with Xcode 9 and would therefore be seen by anyone calling this function from C or Objective-C. Task-number: QTBUG-63450 Change-Id: Iecd67017b6774c9f2fce2433002ff852058dd3ed Reviewed-by: Thiago Macieira --- src/corelib/global/qglobal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 6023cc8564..35c35ac64d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -355,7 +355,7 @@ typedef double qreal; #if !defined(QT_NAMESPACE) && defined(__cplusplus) && !defined(Q_QDOC) extern "C" #endif -Q_CORE_EXPORT const char *qVersion() Q_DECL_NOTHROW; +Q_CORE_EXPORT const char *qVersion(void) Q_DECL_NOTHROW; #if defined(__cplusplus) -- cgit v1.2.3