From e2fef733be92e95ff28225196e14ffeb98d61a1f Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Tue, 11 Oct 2022 10:26:28 +0200 Subject: Replace usages of Q_CLANG_QDOC with Q_QDOC To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne --- src/corelib/thread/qatomic.h | 2 +- src/corelib/thread/qexception.cpp | 6 +++--- src/corelib/thread/qexception.h | 2 +- src/corelib/thread/qfuture.h | 8 ++++---- src/corelib/thread/qfuture_impl.h | 2 +- src/corelib/thread/qmutex.h | 6 +++--- src/corelib/thread/qpromise.h | 2 +- src/corelib/thread/qthread.h | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/corelib/thread') diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index e0e9ca947c..24f2616e82 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -34,7 +34,7 @@ public: return *this; } -#ifdef Q_CLANG_QDOC +#ifdef Q_QDOC T loadRelaxed() const; T loadAcquire() const; void storeRelaxed(T newValue); diff --git a/src/corelib/thread/qexception.cpp b/src/corelib/thread/qexception.cpp index 6b066c3075..a623dc1c6e 100644 --- a/src/corelib/thread/qexception.cpp +++ b/src/corelib/thread/qexception.cpp @@ -4,7 +4,7 @@ #include "qexception.h" #include "QtCore/qshareddata.h" -#if !defined(QT_NO_EXCEPTIONS) || defined(Q_CLANG_QDOC) +#if !defined(QT_NO_EXCEPTIONS) || defined(Q_QDOC) QT_BEGIN_NAMESPACE @@ -180,7 +180,7 @@ QUnhandledException *QUnhandledException::clone() const return new QUnhandledException(*this); } -#if !defined(Q_CLANG_QDOC) +#if !defined(Q_QDOC) namespace QtPrivate { @@ -224,7 +224,7 @@ void ExceptionStore::rethrowException() const } // namespace QtPrivate -#endif //Q_CLANG_QDOC +#endif //Q_QDOC QT_END_NAMESPACE diff --git a/src/corelib/thread/qexception.h b/src/corelib/thread/qexception.h index b9c9c58494..62b9e70bea 100644 --- a/src/corelib/thread/qexception.h +++ b/src/corelib/thread/qexception.h @@ -16,7 +16,7 @@ QT_REQUIRE_CONFIG(future); QT_BEGIN_NAMESPACE -#if !defined(QT_NO_EXCEPTIONS) || defined(Q_CLANG_QDOC) +#if !defined(QT_NO_EXCEPTIONS) || defined(Q_QDOC) class Q_CORE_EXPORT QException : public std::exception { diff --git a/src/corelib/thread/qfuture.h b/src/corelib/thread/qfuture.h index 5b618e5acb..34fb8a039d 100644 --- a/src/corelib/thread/qfuture.h +++ b/src/corelib/thread/qfuture.h @@ -55,7 +55,7 @@ public: return *this; } -#if defined(Q_CLANG_QDOC) +#if defined(Q_QDOC) ~QFuture() { } QFuture(const QFuture &) { } QFuture & operator=(const QFuture &) { } @@ -155,7 +155,7 @@ QT_WARNING_POP template>> QFuture onCanceled(QObject *context, Function &&handler); -#if !defined(Q_CLANG_QDOC) +#if !defined(Q_QDOC) template>> auto unwrap(); #else @@ -445,7 +445,7 @@ struct MetaTypeQFutureHelper> namespace QtFuture { -#ifndef Q_CLANG_QDOC +#ifndef Q_QDOC template::value_type, @@ -520,7 +520,7 @@ QFuture> whenAny(InputIt first, InputIt last); template QFuture...>> whenAny(Futures &&... futures); -#endif // Q_CLANG_QDOC +#endif // Q_QDOC } // namespace QtFuture diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 8e96b943ef..6bf3a7406a 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -960,7 +960,7 @@ static QFuture> makeReadyFuture(T &&value) return promise.future(); } -#if defined(Q_CLANG_QDOC) +#if defined(Q_QDOC) static QFuture makeReadyFuture() #else template diff --git a/src/corelib/thread/qmutex.h b/src/corelib/thread/qmutex.h index ab531ef70e..af77f556fd 100644 --- a/src/corelib/thread/qmutex.h +++ b/src/corelib/thread/qmutex.h @@ -17,7 +17,7 @@ class tst_QMutex; QT_BEGIN_NAMESPACE -#if QT_CONFIG(thread) || defined(Q_CLANG_QDOC) +#if QT_CONFIG(thread) || defined(Q_QDOC) #if defined(Q_OS_LINUX) || defined(Q_OS_WIN) // these platforms use futex # define QT_MUTEX_LOCK_NOEXCEPT noexcept @@ -289,7 +289,7 @@ private: bool m_isLocked = false; }; -#else // !QT_CONFIG(thread) && !Q_CLANG_QDOC +#else // !QT_CONFIG(thread) && !Q_QDOC class QMutex { @@ -339,7 +339,7 @@ private: typedef QMutex QBasicMutex; -#endif // !QT_CONFIG(thread) && !Q_CLANG_QDOC +#endif // !QT_CONFIG(thread) && !Q_QDOC QT_END_NAMESPACE diff --git a/src/corelib/thread/qpromise.h b/src/corelib/thread/qpromise.h index 43c30582be..5620811bae 100644 --- a/src/corelib/thread/qpromise.h +++ b/src/corelib/thread/qpromise.h @@ -79,7 +79,7 @@ public: d.swap(other.d); } -#if defined(Q_CLANG_QDOC) // documentation-only simplified signatures +#if defined(Q_QDOC) // documentation-only simplified signatures bool addResult(const T &result, int index = -1) { } bool addResult(T &&result, int index = -1) { } #endif diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h index d856d8daa8..e9af85ee99 100644 --- a/src/corelib/thread/qthread.h +++ b/src/corelib/thread/qthread.h @@ -69,7 +69,7 @@ public: bool event(QEvent *event) override; int loopLevel() const; -#if QT_CONFIG(cxx11_future) || defined(Q_CLANG_QDOC) +#if QT_CONFIG(cxx11_future) || defined(Q_QDOC) template [[nodiscard]] static QThread *create(Function &&f, Args &&... args); #endif -- cgit v1.2.3