summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qunicodetools.cpp
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-03-17 12:07:44 +0100
committerMarc Mutz <marc.mutz@qt.io>2022-03-29 06:18:49 +0100
commit32692667a625f31aa02e0303f2139c780ae42694 (patch)
treebab74a97f673fd2caee7d1d0b68fac4583fcfb11 /src/corelib/text/qunicodetools.cpp
parent9578a3f72fd67011263eac9d306750a2dbef01d1 (diff)
Apply Q_CONSTINIT across the codebase
Still not complete. Just grepping for static and thread_local. Task-number: QTBUG-100486 Change-Id: I90ca14e8db3a95590ecde5f89924cf6fcc9755a3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qunicodetools.cpp')
-rw-r--r--src/corelib/text/qunicodetools.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/text/qunicodetools.cpp b/src/corelib/text/qunicodetools.cpp
index bba950102e..ff11baa99a 100644
--- a/src/corelib/text/qunicodetools.cpp
+++ b/src/corelib/text/qunicodetools.cpp
@@ -1404,12 +1404,12 @@ typedef int (*th_brk_def) (const unsigned char*, int*, size_t);
typedef size_t (*th_next_cell_def) (const unsigned char *, size_t, struct thcell_t *, int);
/* libthai related function handles */
-static th_brk_def th_brk = nullptr;
-static th_next_cell_def th_next_cell = nullptr;
+Q_CONSTINIT static th_brk_def th_brk = nullptr;
+Q_CONSTINIT static th_next_cell_def th_next_cell = nullptr;
static int init_libthai() {
#if QT_CONFIG(library)
- static bool initialized = false;
+ Q_CONSTINIT static bool initialized = false;
if (!initialized && (!th_brk || !th_next_cell)) {
th_brk = reinterpret_cast<th_brk_def>(QLibrary::resolve("thai"_L1, static_cast<int>(LIBTHAI_MAJOR), "th_brk"));
th_next_cell = (th_next_cell_def)QLibrary::resolve("thai"_L1, LIBTHAI_MAJOR, "th_next_cell");