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. Change-Id: I4190027f8914ad1ef3957759f8e8c0e6cbd8ba97 Reviewed-by: Kai Köhne <kai.koehne@qt.io> (cherry picked from commit 9bf42425f1cfaca990e37200960615d819b31886) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
80f9966c90
commit
755d7af3eb
@ -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() \
|
||||
|
Loading…
x
Reference in New Issue
Block a user