Don't use var-args for Q_DECLARE_EXPORTED_LOGGING_CATEGORY

MSVC should deal just fine with a single argument macro, and this
prevents the silent mistake of passing a single argument to
Q_DECLARE_EXPORTED_LOGGING_CATEGORY which would result in
no error or warning, but without exporting the category.

Pick-to: 6.5
Change-Id: I4190027f8914ad1ef3957759f8e8c0e6cbd8ba97
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
bb10
Tor Arne Vestbø 2023-01-02 13:13:58 +01:00
parent 76cef0f171
commit 9bf42425f1
1 changed files with 4 additions and 4 deletions

View File

@ -108,11 +108,11 @@ template <> const bool QLoggingCategoryMacroHolder<QtWarningMsg>::IsOutputEnable
#endif
} // unnamed namespace
#define Q_DECLARE_EXPORTED_LOGGING_CATEGORY(name, ...) \
__VA_ARGS__ const QLoggingCategory &name();
#define Q_DECLARE_LOGGING_CATEGORY(name) \
Q_DECLARE_EXPORTED_LOGGING_CATEGORY(name, /* prevent zero variadic arguments */ )
const QLoggingCategory &name();
#define Q_DECLARE_EXPORTED_LOGGING_CATEGORY(name, export_macro) \
export_macro Q_DECLARE_LOGGING_CATEGORY(name)
#define Q_LOGGING_CATEGORY(name, ...) \
const QLoggingCategory &name() \