From 7466422e9ce964553dd09fce9f48437af7ec76c8 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Fri, 17 Jun 2022 16:44:21 +0200 Subject: Add a way to declare _exported_ logging categories If a library declares a logging category that needs to be used by clients (e.g. via inline methods, macros, etc.), then the logging category function generated by Q_DECLARE_LOGGING_CATEGORY has to be exported. We've seen this problem with Q_NAMESPACE, Q_GADGET, etc.: these macros also declare functions or objects that in some cases need to be exported. And precisely like Q_NAMESPACE, Q_GADGET, etc., people end up relying on the implementation details of Q_DECLARE_LOGGING_CATEGORY (specifically, what does it expand to) in order to place the export directives in the right place. Introduce a more robust solution and apply it around qtbase. Cleanup some minor code as a drive-by (remove `extern` and useless semicolons). [ChangeLog][QtCore][QLoggingCategory] Added the Q_DECLARE_EXPORTED_LOGGING_CATEGORY macro, in order to allow dynamic libraries to declare a logging category that can be then used by client code. Change-Id: I18f40cc937cfe8277b8d62ebc824c27a0773de04 Reviewed-by: Thiago Macieira Reviewed-by: Qt CI Bot Reviewed-by: Kai Koehne --- src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h index 6e841370d8..c6492f02ae 100644 --- a/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h +++ b/src/plugins/platforms/xcb/gl_integrations/qxcbglintegration.h @@ -14,7 +14,7 @@ class QPlatformOffscreenSurface; class QOffscreenSurface; class QXcbNativeInterfaceHandler; -Q_XCB_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaGl) +Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaGl, Q_XCB_EXPORT) class Q_XCB_EXPORT QXcbGlIntegration { -- cgit v1.2.3