summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/tqtc/lts-5.15.8' into ↵v5.15.8-lts-lgplTarja Sundqvist2022-11-111-9/+15
|\ | | | | | | | | | | tqtc/lts-5.15-opensource Change-Id: I569a2246c9e8d70430e8c5405b9f3df2218078ee
| * Add suffixes to loop variables for Q_FOREACHIevgenii Meshcheriakov2021-10-161-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently using nested Q_FOREACH loops produces warnings about shadowing local variables (if enabled). For example, this code: QList<int> aList; QList<int> bList; foreach (int a, aList) { Q_UNUSED(a); foreach (int b, bList) Q_UNUSED(b); } produces the following warning with MSVC: warning C4456: declaration of '_container_' hides previous local declaration This is due to using variable _container_ as loop variable for both loops. This patch appends current line number to the name of the loop variables so that most of the uses of Q_FOREACH will not result in shadowing. The patch originally by Benoit Regrain. Fixes: QTBUG-79081 Change-Id: I55235e917e920171b138c8b3239a95dfe2ac7988 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (adapted from commit 9940e4812ba3448a997cb8fb1b08187a84c797f2)
* | Revert "Update commercial license headers to src/concurrent and src/corelib"Tarja Sundqvist2021-03-231-20/+20
|/ | | | | | | | | | | This reverts commit b98b16de25dd5463342a2165a20b5fdc1cf9c32a. Revert of commercial license headers is required for Qt 5.15.3 opensource release. Task-number: QTBUG-91108 Change-Id: I51f2e169ec144ab9b902df2cff87eae60df53c57 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Update commercial license headers to src/concurrent and src/corelibTarja Sundqvist2021-01-281-20/+20
| | | | | | | | | | | | | | | | | | | Updated the header.COMM to the files under tqtc-qtbase/src/concurrent and tqtc-qtbase/src/corelib. Note! The following files are not updated: - the .qdoc files with the FDL license headers - the .cpp files with BSD license headers The commercial license header may contain some additional lines so that its line count equals with the earlier license header. Reason for this is that some autotests use hard coded line numbers and changing the line count would cause test failures. Task-number: QTQAINFRA-4154 Change-Id: I37a4dc8c89b0a84d78ca890a61e212966d8b20b5 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* Add the Qt 6.0 deprecation macrosGiuseppe D'Angelo2020-12-021-2/+10
| | | | | | | | | Will need to port QVariant to it. Change-Id: I9146129b1f772c3b028ae782f189aa4421f64b73 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit dac9548a67364eb1edd9ed6805369deac67ab9b1) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* qglobal: Only define QT_ENSURE_STACK_ALIGNED_FOR_SSE for i386Martin Storsjö2020-11-041-1/+1
| | | | | | | | | | | This define is only supposed to be used for i386, but was set for any 32 bit mingw architecture (which also covers armv7). Change-Id: Iedc057dfc493015e8339db837dbe20a57c2b2367 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 317145af84c055cf019c84b9090f53bd8c61c5da) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not #define dynamic_castGiuseppe D'Angelo2020-11-021-13/+0
| | | | | | | | | | | | | | It's illegal. [macro.names]/2: "A translation unit shall not #define or #undef names lexically identical to keywords" If someone tries to use dynamic_cast in a no-rtti scenario, let's just have the compiler yell at them for that. Change-Id: I70a7b55a93d34c433e874d379acae8b256620f80 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d3046cbe88c5db3e159076457ae012491c53461e) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Clarify warning message about PIC/PIEDaniel Kahn Gillmor2020-07-071-1/+1
| | | | | | | | | | | | | As noted in discussion at https://dev.gnupg.org/T4982#135524, when there is a mismatch between position-independence of the Qt library and other compilations, the warning produced by Qt is confusing. It should say explicitly that -fPIE should not be passed. Change-Id: I66394f86230a6598ac383bfd7bb14ab8cbbf6245 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 7f400522c39f6a1abf083dc1af49ea3109635cc8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Undef Q_DECL_ENUMERATOR_DEPRECATED when having no deprecation warningsAndy Shaw2020-06-181-0/+2
| | | | | | | | | | | | Since Q_DECL_ENUMERATOR_DEPRECATED can be explicitly set to something other than QT_DEPRECATED, then it needs to be explicitly undefined when QT_NO_DEPRECATED_WARNINGS is used to prevent it from showing a warning. Change-Id: Ibe73ff5e7b5aa5eff93d0c4c0a38a33855a9a330 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 59b03992ab332a320ac7cff7c5b099b2c30e14b2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Merge remote-tracking branch 'origin/5.14' into 5.15Qt Forward Merge Bot2020-01-151-1/+1
|\ | | | | | | Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
| * qglobal.h: remove non-ASCII quotes from commentThiago Macieira2020-01-131-1/+1
| | | | | | | | | | | | | | | | | | | | Because MSVC warns. Added by me on commit. c496fee2a5b65fd1b0672923293db058486e350e Fixes: QTBUG-81310 Change-Id: I596aec77785a4e4e84d5fffd15e93a8e367e035e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Merge remote-tracking branch 'origin/5.14' into 5.15Liang Qi2019-12-161-0/+6
|\| | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket.cpp src/widgets/kernel/qapplication.cpp Change-Id: Ib7421cc2df59d0969f89b3fbd65a17ea76ffef3b
| * qSwap: suppress pedantic warning about noexcept being falseThiago Macieira2019-12-121-0/+6
| | | | | | | | | | | | | | | | | | | | This warning is not in -Wall or -Wextra, but it happens in a single place, so we can reasonably suppress it. Fixes: QTBUG-79138 Change-Id: Ib5d667bf77a740c28d2efffd15ccb3f62cf8f431 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* | Deprecate qrand/qsrandAlbert Astals Cid2019-12-111-2/+4
|/ | | | | | | They have been marked as deprecated in the documentation for a while Change-Id: Ia2b0b6dbd4c525e3e9c4bc835eee2c9da5a938cb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-101-1/+1
| | | | | | | | | | | | | | | | | Using wrappers for these macros is problematic when for example passing the -frewrite-includes flag to preprocess sources before shipping off to distcc or Icecream. It will also start producing warnings when compilers implement http://eel.is/c++draft/cpp.cond#7.sentence-2. See for example https://reviews.llvm.org/D49091 Both https://clang.llvm.org/docs/LanguageExtensions.html and the SD-6 document at https://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations recommend defining '__has_foo(x) 0' as a fallback for compilers without the macros, so that's what we go for. Change-Id: I0298cd3b4a6ff6618821e34642a5ddd6728be767 Reviewed-by: Alex Richardson <arichardson.kde@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Goodbye showYellowThingTor Arne Vestbø2019-08-221-4/+0
| | | | | | | | | | The code hasn't been working for at least 5 years, and is just making the repaint manager more complex. We can always re-introduce the feature at a later point. Change-Id: Ib07c782c821f3e653f9452f6fbfe2f87effccc92 Fixes: QTBUG-36435 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Deprecate QStringViewLiteralMarc Mutz2019-08-101-0/+8
| | | | | | | | | | | | | | | | | As a macro, we can't directly deprecate it, but need to make it call something deprecated. That is a new ctor with a new enum type added. The type might be useful for other such ventures, so put it into qglobal.h Remove the QT_NO_UNICODE_LITERAL protection, as it's always false these days, and QT_UNICODE_LITERAL is unconditionally #defined a 20 lines above. [ChangeLog][QtCore][QStringView] Deprecated the (undocumented) QStringViewLiteral macro. Just use u"" or QStringView(u"") instead. Change-Id: I9141320225037e1bc6b7f920bf01a9d0144fdac2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Qt6: Fix uninitialized meta objects on WindowsThiago Macieira2019-07-161-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows has a problem relating to cross-DLL variable relocations: they are not supported. Since QMetaObject's link to the parent class is done via a pointer, every QMetaObject in a DLL or in the EXE that derives from a class from another DLL (such as QObject) will be dynamically initialized. This commit changes the meta object pointers in QMetaObject::d from raw pointers to a wrapper class SuperData, which is almost entirely source- compatible with the pointer itself. On all systems except for Windows with Qt 6, it's binary compatible with the current implementation. But for Windows with Qt 6, this commit will store both the raw pointer and a pointer to a function that returns the QMetaObject, with one of them non-null only. For all meta objects constructed by moc, we store the function pointer, which allows the staticMetaObject to be statically intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml, ActiveQt), we'll store the actual raw pointer. [ChangeLog][QtCore][QMetaObject] Some internal members of the QMetaObject class have changed types. Those members are not public API and thus should not cause source incompatibilities. The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in commit 24a72c4efa929648d3afd95b3c269a95ecf46e57 ("qglobal: Remove symbian specific features"). Task-number: QTBUG-38876 Fixes: QTBUG-69963 Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Centralize the MSVC work-around for std::is_permutationMarc Mutz2019-07-121-0/+23
| | | | | | | | | | | | There's currently only one user, but another one is coming up, so apply DRY and centralize the work-around for the MSVC warning C4996 on use of 3-arg STL algorithms in one place. The code is prepared to handle other algorithms with ease, should any more crop up. Change-Id: Ia881888d6a2b5286c6d8d823bc2b76788efad624 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix deep-const-correctness of qGetPtrHelper() for smart pointersMarc Mutz2019-06-151-1/+1
| | | | | | | | | | | | | | | | | | | The function qGetPtrHelper() is mainly used to implement d_func() within the Q_DECLARE_PRIVATE() macro. The whole purpose of d_func() is to propagate const deeply. But if a smart pointer implements this by itself, then the old version of qGetPtrHelper(), by taking the Ptr as a const-&, would always return a const payload pointer, which would fail in the following reinterpret_cast in d_func() to mutable payloads. This was found while experimenting with making QExplicitlySharedDataPointer deep const-correct, and I have no explanation why it seems to have worked with QSharedDataPointer, which is deep-const-correct already. Change-Id: Iee2e8fcce89c58ba2af7818de6f79ed39c5a4030 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix definition of QT_DEPRECATED_SINCEKai Koehne2019-06-041-1/+1
| | | | | | | | | | | | Otherwise any use of QT_DEPRECATED_SINCE will cause a warning: src/corelib/global/qglobal.h:382:77: error: expected unqualified-id before ‘)’ token This amends 220028d37c Change-Id: Ifa2be1dd8852e4aac0db83b0b4ae15d2f666c550 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Short live qExchange()!Marc Mutz2019-05-141-0/+9
| | | | | | | | | | | This is a 1:1 replacement for std::exchange, and should be removed once Qt fully depends on C++14. It's too versatile a tool to miss it, so provide a copy. [ChangeLog][QtCore][QtGlobal] Added qExchange(), a drop-in for C++14's std::exchange() Change-Id: I31c4f1141e7a99f99ea65eb36ddf9d68b7847337 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add warning suppression for icc when comparing floating-point valuesEdward Welbourne2019-05-071-0/+1
| | | | | | | | | | | The new implementations of qIsNull use naked floating point comparisons to 0 and suppress the warnings for clang and gcc; so add suppression also for icc. Fixes: QTBUG-75644 Change-Id: I59aa1443666a542f38197f2b124503cc562708cb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* qIsNull: redo implementationGiuseppe D'Angelo2019-05-021-26/+10
| | | | | | | | | | | | | | | The reason for using type-punning through an integer was to avoid compiler warnings about float comparisons. We have now a better mechanism to suppress such warnings, so there is no need to be "clever" and trigger UB because of the union usage. Drive-by change: add constexpr+noexcept because now there's no longer UB. Change-Id: I29f7514e39055658d4ef6c431daf5abfc660df16 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing =delete and =default supportAllan Sandfeld Jensen2019-05-021-3/+3
| | | | | Change-Id: I006dfd0b7cfa3bda5e5ab01bcefa851f031dfe0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing Q_COMPILER_RVALUE_REFSAllan Sandfeld Jensen2019-05-011-4/+1
| | | | | | | | Remove remaining handling of missing support for rvalue refs. Change-Id: I78bab8bccfeeb9c76f464f345874364a37e4840a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtBase: introduce QT_DEPRECATED_VERSION/QT_DEPRECATED_VERSION_XChristian Ehrlicher2019-04-251-0/+53
| | | | | | | | | | | | | | | | | | | | | | QT_DEPRECATED_VERSION(major, minor) and QT_DEPRECATED_VERSION_X(major, minor, text) outputs a deprecation warning if QT_DEPRECATED_WARNINGS_SINCE is equal or greater than the version specified as major, minor. This allows the user to hide deprecation warnings which can't yet be fixed for their codebase because the minimum required Qt version does not provide the replacement function. If QT_DEPRECATED_WARNINGS_SINCE is not set by the user, it's set to QT_DISABLE_DEPRECATED_BEFORE if available, otherwise to QT_VERSION. [ChangeLog][QtCore][QtGlobal] Add new macros QT_DEPRECATED_VERSION and QT_DEPRECATED_VERSION_X to conditionally display deprecation warnings Change-Id: I61b1a7624c9b870695c9e3274313de636f804b5d Reviewed-by: Konstantin Shegunov <kshegunov@gmail.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: hjk <hjk@qt.io>
* Merge "Merge remote-tracking branch 'origin/5.13' into dev" into ↵Qt Forward Merge Bot2019-04-041-16/+16
|\ | | | | | | refs/staging/dev
| * Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-031-16/+16
| | | | | | | | | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-041-2/+2
|/ | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Enable deprecation warnings by defaultGiuseppe D'Angelo2019-02-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | With Qt 6 in sight, people need to start moving away from their deprecated APIs, as we want to remove them all in 6.0. We are marking deprecated APIs with deprecation attributes, but by default we're disabling deprecation warnings, making them an opt-in by the user. We need to do the opposite: make deprecation warnings enabled by default, and have an opt-out define. [ChangeLog][QtCore][Important Behavior Changes] Qt now enables by default warnings when using APIs marked as deprecated. It is possible to disable such warnings by defining the QT_NO_DEPRECATED_WARNINGS macro. The old QT_DEPRECATED_WARNINGS macro which was used to enable this warning now has no effect (warnings are automatically enabled). Task-number: QTBUG-73048 Change-Id: Ie2b024fd667eb876b6ac9054cbbbc5a455cb9d5c Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.12' into devQt Forward Merge Bot2019-01-211-4/+10
|\ | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: Ibfcb30053f3aacb8ec2ec480e146538c9bf440ea
| * Fix alignment-warnings about Q_DECLARE_PRIVATE's castsEdward Welbourne2019-01-151-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_DECLARE_PRIVATE gets used in the declaration of the public class, where the private class is typically visible only as a forward-decl, with no knowledge of what it's based on; consequently, the macro is obliged to use reinterpret_cast<>, which is subject to warnings when the compiler *can* see both types and their alignments differ. The same applies to Q_DECLARE_PRIVATE_D. So suppress gcc's -Wcast-align around the d_func() return statements. (If we get similar problems with other compilers we can add their suppressions likewise; but, for now, we've only seen this on MIPS64, where we use gcc.) This tripped over one use of Q_DECLARE_PRIVATE in a private Q_SLOTS: section; for some reason, gcc didn't like the semicolon on the friend declaration. Changing the context to plain private fixed that. Fixes: QTBUG-72885 Change-Id: I5edc11d46bd4eb820713adede79d53191a7e2736 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Boxiang Sun <daetalusun@gmail.com>
* | Long live Q_DISABLE_COPY_MOVE!Friedemann Kleint2018-11-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using Q_DISABLE_COPY, clang-tidy reports: warning: class 'Foo' defines a non-default destructor, a copy constructor and a copy assignment operator but does not define a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions] Add convenience macros to suppress move constructor/assignment as well. [ChangeLog][QtCore] Added macros Q_DISABLE_MOVE and Q_DISABLE_COPY_MOVE complementing Q_DISABLE_COPY. Change-Id: I0b07495ef4ef06c714f7368c706168613c3fe7bc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* | Simplify the Q_FOREACH macro when using C++17Olivier Goffart2018-10-311-1/+10
| | | | | | | | | | | | | | This way there is only one for loop, which is more optimizer friendly Change-Id: Iaa02026627d5259c3eea1ff5664e8f22664eef73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove QConditional in favor of std::conditional/std::is_unsignedMikhail Svetkin2018-09-051-3/+0
| | | | | | | | | | Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Mark qBound/qMin/qMax as constexprMikhail Svetkin2018-08-221-3/+3
|/ | | | | | | On MSVC2015 Q_DECL_CONSTEXPR is defined as empty. Change-Id: I8beb919f75cf2066ffc7ac10d5abfaa1712fc1bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QT_TR*_N_NOOP() macrosMateusz Starzycki2018-05-151-0/+4
| | | | | | | | | | [ChangeLog][QtCore][Global] Added the QT_TR_N_NOOP(), QT_TRANSLATE_N_NOOP(), and QT_TRANSLATE_N_NOOP3() macros for numeral dependent delayed translation. Change-Id: I57c5b1ad4006267f49a57b0cbc40216b8e0399ff Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io>
* Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-04-261-1/+1
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Ideea96d1b43d47b1d9b34e11c9986a88e240aa71
| * improve documentation, mostly of the QT_TR*_NOOP macrosOswald Buddenhagen2018-04-251-1/+1
| | | | | | | | | | | | | | | | Change-Id: I65ccddec84a01945a6aee2a859d4f92ea830785b Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Mateusz Starzycki <mstarzycki@gmail.com> Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Support std::unique_ptr and others in Q_DECLARE_PRIVATEJüri Valdmann2018-04-251-2/+2
|/ | | | | | | | | | Use ptr.operator->() instead of ptr.data() for getting the raw pointer. [ChangeLog][QtCore][QtGlobal] Q_DECLARE_PRIVATE can now be used with std::unique_ptr and other smart pointer types. Change-Id: I7f3f698d7bac477f2185837681e366057d292588 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* q{,Utf8}Printable: avoid creating a copy of a QStringThiago Macieira2018-03-181-2/+3
| | | | | | | | | | | | | | | | | We have this QString() constructor call to permit things that convert to QString but aren't QString to be used in qPrintable, like a QStringBuilder-powered fast operator+ expression, like: qPrintable(string1 + ": " + string2) Unfortunately, it meant that we unnecessarily created a QString copy if the input was already QString. Change-Id: Iecab8770aa5840aba8edfffd1516bc94cec791a9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.h: compile Q_UINT64_C in C modeThiago Macieira2018-03-171-0/+5
| | | | | | | This is used by qfloat_f16c.c → qsimd_p.h → qsimd_x86_p.h. Change-Id: I359898686ce545f69847fffd151c785237a54b94 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* moc: Only use the init_priority attribute when targeting windowsMartin Storsjö2018-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | While both GCC and the GCC compatible clang support this attribute in general, GCC doesn't support it when targeting macOS, ending up with errors like these: error: 'init_priority' attribute is not supported on this platform This error isn't a property of the platform itself though, since clang supports the attribute just fine on macOS. The attribute is only used to work around an issue with dllimport on windows, so limit its use to that platform, to avoid issues with it potentially being unsupported on platforms other than macOS as well. This fixes compiling with GCC for macOS. Change-Id: I0235e6365635d73233951566c10ad869b26a0fc6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce QT6_VIRTUAL and QT6_NOT_VIRTUAL macrosSergio Martins2018-02-051-0/+5
| | | | | | | To avoid QT_VERSION_CHECK ifdefs Change-Id: I364903964c72f4df19b8b7c10c19b82d24f63600 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-1/+1
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
| * Only define QT_FASTCALL on x86_32Martin Storsjö2018-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The __fastcall calling convention is silently ignored on other architectures. The GNU attribute regparm is allowed but doesn't make sense on x86_64. On other architectures, the attribute isn't supported at all. This fixes building with clang for MinGW/ARM and ARM64. Change-Id: Ice1c6eadd0e90b2e5e34736542ee49a25dc67fe6 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-111-0/+6
|\| | | | | | | | | | | | | | | | | Conflicts: src/3rdparty/harfbuzz-ng/src/hb-private.hh src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/sql/doc/src/sql-driver.qdoc Change-Id: I38f0e82fcd37926cbf3c1915e009a731040d4598
| * moc: Initialize staticMetaObject with the highest user-settable priorityMartin Storsjö2018-01-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The referenced static meta object for the superclass might be in a different DLL. In this case, the whole QMetaObject can't be initialized all via preinitialized data in the data section of the binary, but must run code at runtime to fill in the value of the dllimported pointer. In these cases, both GCC and MSVC initialize as much as possible statically, while only filling in the dllimported values (QMetaObject::d::superdata) at runtime. Clang, on the other side, initializes the whole struct at runtime if some part of it needs runtime initialization, leaving the struct completely uninitialized before constructors are run. In C++, there are no guarantees for in what order constructors in different translation units are executed. This in particular means that there are no guarantees as to whether qRegisterWidgetsVariant() in qwidgetsvariants.cpp runs before or after the runtime initialization of QWidget::staticMetaObject. With GCC and MSVC, this doesn't seem to have mattered since only the superdata pointer of the staticMetaObject was uninitialized - everything else was initialized, and the superdata pointer doesn't seem to be accessed during qRegisterWidgetsVariant. With clang, the whole staticMetaObject is uninitialized, unless the staticMetaObject has been initialized before (and the initialization order is undefined). By setting a manual priority (which is a GCC extension that also clang supports) for the staticMetaObjects, we can be sure that these are initialized before the actual explicit constructor invocations (without any explicit initialization priority) that can access the staticMetaObjects. Change-Id: I64a82f12d690528567509791bae088b6304e189b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | doc: Remove unnecessary qdoc declaration hackMartin Smith2018-01-091-5/+1
| | | | | | | | | | | | | | A special declaration for qdoc was no longer needed. Change-Id: Ib3486be5c016d57cf09ef89fc8df29045fef0577 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>