diff --git a/src/corelib/compat/removed_api.cpp b/src/corelib/compat/removed_api.cpp index 751c1995eda..7d12d8796ae 100644 --- a/src/corelib/compat/removed_api.cpp +++ b/src/corelib/compat/removed_api.cpp @@ -1367,3 +1367,19 @@ QUuid::Version QUuid::version() const noexcept // order sections alphabetically to reduce chances of merge conflicts #endif // QT_CORE_REMOVED_SINCE(6, 9) + +#if QT_CORE_REMOVED_SINCE(6, 10) + +#include "qlogging.h" + +QNoDebug QMessageLogger::noDebug() const noexcept +{ + return QNoDebug(); +} + + +// #include "qotherheader.h" +// // implement removed functions from qotherheader.h +// order sections alphabetically to reduce chances of merge conflicts + +#endif // QT_CORE_REMOVED_SINCE(6, 10) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 3697aa64787..699cd9911de 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -515,19 +515,6 @@ QDebug QMessageLogger::debug(QMessageLogger::CategoryFunction catFunc) const { return debug((*catFunc)()); } - -/*! - \internal - - Returns a QNoDebug object, which is used to ignore debugging output. - - \sa QNoDebug, qDebug() -*/ -QNoDebug QMessageLogger::noDebug() const noexcept -{ - return QNoDebug(); -} - #endif /*! diff --git a/src/corelib/global/qlogging.h b/src/corelib/global/qlogging.h index b4ec1a12353..ebb5c1ea056 100644 --- a/src/corelib/global/qlogging.h +++ b/src/corelib/global/qlogging.h @@ -134,10 +134,13 @@ public: QDebug fatal(const QLoggingCategory &cat) const; Q_DECL_COLD_FUNCTION QDebug fatal(CategoryFunction catFunc) const; - - QNoDebug noDebug() const noexcept; #endif // QT_NO_DEBUG_STREAM +# if QT_CORE_REMOVED_SINCE(6, 10) + QNoDebug noDebug() const noexcept; +# endif + inline QNoDebug noDebug(...) const noexcept; // in qdebug.h + private: QMessageLogContext context; }; @@ -168,6 +171,9 @@ private: #define qCritical QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).critical #define qFatal QMessageLogger(QT_MESSAGELOG_FILE, QT_MESSAGELOG_LINE, QT_MESSAGELOG_FUNC).fatal +Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(int code, const char *msg, ...); +Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(const char *msg, ...); + #define QT_NO_QDEBUG_MACRO while (false) QMessageLogger().noDebug #if defined(QT_NO_DEBUG_OUTPUT) @@ -181,14 +187,12 @@ private: #if defined(QT_NO_WARNING_OUTPUT) # undef qWarning # define qWarning QT_NO_QDEBUG_MACRO +# define qErrnoWarning QT_NO_QDEBUG_MACRO #endif Q_CORE_EXPORT void qt_message_output(QtMsgType, const QMessageLogContext &context, const QString &message); -Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(int code, const char *msg, ...); -Q_CORE_EXPORT Q_DECL_COLD_FUNCTION void qErrnoWarning(const char *msg, ...); - typedef void (*QtMessageHandler)(QtMsgType, const QMessageLogContext &, const QString &); Q_CORE_EXPORT QtMessageHandler qInstallMessageHandler(QtMessageHandler); diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 441fe542d6e..98ce60148ba 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -352,6 +352,8 @@ public: template inline QNoDebug &operator<<(const T &) { return *this; } }; +inline QNoDebug QMessageLogger::noDebug(...) const noexcept +{ return {}; } inline QDebug &QDebug::operator=(const QDebug &other) {