From ae36509d5c23f3cfe4229da2c94dc04d20201a1e Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 9 Sep 2021 22:19:06 -0700 Subject: [PATCH] QPlugin: remove Q_EXTERN_C macro Our plugins are code generated by moc, so always C++. I don't know when the last time it was that you could declare plugins from C. Pick-to: 6.2 Change-Id: I2de1b4dfacd443148279fffd16a35e466f8a4c20 Reviewed-by: Oswald Buddenhagen --- src/corelib/plugin/qplugin.h | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/corelib/plugin/qplugin.h b/src/corelib/plugin/qplugin.h index d768ae0736..53cf95056e 100644 --- a/src/corelib/plugin/qplugin.h +++ b/src/corelib/plugin/qplugin.h @@ -1,7 +1,7 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2018 Intel Corporation. +** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -47,15 +47,6 @@ QT_BEGIN_NAMESPACE - -#ifndef Q_EXTERN_C -# ifdef __cplusplus -# define Q_EXTERN_C extern "C" -# else -# define Q_EXTERN_C extern -# endif -#endif - inline constexpr unsigned char qPluginArchRequirements() { return 0 @@ -156,10 +147,10 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin staticPlugin); #else # define QT_MOC_EXPORT_PLUGIN(PLUGINCLASS, PLUGINCLASSNAME) \ - Q_EXTERN_C Q_DECL_EXPORT \ + extern "C" Q_DECL_EXPORT \ QPluginMetaData qt_plugin_query_metadata() \ { return { qt_pluginMetaData_##PLUGINCLASSNAME, sizeof qt_pluginMetaData_##PLUGINCLASSNAME }; } \ - Q_EXTERN_C Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \ + extern "C" Q_DECL_EXPORT QT_PREPEND_NAMESPACE(QObject) *qt_plugin_instance() \ Q_PLUGIN_INSTANCE(PLUGINCLASS) #endif