summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/configure.cmake23
-rw-r--r--src/corelib/thread/qthread.cpp2
-rw-r--r--src/corelib/thread/qthread.h12
3 files changed, 3 insertions, 34 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake
index 6e8de89099..eca3b01886 100644
--- a/src/corelib/configure.cmake
+++ b/src/corelib/configure.cmake
@@ -137,27 +137,6 @@ int pipes[2];
}
")
-# cxx11_future
-if (UNIX AND NOT ANDROID AND NOT QNX AND NOT INTEGRITY)
- set(cxx11_future_TEST_LIBRARIES pthread)
-endif()
-qt_config_compile_test(cxx11_future
- LABEL "C++11 <future>"
- LIBRARIES
- "${cxx11_future_TEST_LIBRARIES}"
- CODE
-"#include <future>
-
-int main(void)
-{
- /* BEGIN TEST: */
-std::future<int> f = std::async([]() { return 42; });
-(void)f.get();
- /* END TEST: */
- return 0;
-}
-")
-
# cxx17_filesystem
qt_config_compile_test(cxx17_filesystem
LABEL "C++17 <filesystem>"
@@ -565,7 +544,7 @@ qt_feature("system-doubleconversion" PRIVATE
)
qt_feature("cxx11_future" PUBLIC
LABEL "C++11 <future>"
- CONDITION TEST_cxx11_future
+ CONDITION ON
)
qt_feature("cxx17_filesystem" PUBLIC
LABEL "C++17 <filesystem>"
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 61369420d1..111c6a93d5 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -1201,7 +1201,6 @@ bool QThread::isInterruptionRequested() const
\sa start()
*/
-#if QT_CONFIG(cxx11_future)
class QThreadCreateThread : public QThread
{
public:
@@ -1230,7 +1229,6 @@ QThread *QThread::createThreadImpl(std::future<void> &&future)
{
return new QThreadCreateThread(std::move(future));
}
-#endif // QT_CONFIG(cxx11_future)
/*!
\class QDaemonThread
diff --git a/src/corelib/thread/qthread.h b/src/corelib/thread/qthread.h
index 40f363ee5a..32a0bb703e 100644
--- a/src/corelib/thread/qthread.h
+++ b/src/corelib/thread/qthread.h
@@ -9,10 +9,8 @@
#include <QtCore/qdeadlinetimer.h>
// For QThread::create
-#if QT_CONFIG(cxx11_future)
-# include <future> // for std::async
-# include <functional> // for std::invoke; no guard needed as it's a C++98 header
-#endif
+#include <future> // for std::async
+#include <functional> // for std::invoke; no guard needed as it's a C++98 header
// internal compiler error with mingw 8.1
#if defined(Q_CC_MSVC) && defined(Q_PROCESSOR_X86)
#include <intrin.h>
@@ -70,10 +68,8 @@ public:
bool event(QEvent *event) override;
int loopLevel() const;
-#if QT_CONFIG(cxx11_future) || defined(Q_QDOC)
template <typename Function, typename... Args>
[[nodiscard]] static QThread *create(Function &&f, Args &&... args);
-#endif
public Q_SLOTS:
void start(Priority = InheritPriority);
@@ -112,16 +108,13 @@ private:
Q_DECLARE_PRIVATE(QThread)
friend class QEventLoopLocker;
-#if QT_CONFIG(cxx11_future)
[[nodiscard]] static QThread *createThreadImpl(std::future<void> &&future);
-#endif
static Qt::HANDLE currentThreadIdImpl() noexcept Q_DECL_PURE_FUNCTION;
friend class QCoreApplication;
friend class QThreadData;
};
-#if QT_CONFIG(cxx11_future)
template <typename Function, typename... Args>
QThread *QThread::create(Function &&f, Args &&... args)
{
@@ -136,7 +129,6 @@ QThread *QThread::create(Function &&f, Args &&... args)
std::move(threadFunction),
std::forward<Args>(args)...));
}
-#endif // QT_CONFIG(cxx11_future)
/*
On architectures and platforms we know, interpret the thread control