Move QtConcurrent configuration to a single file
authorJoão Abecasis <joao.abecasis@nokia.com>
Sun, 5 Feb 2012 23:40:36 +0000 (00:40 +0100)
committerQt by Nokia <qt-info@nokia.com>
Tue, 14 Feb 2012 15:14:58 +0000 (16:14 +0100)
This file lives in src/concurrent, alongside the rest of the library. Relevant
configuration was moved out of qglobal.h, as it isn't relevant for other
parties and thus isn't needed there.

This introduces a global header that all QtConcurrent headers now include. This
header includes qglobal.h and defines library-specific configuration for all to
follow.

Change-Id: If6f11e7bbc6139d29004eb1602bd579b75b637c8
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
24 files changed:
src/concurrent/concurrent.pro
src/concurrent/qfuture.h
src/concurrent/qfutureinterface.h
src/concurrent/qfutureinterface_p.h
src/concurrent/qfuturesynchronizer.h
src/concurrent/qfuturewatcher.h
src/concurrent/qfuturewatcher_p.h
src/concurrent/qtconcurrent_global.h [new file with mode: 0644]
src/concurrent/qtconcurrentcompilertest.h
src/concurrent/qtconcurrentexception.h
src/concurrent/qtconcurrentfilter.h
src/concurrent/qtconcurrentfilterkernel.h
src/concurrent/qtconcurrentfunctionwrappers.h
src/concurrent/qtconcurrentiteratekernel.h
src/concurrent/qtconcurrentmap.h
src/concurrent/qtconcurrentmapkernel.h
src/concurrent/qtconcurrentmedian.h
src/concurrent/qtconcurrentreducekernel.h
src/concurrent/qtconcurrentresultstore.h
src/concurrent/qtconcurrentrun.h
src/concurrent/qtconcurrentrunbase.h
src/concurrent/qtconcurrentstoredfunctioncall.h
src/concurrent/qtconcurrentthreadengine.h
src/corelib/global/qglobal.h

index 8ef3c5c..6bf16e6 100644 (file)
@@ -31,6 +31,7 @@ SOURCES += \
         qtconcurrentexception.cpp
 
 HEADERS += \
+        qtconcurrent_global.h \
         qfuture.h \
         qfutureinterface.h \
         qfuturesynchronizer.h \
index 6e99a60..4005fe5 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QFUTURE_H
 #define QFUTURE_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_QFUTURE
 
index 3f05466..9ae2df5 100644 (file)
@@ -42,7 +42,8 @@
 #ifndef QFUTUREINTERFACE_H
 #define QFUTUREINTERFACE_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
+
 #include <QtCore/qrunnable.h>
 
 #ifndef QT_NO_QFUTURE
index ea52621..3a73f84 100644 (file)
@@ -53,6 +53,8 @@
 // We mean it.
 //
 
+#include <QtConcurrent/qtconcurrent_global.h>
+
 #include <QtCore/qelapsedtimer.h>
 #include <QtCore/qcoreevent.h>
 #include <QtCore/qlist.h>
index 8b7e710..3106dd4 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QFUTRUESYNCHRONIZER_H
 #define QFUTRUESYNCHRONIZER_H
 
+#include <QtConcurrent/qtconcurrent_global.h>
+
 #include <QtConcurrent/qfuture.h>
 
 #ifndef QT_NO_CONCURRENT
index 6b4b941..11dab42 100644 (file)
@@ -42,6 +42,8 @@
 #ifndef QFUTUREWATCHER_H
 #define QFUTUREWATCHER_H
 
+#include <QtConcurrent/qtconcurrent_global.h>
+
 #include <QtConcurrent/qfuture.h>
 
 #ifndef QT_NO_QFUTURE
index 27bc494..46486bf 100644 (file)
@@ -53,6 +53,8 @@
 // We mean it.
 //
 
+#include <QtConcurrent/qtconcurrent_global.h>
+
 #include "qfutureinterface_p.h"
 #include <qlist.h>
 
