From 8e5fcf02bdf3395071b3174777d059faf76a03c6 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sat, 25 Sep 2021 11:01:57 -0700 Subject: QPlugin: add qt_plugin_query_metadata_v2() to dynamic plugins They return a pointer to the actual header, skipping the magic string. This is done in preparation for the header located in an ELF note, which won't have the magic. Change-Id: I3eb1bd30e0124f89a052fffd16a8229bec2ad588 Reviewed-by: Qt CI Bot Reviewed-by: Lars Knoll --- tests/auto/tools/moc/tst_moc.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'tests/auto/tools/moc/tst_moc.cpp') diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 6776b6e509..cd69ea893c 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -1468,20 +1468,11 @@ void tst_Moc::environmentIncludePaths() // plugin_metadata.h contains a plugin which we register here. Since we're not building this // application as a plugin, we need top copy some of the initializer code found in qplugin.h: extern "C" QObject *qt_plugin_instance(); -extern "C" QPluginMetaData qt_plugin_query_metadata(); +extern "C" QPluginMetaData qt_plugin_query_metadata_v2(); class StaticPluginInstance{ public: StaticPluginInstance() { - decltype(&qt_plugin_query_metadata) queryFn; - queryFn = []() { - // Static plugins don't carry the magic string (since Qt 6.3) - QPluginMetaData md = qt_plugin_query_metadata(); - int delta = sizeof(QPluginMetaData::MagicString); - md.data = static_cast(md.data) + delta; - md.size -= delta; - return md; - }; - QStaticPlugin plugin(qt_plugin_instance, queryFn); + QStaticPlugin plugin(qt_plugin_instance, qt_plugin_query_metadata_v2); qRegisterStaticPluginFunction(plugin); } }; -- cgit v1.2.3