summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-05-12 10:16:45 (GMT)
committerLaszlo Agocs <laszlo.p.agocs@nokia.com>2011-05-12 10:16:45 (GMT)
commit455440996f659ae246536b7450ba9b7900d015d0 (patch)
treea2d26dbd78bc33643693fb10132d3fee64af5ed9
parentd7d9a14de00f9391ab0be953357d24713f580675 (diff)
downloadQt-455440996f659ae246536b7450ba9b7900d015d0.zip
Qt-455440996f659ae246536b7450ba9b7900d015d0.tar.gz
Qt-455440996f659ae246536b7450ba9b7900d015d0.tar.bz2
Disable QtConcurrent for Symbian winscw builds.
While QtConcurrent is nowadays usable with RVCT and GCCE compilers, the compiler used for the winscw target has problems with the templates still. To enable building 4.8 on winscw, the patch defines QT_NO_CONCURRENT and QT_NO_QFUTURE in qglobal.h for this target. However this causes further complications in the Q_OBJECT classes of QtConcurrent because moc will be run without having QT_NO_CONCURRENT and QFUTURE defined (as moc is not a Symbian app and for other Symbian targets they must not be defined, which makes differentiation in qglobal.h impossible for the moc run) and having a moc file generated for a class that will be ifdef'ed out during compilation causes build breaks. Therefore additional dummy stubs are provided in QFutureWatcherBase. Reviewed-by: Liang Qi
-rw-r--r--src/corelib/concurrent/qfuturewatcher.cpp14
-rw-r--r--src/corelib/concurrent/qfuturewatcher.h13
-rw-r--r--src/corelib/global/qglobal.h10
-rw-r--r--tests/auto/qfuture/versioncheck.h4
-rw-r--r--tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp1
5 files changed, 37 insertions, 5 deletions
diff --git a/src/corelib/concurrent/qfuturewatcher.cpp b/src/corelib/concurrent/qfuturewatcher.cpp
index ea12bc9..728714a 100644
--- a/src/corelib/concurrent/qfuturewatcher.cpp
+++ b/src/corelib/concurrent/qfuturewatcher.cpp
@@ -589,4 +589,16 @@ void QFutureWatcherBasePrivate::sendCallOutEvent(QFutureCallOutEvent *event)
QT_END_NAMESPACE
-#endif // QT_NO_CONCURRENT
+#else
+
+// On Symbian winscw target QT_NO_QFUTURE and QT_NO_CONCURRENT are both defined.
+// However moc will be run without having them set, so provide a dummy stub at
+// least for the slots to prevent linker errors.
+
+void QFutureWatcherBase::cancel() { }
+void QFutureWatcherBase::setPaused(bool) { }
+void QFutureWatcherBase::pause() { }
+void QFutureWatcherBase::resume() { }
+void QFutureWatcherBase::togglePaused() { }
+
+#endif // QT_NO_QFUTURE
diff --git a/src/corelib/concurrent/qfuturewatcher.h b/src/corelib/concurrent/qfuturewatcher.h
index 5fe2007..26e549d 100644
--- a/src/corelib/concurrent/qfuturewatcher.h
+++ b/src/corelib/concurrent/qfuturewatcher.h
@@ -44,8 +44,6 @@
#include <QtCore/qfuture.h>
-#ifndef QT_NO_QFUTURE
-
#include <QtCore/qobject.h>
QT_BEGIN_HEADER
@@ -56,6 +54,11 @@ QT_MODULE(Core)
class QEvent;
class QFutureWatcherBasePrivate;
+
+#ifdef QT_NO_QFUTURE
+class QFutureInterfaceBase;
+#endif
+
class Q_CORE_EXPORT QFutureWatcherBase : public QObject
{
Q_OBJECT
@@ -114,6 +117,8 @@ private:
virtual QFutureInterfaceBase &futureInterface() = 0;
};
+#ifndef QT_NO_QFUTURE
+
template <typename T>
class QFutureWatcher : public QFutureWatcherBase
{
@@ -214,9 +219,9 @@ Q_INLINE_TEMPLATE void QFutureWatcher<void>::setFuture(const QFuture<void> &_fut
connectOutputInterface();
}
+#endif // QT_NO_QFUTURE
+
QT_END_NAMESPACE
QT_END_HEADER
-#endif // QT_NO_CONCURRENT
-
#endif // QFUTUREWATCHER_H
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 49f5f98..3e1f011 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -2545,6 +2545,16 @@ QT3_SUPPORT Q_CORE_EXPORT const char *qInstallPathSysconf();
//Symbian does not support data imports from a DLL
#define Q_NO_DATA_RELOCATION
+// Winscw compiler is unable to compile QtConcurrent.
+#ifdef Q_CC_NOKIAX86
+#ifndef QT_NO_CONCURRENT
+#define QT_NO_CONCURRENT
+#endif
+#ifndef QT_NO_QFUTURE
+#define QT_NO_QFUTURE
+#endif
+#endif
+
QT_END_NAMESPACE
// forward declare std::exception
#ifdef __cplusplus
diff --git a/tests/auto/qfuture/versioncheck.h b/tests/auto/qfuture/versioncheck.h
index 0cf7b76..32a33c8 100644
--- a/tests/auto/qfuture/versioncheck.h
+++ b/tests/auto/qfuture/versioncheck.h
@@ -47,3 +47,7 @@
#if defined(Q_CC_MSVC) && _MSC_VER < 1400
#define QT_NO_CONCURRENT_TEST
#endif
+
+#if defined(Q_CC_NOKIAX86)
+#define QT_NO_CONCURRENT_TEST
+#endif
diff --git a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
index f287450..2f1adb4 100644
--- a/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
+++ b/tests/auto/qtconcurrentmap/tst_qtconcurrentmap.cpp
@@ -2418,6 +2418,7 @@ void tst_QtConcurrentMap::incrementalResults() {}
void tst_QtConcurrentMap::stressTest() {}
void tst_QtConcurrentMap::throttling() {}
void tst_QtConcurrentMap::stlContainers() {}
+void tst_QtConcurrentMap::qFutureAssignmentLeak() { }
void tst_QtConcurrentMap::noDetatch() {}
QTEST_NOOP_MAIN