summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMikhail Svetkin <mikhail.svetkin@gmail.com>2020-06-29 19:40:00 +0200
committerMikhail Svetkin <mikhail.svetkin@gmail.com>2020-07-02 20:08:23 +0200
commit983e93c3b160c62e60b1755d075e959d4685d949 (patch)
tree161b81aa13610a1b57c8e156e4c9d512abe67b28
parente49b9a111aeb50ccb3c6fc6c9c5f0bcc1781b03d (diff)
Fix linkage error in QFutureInterface<QHttpServerResponse>::takeResultmaster
The error: QtPrivate::ExceptionStore::throwPossibleException already defined in QHttpServerFutureResponse. Task-number: QTBUG-85191 Change-Id: I055b2aa563cbde7d01309a01fa59d4283c9c2e36 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/httpserver/qhttpserverfutureresponse.cpp27
-rw-r--r--src/httpserver/qhttpserverfutureresponse.h24
2 files changed, 28 insertions, 23 deletions
diff --git a/src/httpserver/qhttpserverfutureresponse.cpp b/src/httpserver/qhttpserverfutureresponse.cpp
index 3d2784b..2409e6a 100644
--- a/src/httpserver/qhttpserverfutureresponse.cpp
+++ b/src/httpserver/qhttpserverfutureresponse.cpp
@@ -61,6 +61,33 @@ QT_BEGIN_NAMESPACE
\endcode
*/
+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+
+QHttpServerResponse QFutureInterface<QHttpServerResponse>::takeResult()
+{
+ if (isCanceled()) {
+ exceptionStore().throwPossibleException();
+ return QHttpServerResponse::StatusCode::NotFound;
+ }
+ // Note: we wait for all, this is intentional,
+ // not to mess with other unready results.
+ waitForResult(-1);
+
+#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
+ std::lock_guard<QMutex> locker{*mutex()};
+#else
+ std::lock_guard<QMutex> locker{mutex(0)};
+#endif
+ QtPrivate::ResultIteratorBase position = resultStoreBase().resultAt(0);
+ auto ret = std::move_if_noexcept(
+ *const_cast<QHttpServerResponse *>(position.pointer<QHttpServerResponse>()));
+ resultStoreBase().template clear<QHttpServerResponse>();
+
+ return ret;
+}
+
+#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
+
struct QResponseWatcher : public QFutureWatcher<QHttpServerResponse>
{
Q_OBJECT
diff --git a/src/httpserver/qhttpserverfutureresponse.h b/src/httpserver/qhttpserverfutureresponse.h
index 45dc376..d5c8fe1 100644
--- a/src/httpserver/qhttpserverfutureresponse.h
+++ b/src/httpserver/qhttpserverfutureresponse.h
@@ -104,29 +104,7 @@ public:
QFutureInterfaceBase::reportFinished();
}
- QHttpServerResponse takeResult()
- {
- if (isCanceled()) {
- exceptionStore().throwPossibleException();
- return QHttpServerResponse::StatusCode::NotFound;
- }
-
- // Note: we wait for all, this is intentional,
- // not to mess with other unready results.
- waitForResult(-1);
-
-#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
- std::lock_guard<QMutex> locker{*mutex()};
-#else
- std::lock_guard<QMutex> locker{mutex(0)};
-#endif
- QtPrivate::ResultIteratorBase position = resultStoreBase().resultAt(0);
- auto ret = std::move_if_noexcept(
- *const_cast<QHttpServerResponse *>(position.pointer<QHttpServerResponse>()));
- resultStoreBase().template clear<QHttpServerResponse>();
-
- return ret;
- }
+ QHttpServerResponse takeResult();
};
#endif // QT_VERSION < QT_VERSION_CHECK(6, 0, 0)