summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
diff options
context:
space:
mode:
authorLuca Di Sera <luca.disera@qt.io>2022-10-11 10:26:28 +0200
committerLuca Di Sera <luca.disera@qt.io>2022-10-21 09:48:36 +0200
commite2fef733be92e95ff28225196e14ffeb98d61a1f (patch)
tree42bc5a06849c48c89a74fc65a494a126e46b1797 /src/corelib/thread
parent2b35b89803bc90a3595be5386da905d79d841b73 (diff)
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 <kai.koehne@qt.io>
Diffstat (limited to 'src/corelib/thread')
-rw-r--r--src/corelib/thread/qatomic.h2
-rw-r--r--src/corelib/thread/qexception.cpp6
-rw-r--r--src/corelib/thread/qexception.h2
-rw-r--r--src/corelib/thread/qfuture.h8
-rw-r--r--src/corelib/thread/qfuture_impl.h2
-rw-r--r--src/corelib/thread/qmutex.h6
-rw-r--r--src/corelib/thread/qpromise.h2
-rw-r--r--src/corelib/thread/qthread.h2
8 files changed, 15 insertions, 15 deletions
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<T> &) { }
QFuture<T> & operator=(const QFuture<T> &) { }
@@ -155,7 +155,7 @@ QT_WARNING_POP
template<class Function, typename = std::enable_if_t<std::is_invocable_r_v<T, Function>>>
QFuture<T> onCanceled(QObject *context, Function &&handler);
-#if !defined(Q_CLANG_QDOC)
+#if !defined(Q_QDOC)
template<class U = T, typename = std::enable_if_t<QtPrivate::isQFutureV<U>>>
auto unwrap();
#else
@@ -445,7 +445,7 @@ struct MetaTypeQFutureHelper<QFuture<T>>
namespace QtFuture {
-#ifndef Q_CLANG_QDOC
+#ifndef Q_QDOC
template<typename OutputSequence, typename InputIt,
typename ValueType = typename std::iterator_traits<InputIt>::value_type,
@@ -520,7 +520,7 @@ QFuture<QtFuture::WhenAnyResult<T>> whenAny(InputIt first, InputIt last);
template<typename... Futures>
QFuture<std::variant<std::decay_t<Futures>...>> 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<std::decay_t<T>> makeReadyFuture(T &&value)
return promise.future();
}
-#if defined(Q_CLANG_QDOC)
+#if defined(Q_QDOC)
static QFuture<void> makeReadyFuture()
#else
template<typename T = void>
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 <typename Function, typename... Args>
[[nodiscard]] static QThread *create(Function &&f, Args &&... args);
#endif