diff options
Diffstat (limited to 'src/corelib/plugin/qplugin.h')
-rw-r--r-- | src/corelib/plugin/qplugin.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index 5ac3ed9241..909c8acdcc 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -5,10 +5,16 @@ #ifndef QPLUGIN_H #define QPLUGIN_H +#if 0 +#pragma qt_class(QtPlugin) +#endif + #include <QtCore/qobject.h> #include <QtCore/qpointer.h> #include <QtCore/qjsonobject.h> +#include <QtCore/q20algorithm.h> + QT_BEGIN_NAMESPACE // Used up to Qt 6.2 @@ -38,10 +44,8 @@ struct QPluginMetaData template <size_t OSize, typename OO, size_t ISize, typename II> static constexpr void copy(OO (&out)[OSize], II (&in)[ISize]) { - // std::copy is not constexpr until C++20 static_assert(OSize <= ISize, "Output would not be fully initialized"); - for (size_t i = 0; i < OSize; ++i) - out[i] = in[i]; + q20::copy_n(in, OSize, out); } static constexpr quint8 archRequirements() @@ -123,7 +127,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); #if defined(Q_OF_ELF) || (defined(Q_OS_WIN) && (defined (Q_CC_GNU) || defined(Q_CC_CLANG))) # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section (".qtmetadata"))) __attribute__((used)) -#elif defined(Q_OS_MAC) +#elif defined(Q_OS_DARWIN) # define QT_PLUGIN_METADATA_SECTION \ __attribute__ ((section ("__TEXT,qtmetadata"))) __attribute__((used)) #elif defined(Q_CC_MSVC) |