7#include <QtCore/qassert.h>
8#include <QtCore/qatomic.h>
9#include <QtCore/qtclasshelpermacros.h>
37 QGS::innerFunction(pointer());
38 guard.storeRelaxed(QtGlobalStatic::Initialized);
48#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1100
49QT_WARNING_DISABLE_GCC(
"-Wtsan")
52 std::atomic_thread_fence(
std::memory_order_acquire);
54 pointer()->~PlainType();
55 guard.storeRelease(QtGlobalStatic::Destroyed);
87 Q_ASSERT_X(!isDestroyed(), Q_FUNC_INFO,
88 "The global static was used after being destroyed");
93 Q_ASSERT_X(!isDestroyed(), Q_FUNC_INFO,
94 "The global static was used after being destroyed");
101 static Holder holder;
102 return holder.pointer();
110#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
112 QT_WARNING_DISABLE_CLANG("-Wunevaluated-expression")
113 namespace { struct Q_QGS_ ## NAME {
114 typedef TYPE QGS_Type;
115 static void innerFunction(void *pointer)
116 noexcept(noexcept(std::remove_cv_t<QGS_Type> ARGS))
118 new (pointer) QGS_Type ARGS;
121 Q_CONSTINIT static QGlobalStatic<QtGlobalStatic::Holder<Q_QGS_ ## NAME>> NAME;
125#define Q_GLOBAL_STATIC(TYPE, NAME, ...)
\inmodule QtCore \inheaderfile QPermissions
void requestPermission(const QPermission &permission, const PermissionCallback &callback)
Qt::PermissionStatus checkPermission(const QPermission &permission)
#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS)
#define Q_GLOBAL_STATIC(TYPE, NAME,...)
#define QStringLiteral(str)
typename Holder::Type Type
static Type * instance() noexcept(Holder::ConstructionIsNoexcept)
static QtGlobalStatic::GuardValues guardValue() noexcept
bool exists() const noexcept
bool isDestroyed() const noexcept
PlainType * pointer() noexcept
static constexpr bool ConstructionIsNoexcept
Holder() noexcept(ConstructionIsNoexcept)
typename QGS::QGS_Type Type