7#include <QtCore/qassert.h>
8#include <QtCore/qatomic.h>
9#include <QtCore/qtclasshelpermacros.h>
26 using Type =
typename QGS::QGS_Type;
47#if defined(Q_CC_GNU_ONLY) && Q_CC_GNU >= 1100
51 std::atomic_thread_fence(std::memory_order_acquire);
62 Q_DISABLE_COPY_MOVE(
Holder)
68 using Type =
typename Holder::Type;
87 "The global static was used after being destroyed");
93 "The global static was used after being destroyed");
100 static Holder holder;
101 return holder.pointer();
109#define Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, ARGS) \
111 QT_WARNING_DISABLE_CLANG("-Wunevaluated-expression") \
112 namespace { struct Q_QGS_ ## NAME { \
113 typedef TYPE QGS_Type; \
114 static void innerFunction(void *pointer) \
115 noexcept(noexcept(std::remove_cv_t<QGS_Type> ARGS)) \
117 new (pointer) QGS_Type ARGS; \
120 Q_CONSTINIT static QGlobalStatic<QtGlobalStatic::Holder<Q_QGS_ ## NAME>> NAME; \
124#define Q_GLOBAL_STATIC(TYPE, NAME, ...) \
125 Q_GLOBAL_STATIC_WITH_ARGS(TYPE, NAME, (__VA_ARGS__))
Combined button and popup list for selecting options.
#define QT_WARNING_DISABLE_GCC(text)
#define Q_ASSERT_X(cond, x, msg)
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)
static Q_CONSTINIT QBasicAtomicInteger< qint8 > guard
std::remove_cv_t< Type > PlainType