summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal.h
Commit message (Collapse)AuthorAgeFilesLines
* Make version_tagging the full-functional featureAlexey Edelev2 days1-1/+2
| | | | | | | | | | This feature allows to explicitly disable the version tagging for Qt libraries and have the precise feature-based guarding in C++ code. Task-number: QTBUG-124346 Change-Id: If109adb2f6a998c58825a2449cfb936ea278b2ad Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qglobal.h: centralize the __ASSEMBLER__ checkThiago Macieira2023-01-111-6/+7
| | | | | | | | | | | | | | | | | We can declare that headers like qtnoop.h and qtypes.h are C or C++ headers, not assembler ones so we don't need to have them individually check that whether they're being compiled in assembler mode. This removes the accidental leak of the qt_noop() declaration into assembler and makes it clean: $ cpp -P -D__ASSEMBLER__ -Iinclude include/QtCore/qglobal.h | grep -c . 0 (using grep because it prints four empty lines) Change-Id: I69ecc04064514f939896fffd172e3fd6b6adc892 Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qglobal.h: remove __ASSEMBLER__ checkMarc Mutz2022-12-081-2/+0
| | | | | | | | | __ASSEMBLER__ and __cplusplus cannot both be defined at the same time, so it suffices to check just one of them. Thanks to Thiago for noticing. Change-Id: I92e43d1a1c551ee48c51490b2878bb0c84bfb36f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move qVersion() into it's own headerMarc Mutz2022-12-081-0/+1
| | | | | | | | | | | | | | | | | | | | Partially reverts 50b05e3e2ad969abf4b939d5db2253380e47d775. The move of qVersion() from qglobal.h into qlibraryinfo.h, a header not included by qglobal.h, was a conscious, documented, QUIP-0006- allowed, but stetching the SiC Type A definition, and therefore unwarranted, SiC. Fix by moving qVersion() into its own header file, qtversion.h, included from qglobal.h. [ChangeLog][Editorial] Remove the entry for qVersion() being moved to qlibraryinfo.h. Fixes: QTBUG-108818 Change-Id: I3524802348635512a63fbbb55ddc28ad28f331e8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Move qt_noop() into a separate headerIvan Solovev2022-10-061-1/+1
| | | | | | | | | This was the last function left in qglobal.h. Task-number: QTBUG-106154 Task-number: QTBUG-99313 Change-Id: I6b16744b2811b7ca9837742610d72b85da7c76b2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move the rest of macros from qglobal to QtPreprocessorSupportIvan Solovev2022-10-061-16/+1
| | | | | | | | | | | | | | | | We had only three macros left in QtGlobal: * QT_STRINGIFY * Q_UNUSED() * Q_UNIMPLEMENTED() There is no obvious existing header for them, so a new header is created. As a drive-by: add documentation for QT_STRINGIFY. Task-number: QTBUG-106154 Task-number: QTBUG-99313 Change-Id: I2d051dd3e69f13602893a0f0d6968419479b6c23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move qAsConst() and qExchange() to QtTypeTraitsIvan Solovev2022-10-061-18/+0
| | | | | | | | | | | | It's the least worst place we could think of. Add the qttypetraits.h include to qforeach, because otherwise the tests fail to build. Task-number: QTBUG-106154 Task-number: QTBUG-99313 Change-Id: I841f22e887f351146589377ec2376957e2adfd5e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFunctionPointer typedef to a separate headerIvan Solovev2022-10-061-5/+1
| | | | | | | | Task-number: QTBUG-99313 Task-number: QTBUG-106154 Change-Id: I8c62e5c2c2f80d5ce1d4dce69eebbe7d1ebbfd52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rename the header qtypetraits.h -> qttypetraits.hSona Kurazyan2022-09-301-1/+1
| | | | | Change-Id: I6a487543730678190eb9581d45f3ec12c441756a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename the header qtranslation.h -> qttranslation.hSona Kurazyan2022-09-301-1/+1
| | | | | | Change-Id: I0e78e2e7cddfb98ff3ed50edf6b567c7f0207008 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rename the header qenvironmentvariables.h -> qtenvironmentvariables.hSona Kurazyan2022-09-301-1/+1
| | | | | | Change-Id: I8153c856c2cd93ec6932cd7dd5e9d7273d5712dd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move qVersion() from qglobal.h to qlibraryinfo.hSona Kurazyan2022-09-011-13/+0
| | | | | | | | | | | | | | | Since qVersion() might be called also from C code, disable the parts of qlibraryinfo.h that are relevant only for C++ code if __cplusplus is not defined. [ChangeLog][Potentially Source-Incompatible Changes] qVersion() is moved from qglobal.h to qlibraryinfo.h, '#include <QtCore/QLibraryInfo>' needs to be added where it's used. Task-number: QTBUG-99313 Change-Id: I3363ef3fa4073114e5151cb3a2a1e8282ad42a4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-011-15/+0
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Extract header qdarwinhelpers.h from qglobal.hSona Kurazyan2022-08-301-24/+1
| | | | | | | Task-number: QTBUG-99313 Change-Id: Ia25270d381de99c5fcbb205d750e7bf86d4438dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QT_ASCII_CAST_WARN macro from qglobal.h to qtdeprecationmarkers.hSona Kurazyan2022-08-301-7/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: I6449f519db3f67ed3d390295b8fa93eff28d7cda Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move definition of QT_DEBUG from qglobal.h to qtconfigmacros.hSona Kurazyan2022-08-301-8/+0
| | | | | | Task-number: QTBUG-99313 Change-Id: I0bb9bcabbfff5b6d97a6473dbbcd47eb46d1fd3d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Move qSharedBuild() from qglobal.h to qlibraryinfo.hSona Kurazyan2022-08-291-2/+0
| | | | | | | | | | | [ChangeLog][Potentially Source-Incompatible Changes] qSharedBuild() is moved from qglobal.h to qlibraryinfo.h, '#include <QtCore/QLibraryInfo>' needs to be added where it's used. Task-number: QTBUG-99313 Change-Id: Ic64561a8eb129ba2934e2770ca02119de208a2a5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Yuhang Zhao <2546789017@qq.com>
* Move definition of QT_MOC_COMPAT from qgloabl.h to qtconfigmacros.hSona Kurazyan2022-08-251-8/+0
| | | | | | Task-number: QTBUG-99313 Change-Id: I331aa5f1805a7e774d0fe8b819720c17767670b0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qmalloc.h from qglobal.hSona Kurazyan2022-08-251-4/+1
| | | | | | | | | Definitions of qMallocAligned()/qReallocAligned()/qFreeAligned() were already in qmalloc.cpp, so add qmalloc.h for declarations. Task-number: QTBUG-99313 Change-Id: I8028402a2c48dede855ad7de35d7b77e9911c761 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qtypetraits.h from qglobal.hSona Kurazyan2022-08-251-7/+1
| | | | | | Task-number: QTBUG-99313 Change-Id: I6cb76607213ca5d64dec669a39e8a59e13b21497 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qswap.h from qglobal.hSona Kurazyan2022-08-251-35/+1
| | | | | | | | And move qSwap() docs from qalgorithms.qdoc to qswap.qdoc. Task-number: QTBUG-99313 Change-Id: I2385d5162a8dbb2de51a0c0509eced77b6a17159 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qtresource.h from qglobal.hSona Kurazyan2022-08-251-7/+1
| | | | | | Task-number: QTBUG-99313 Change-Id: I4dd219dcb9181bf23feb6639821764cd5dc19a24 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qconstructormacros.h from qglobal.hSona Kurazyan2022-08-251-22/+1
| | | | | | Task-number: QTBUG-99313 Change-Id: I3861a3095148c7927aabd8becf6f7b534f214fba Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove QT_MODULE defineSona Kurazyan2022-08-241-2/+0
| | | | | | | This doesn't seem to be used in any of the modules. Change-Id: I5c007f50bdd9f5ed5f512606a0d4599593c6b40e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_AUTOTEST_EXPORT to qtconfigmacros.hSona Kurazyan2022-08-241-21/+0
| | | | | | | | | The include statements for qconfig*.h can now be moved there too. Task-number: QTBUG-99313 Change-Id: I65f564fc48b9074861b0f8b50046062c2e83090c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move warning suppression macros from qglobal.h to qcompilerdetection.hSona Kurazyan2022-08-191-14/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: I54f1c48591b448a7b697720018e565a8c865a18b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qtclasshelpermacros.hSona Kurazyan2022-08-191-104/+1
| | | | | | | | | | Move the class helper macros from qglobal.h and Q_DECLARE_SHARED from qtypeinfo.h there. Task-number: QTBUG-99313 Change-Id: I8c8b6241a76916176a48c09fbaf4effc87683770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Extract header qexceptionhandling.h from qglobal.hSona Kurazyan2022-08-191-26/+1
| | | | | | | | | | | As a drive-by, remove the unused include for std::bad_alloc from qglobal.cpp. Task-number: QTBUG-99313 Change-Id: I4b26b4413e6fe7ac3b1e285d0db5b81b429a4713 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move QT_NO_EXCEPTIONS define to qcompilerdetection.hSona Kurazyan2022-08-191-12/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: I952267f18fd7ed001162aba7589c0040dbb9560e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move macros for Darwin-based operating systems to qsystemdetection.hSona Kurazyan2022-08-131-51/+0
| | | | | | | | Task-number: QTBUG-99313 Change-Id: I5198baa1369e296cd06db964a6286978bb874859 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move the checks for disabling useless warnings to qcompilerdetection.hSona Kurazyan2022-08-131-31/+0
| | | | | | Task-number: QTBUG-99313 Change-Id: I7b4a62e7a8f8a07a9386a6f1f41a33c3fc802daf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_{OUTOFLINE, INLINE}_TEMPLATE definitions to qcompilerdetection.hSona Kurazyan2022-08-131-7/+0
| | | | | | | | | | These seem to be leftovers after 475cef58f96d1d274e5c7b448df7231415783af0. Task-number: QTBUG-99313 Change-Id: I6059cfe1ea0a0f85e3617338215effb114d3b60b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move some compiler-specific macros to qcompilerdetection.hSona Kurazyan2022-08-131-68/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: Ia381fc0242090ee08ae734421274dcef15709778 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Move Q_OF_ELF/Q_OF_MACH_O macros to qsystemdetection.hSona Kurazyan2022-08-111-7/+0
| | | | | | | | | Task-number: QTBUG-99313 Change-Id: I373fad6f8339a0bad1ebc5d81386b18794bf32cc Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move Qt 6/7 specific macros to qtversionchecks.hSona Kurazyan2022-08-111-52/+0
| | | | | | Task-number: QTBUG-99313 Change-Id: I57032bf5d0edcb7345267512e12837b1d90d1485 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move qMin/qMax/qBound() to a separate qminmax.h headerIvan Solovev2022-08-111-67/+1
| | | | | | | | | | | | | Also replaced qMin() uses in qnumeric.h with QtPrivate::min(). Including qassert.h in qminmax.h leads to indirect include of qglobal.h (through qcompilerdetection.h), which in turn leads to qMin() declaration not being available at the point the compiler sees qFuzzyCompare() definitions in qnumeric.h. This makes the headersclean build fail. Task-number: QTBUG-99313 Change-Id: I824422698b06f94a4a62e2f19d4507c87f90334e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Extract header qtypes.h from qglobal.hSona Kurazyan2022-08-111-134/+1
| | | | | | | | | | | And move the related checks from qglobal.cpp to qtypes.cpp. This requires removing the unnecessary include statement for qglobal.h from qprocessordetection.h, that now needs to be included in qtypes.h. Task-number: QTBUG-99313 Change-Id: Ifd72b956326909be82c162f37854cad0878010e2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_STATIC_ASSERT* macros to qassert.hSona Kurazyan2022-08-111-29/+4
| | | | | | | | | | | | | | This requires moving the include statement for qassert.h in qglobal.h up, outside the #if defined(__cplusplus) check, to make the macros available when __cplusplus isn't defined. Also move qt_noop() up, before the include of qassert.h, this will later go to a separate header. Task-number: QTBUG-99313 Change-Id: I0f3f1ca77819a86623eebaf8adeba226c190fd37 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QT_SHARED, QT_STATIC and QT_CONFIG macos to qtconfigmacros.hSona Kurazyan2022-08-111-39/+1
| | | | | | | Change-Id: Icf4621fa22f41355f98ed38b47560706258b41b7 Pick-to: 6.4 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Rename qtnamespacemacros.h -> qtconfigmacros.hSona Kurazyan2022-08-111-1/+1
| | | | | | | | | | | But keep qtnamespacemacros.h for now, some modules include it explicitly, so need to change those to include qtconfigmacros.h first. The plan is to move QT_SHARED, QT_STATIC and QT_CONFIG macros there too. Change-Id: I945b3dfffbd9cd394a6cf42a36df6657d1703d5b Pick-to: 6.4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove redundant define for QT_LARGEFILE_SUPPORTSona Kurazyan2022-08-101-4/+0
| | | | | | | | It's unconditionally set in qconfig.h by configure.cmake. Pick-to: 6.4 6.3 6.2 Change-Id: If10b5a34111856f4c279a1cf7bfc4ea3a995ef2b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QT6_CALL_NEW_OVERLOAD_TAILIvan Solovev2022-08-091-1/+1
| | | | | | | | | | | There was a typo in the used macro name. This commit amends 0a3ff697380555538a0d035b768ddf10f772b55a Pick-to: 6.4 Change-Id: I6b8cb1e3872cb96780af26bfaf722d83d17ba4fe Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move Q_CHECK_PTR and related helpers to qassert.hSona Kurazyan2022-08-051-17/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: Ia4152f0aad15975d8aebbbc506c8a76c8fbe144f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix generation of the forward header for QFunctionPointerSona Kurazyan2022-08-051-0/+3
| | | | | | | | | | | | | | The forward header for QFunctionPointer was being generated by accident, apparently syncqt is confused because of some of the preceding lines. If the lines are rearranged or removed, the header won't be generated. Not sure if there's much value in generating a header for it, but at least one of Qt sources (qeglfsemulatorintegration.h) is using it in an include statment, and there's a chance it's used in the user code as well. Change-Id: Iced505881ddb07e7a8336fcdfb7d3e5397c6466c Pick-to: 6.4 6.3 6.2 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qassert.h from qglobal.hSona Kurazyan2022-08-051-27/+3
| | | | | | | | | | | | For now qassert.h is included in the middle of qglobal.h, since some of the code below needs it, but this will be cleaned up when that code is moved in its own header. Task-number: QTBUG-99313 Change-Id: I2cdfed44f5c8772c1dad4797cf8edc6cb4c964b4 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Move qt_error_string to qlogging.hSona Kurazyan2022-08-051-4/+0
| | | | | | | | | | qcontainerfwd.h was relying on the forward declaration of QString in qglobal.h, so add the missing forward declaration there. Task-number: QTBUG-99313 Change-Id: Id3ecaed5ce3b64dabb8454647a43d1520d30e713 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move q{,Utf8, Utf16}Printable to qstring.hSona Kurazyan2022-08-041-18/+0
| | | | | | | Task-number: QTBUG-99313 Change-Id: I76ef84e4c90ab04a3e04c165ba46800e27ea6122 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Disable constinit for MSVC compilersOliver Wolff2022-08-031-6/+3
| | | | | | | | | | | | | | https://developercommunity.visualstudio.com/t/C:-constinit-for-an-optional-fails-if-/1406069 does not only affect constinit thread_local but also constinit in general on MSVC compilers when C++20 is being used. So disable the feature for these compilers in general for now. This commit amends d9531593a248e19f7da7862b2870a6af2f413e75 Fixes: QTBUG-105234 Pick-to: 6.4 Change-Id: I1855f0857d85487895460fc7c56675fb864bfa73 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qUtf16Printable: avoid creating a copy of a QStringSona Kurazyan2022-08-021-1/+1
| | | | | | | | Amends daa7f5375c58464bbe92744599f1e2258445e259. Change-Id: I569efc4556341bfbce452bdf169c50a3b4be9ca7 Pick-to: 6.4 6.3 6.2 5.15 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qtdeprecationmarkers.h from qglobal.hSona Kurazyan2022-07-311-266/+1
| | | | | | Task-number: QTBUG-99313 Change-Id: Ief3d7ddb9dc0962bd3404f1fe61d292f2fe434cc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>