diff --git a/src/concurrent/qtconcurrent_global.h b/src/concurrent/qtconcurrent_global.h
new file mode 100644 (file)
index 0000000..1e26c23
--- /dev/null
@@ -0,0 +1,84 @@
+/****************************************************************************
+**
+** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTCONCURRENT_GLOBAL_H
+#define QTCONCURRENT_GLOBAL_H
+
+#include <QtCore/qglobal.h>
+
+#ifdef QT_NO_CONCURRENT
+#  define QT_NO_QFUTURE
+#endif
+
+#if defined(Q_OS_WIN) && !defined(QT_NODLL)
+#  if defined(QT_MAKEDLL)
+#    if defined(QT_BUILD_CONCURRENT_LIB)
+#      define Q_CONCURRENT_EXPORT Q_DECL_EXPORT
+#    else
+#      define Q_CONCURRENT_EXPORT Q_DECL_IMPORT
+#    endif
+#  elif defined(QT_DLL)
+#    define Q_CONCURRENT_EXPORT Q_DECL_IMPORT
+#  endif
+#endif
+
+#if !defined(Q_CONCURRENT_EXPORT)
+#  if defined(QT_SHARED)
+#    define Q_CONCURRENT_EXPORT Q_DECL_EXPORT
+#  else
+#    define Q_CONCURRENT_EXPORT
+#  endif
+#endif
+
+// gcc 3 version has problems with some of the
+// map/filter overloads.
+#if defined(Q_CC_GNU) && (__GNUC__ < 4)
+#  define QT_NO_CONCURRENT_MAP
+#  define QT_NO_CONCURRENT_FILTER
+#endif
+
+#if defined (Q_CC_MSVC) && (_MSC_VER < 1300)
+#  define QT_TYPENAME
+#else
+#  define QT_TYPENAME typename
+#endif
+
+#endif // include guard
index 7818423..7f3f7d4 100644 (file)
 #ifndef QTCONCURRENT_COMPILERTEST_H
 #define QTCONCURRENT_COMPILERTEST_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
 QT_BEGIN_HEADER
 QT_BEGIN_NAMESPACE
 
-
-#if defined (Q_CC_MSVC) && (_MSC_VER < 1300)
-#  define QT_TYPENAME
-#else
-#  define QT_TYPENAME typename
-#endif
-
 namespace QtPrivate {
 
 template<class T>
index 2021e77..80926c4 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_EXCEPTION_H
 #define QTCONCURRENT_EXCEPTION_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_QFUTURE
 
index 1de8d23..3d4c1d6 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_FILTER_H
 #define QTCONCURRENT_FILTER_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 71112cb..9bb4396 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_FILTERKERNEL_H
 #define QTCONCURRENT_FILTERKERNEL_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 9b86b73..c87770f 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_FUNCTIONWRAPPERS_H
 #define QTCONCURRENT_FUNCTIONWRAPPERS_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 4858053..6776ff0 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_ITERATEKERNEL_H
 #define QTCONCURRENT_ITERATEKERNEL_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 8a55571..4e51816 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_MAP_H
 #define QTCONCURRENT_MAP_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index ceeaa6e..a1ca2b6 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_MAPKERNEL_H
 #define QTCONCURRENT_MAPKERNEL_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 78fc3d9..9a17ecb 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_MEDIAN_H
 #define QTCONCURRENT_MEDIAN_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index ddf5629..4eaa767 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_REDUCEKERNEL_H
 #define QTCONCURRENT_REDUCEKERNEL_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 4be3c20..bb7b393 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_RESULTSTORE_H
 #define QTCONCURRENT_RESULTSTORE_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_QFUTURE
 
index d728538..0e46db8 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef QTCONCURRENT_RUN_H
 #define QTCONCURRENT_RUN_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 2105437..2637abf 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_RUNBASE_H
 #define QTCONCURRENT_RUNBASE_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index c311a72..d980e25 100644 (file)
@@ -43,7 +43,7 @@
 #ifndef QTCONCURRENT_STOREDFUNCTIONCALL_H
 #define QTCONCURRENT_STOREDFUNCTIONCALL_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 #include <QtConcurrent/qtconcurrentrunbase.h>
index 679496c..3ecdc84 100644 (file)
@@ -42,7 +42,7 @@
 #ifndef QTCONCURRENT_THREADENGINE_H
 #define QTCONCURRENT_THREADENGINE_H
 
-#include <QtCore/qglobal.h>
+#include <QtConcurrent/qtconcurrent_global.h>
 
 #ifndef QT_NO_CONCURRENT
 
index 4566240..91ac4bd 100644 (file)
@@ -671,11 +671,6 @@ class QDataStream;
 #      define Q_DBUS_EXPORT Q_DECL_IMPORT
 #    endif
 #    define Q_TEMPLATEDLL
-#    if defined(QT_BUILD_CONCURRENT_LIB)
-#      define Q_CONCURRENT_EXPORT Q_DECL_EXPORT
-#    else
-#      define Q_CONCURRENT_EXPORT Q_DECL_IMPORT
-#    endif
 #  elif defined(QT_DLL) /* use a Qt DLL library */
 #    define Q_CORE_EXPORT Q_DECL_IMPORT
 #    define Q_GUI_EXPORT Q_DECL_IMPORT
@@ -697,7 +692,6 @@ class QDataStream;
 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_IMPORT
 #    define Q_COMPAT_EXPORT Q_DECL_IMPORT
 #    define Q_DBUS_EXPORT Q_DECL_IMPORT
-#    define Q_CONCURRENT_EXPORT Q_DECL_IMPORT
 #    define Q_TEMPLATEDLL
 #  endif
 #  define Q_NO_DECLARED_NOT_DEFINED
@@ -731,7 +725,6 @@ class QDataStream;
 #    define Q_SCRIPTTOOLS_EXPORT Q_DECL_EXPORT
 #    define Q_COMPAT_EXPORT Q_DECL_EXPORT
 #    define Q_DBUS_EXPORT Q_DECL_EXPORT
-#    define Q_CONCURRENT_EXPORT Q_DECL_EXPORT
 #  else
 #    define Q_CORE_EXPORT
 #    define Q_GUI_EXPORT
@@ -752,7 +745,6 @@ class QDataStream;
 #    define Q_SCRIPTTOOLS_EXPORT
 #    define Q_COMPAT_EXPORT
 #    define Q_DBUS_EXPORT
-#    define Q_CONCURRENT_EXPORT
 #  endif
 #endif
 
@@ -1752,17 +1744,6 @@ Q_CORE_EXPORT int qrand();
 
 #define QT_MODULE(x)
 
-#ifdef QT_NO_CONCURRENT
-#  define QT_NO_QFUTURE
-#endif
-
-// gcc 3 version has problems with some of the
-// map/filter overloads.
-#if defined(Q_CC_GNU) && (__GNUC__ < 4)
-#  define QT_NO_CONCURRENT_MAP
-#  define QT_NO_CONCURRENT_FILTER
-#endif
-
 #ifdef Q_OS_QNX
 // QNX doesn't have SYSV style shared memory. Multiprocess QWS apps,
 // shared fonts and QSystemSemaphore + QSharedMemory are not available