summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qglobal_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Unconditionally use Q_NORETURN for qAbort()Kai Köhne2023-05-091-4/+1
| | | | | | | | | The exception for MSVC was probably added due to similar logic in qlogging.h, but in this case, qAbort never returns also with MSVC. Change-Id: Ica2155c34d4b32b20af5b1fcb5af35bb3ff6f668 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove time-related functions from qglobal_p.hEdward Welbourne2023-02-131-1/+0
| | | | | | | | Recently removed to qtenvironmentvariables_p.h, so #included that while qtdeclarative adjusted its one client's #include. Change-Id: I4ed8f69f009996d6a2856e2f4e0bb861a104931c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move qtLocalTime() to qtenvironmentvariables.cpp as qLocalTime()Edward Welbourne2023-02-031-10/+1
| | | | | | | | | | | | | | | The new name better matches the names of existing functions there. A comment on the old code noted that such a move should really be done, so as to correctly share the environment-mutex locking. In the process, move the (now three) time-related internal functions from qglobal_p.h to a new qtenvironmentvariables_p.h since that's the natural place for them given where they're defined (and the fact that they're for internal use only). Change-Id: Ib028baebaf31a806a2c0c97caaaba0a466c11cea Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix clang-cl compiler warningsPeter Varga2022-12-151-1/+1
| | | | | | | | | | | | - known but unsupported action 'shared' for '#pragma section' [-Wignored-pragmas] - #include resolved using non-portable Microsoft search rules [-Wmicrosoft-include] - variable is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] Change-Id: I466352ff97a2bcf07e706c045568e581dd08a94e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Disable init prioritization in QNXAlexey Edelev2022-03-171-0/+3
| | | | | | | | This fixes issue with non working QHash when loading QML plugins in QNX. Change-Id: I55c9edc58aa27cff694603e6281c980e1fedbeba Taks-number: QTBUG-101341 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q_DECL_INIT_PRIORITY: make the initializers actually runThiago Macieira2022-03-151-1/+6
| | | | | | | | The runtime runs the function pointers located between subsections $XCA and $XCZ only, so using $QT meant it would never get run. Change-Id: Ibf4acec0f166495998f7fffd16d8ecb19019ce10 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qglobal_p.h: move QT_SUPPORTS_INIT_PRIORITY to outside the C++ sectionThiago Macieira2022-02-191-8/+8
| | | | | Change-Id: Ic15405335d804bdea761fffd16d50d9c5fc5e237 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* qsimd: Initialize the current state as soon as QtCore loadsThiago Macieira2022-02-171-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of lazily initializing. We usually don't do this in Qt, but in this case there are two very good reasons for it: 1) the call tp qCpuFeatures() was not trivial, with the need to preserve a bit of state in the caller function across the call. GCC appeared to generate better code than Clang in this regard, but it still implied more cost than we'd like to do runtime detection in performance-sensitive places in Qt. 2) the early initialization allows us to use the detected state in GNU indirect functions on platforms that support it. In order to do this, I had to rewrite the QT_NO_CPU_FEATURE environment variable parsing without QByteArray and instead rely on string.h's strtok(). This can't be done for static Qt builds on platforms that don't support the GNU init_priority variable attribute or the MSVC equivalent[1], because otherwise we can't guarantee that this bit of code runs before everything else in Qt. For those platforms, we keep the existing lazy initialization. For shared builds in those platforms, we can use the dynamic initialization. All known linkers will sort the static initialization code in the order in which the .cpp are linked into the library. The x86 QSimdInitialized variable will be removed in the next commit. [1] https://docs.microsoft.com/en-us/cpp/preprocessor/init-seg?view=msvc-170 Change-Id: I6fcda969a9e9427198bffffd16ce885a27f6b9e2 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Add private qAbort helper functionTor Arne Vestbø2021-09-221-0/+5
| | | | | | | Used from qt_message_fatal(), but is useful in other situations too. Change-Id: I3c0e438536d40271061c76d954c7878abfe37b8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't wrap feature detection macros with QT_HAS_FOO() variantsTor Arne Vestbø2019-12-101-2/+2
| | | | | | | | | | | | | | | | | 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>
* MinGW: Fix developer buildFriedemann Kleint2019-04-181-0/+3
| | | | | | | | | | | In some build configurations, the build with MinGW would fail due to missing declaration of localtime_r(). This is only visible when _POSIX_THREAD_SAFE_FUNCTIONS is defined, which is achieved by including <unistd.h>. Amends 6c543879a31d7d13a6b87e6332f6913f2f89f5e6. Task-number: QTBUG-71030 Change-Id: I71296f24a450159d1c548e1ad836a2b42e42009f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid races on TZ in environment via tzset() callsEdward Welbourne2018-10-221-0/+10
| | | | | | | | | | | | | | | | | | | POSIX specifies that tzset() consults environment variable TZ and modifies some globals; it also specifies mktime(), localtime() and strftime() to behave as if they called tzset(). Fortunately, we only call strftime() from a test and only call localtime() when not threaded. Provide wrappers for tzset() and mktime() that share the lock used by our environment-access code, to prevent races on the environment (and tzset()'s globals) when we call them. In the process, re-use tst_QDateTime's TimeZoneRollback in its older test systemTimeZoneChange() and presume that this can now be tested cross-platform, since TimeZoneRollback is used in another test where this works. Fixes: QTBUG-71030 Change-Id: I79f559b8857ea2803e73501008bf0d7158c6731f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a "shim" to allow use of Clang 5's __builtin_available everywhereJake Petroules2017-09-271-0/+73
| | | | | | | | | | This is mostly relevant for Apple platforms, where we can use the new unguarded availability warnings to guarantee that proper version checks are present when using APIs that are not necessarily available on the deployment target. Change-Id: Ie408704b2924e1220491a9ea30f0141dfa4867d9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Core: Replace LGPL21 with LGPL license headerKai Koehne2017-03-281-13/+19
| | | | | | | | Also use canonical contact url. Change-Id: I43f8c6a2c4949ee0e054045bccc17d82575b072c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* stop exporting the library versionsOswald Buddenhagen2016-10-181-5/+0
| | | | | | | | | | | | | | | | | | all users of this functionality have been removed, and not emitting the version info saves quite some noise from the generated files. the reason why the users have been removed is that it was unreliable in the first place: if a dependency is found without pkg-config, no version information would be available. the extraction of the version via pkg-config itself is kept in place, as configure tests could be potentially optimized by utilizing it. this reverts much of commit 48b4e0bf6f. Change-Id: I01917f3b2a56b747d7cc54955141d20d23d0990a Reviewed-by: Jake Petroules <jake.petroules@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Modularize configure.json/.priLars Knoll2016-09-151-0/+1
| | | | | | | | | | | | Move the different parts of configure.json/.pri into the libraries where they belong. Gui is not yet fully modularized, and contains many things related to the different QPA plugins. Done-with: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Change-Id: I6659bb29354ed1f36b95b8c69e7fce58f642053f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Improve library version handlingLars Knoll2016-08-191-0/+9
| | | | | | | | | | | Output the version as a define into the private config header as a define using a hex number. Like that we can easily do version checks on libraries using the QT_LIBRARY_VERSION(lib) and QT_VERSION_CHECK() macros. Change-Id: I6dc4ac6550886ca95c5542b6e75cd933ed079d76 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Make sure all private headers in Qt Core include qglobal_p.hThiago Macieira2016-06-251-0/+52
The rule was: - if the header included qglobal.h, turn that into qglobal_p.h - otherwise, insert the #include after the "We mean it" warning qglobal_p.h currently only includes qglobal.h. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>