From 5fb2122c34a8a129379d637a203b6f50cef02e02 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Abecasis?= Date: Mon, 6 Feb 2012 00:40:36 +0100 Subject: Move QtConcurrent configuration to a single file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Morten Johan Sørvig --- src/concurrent/concurrent.pro | 1 + src/concurrent/qfuture.h | 2 +- src/concurrent/qfutureinterface.h | 3 +- src/concurrent/qfutureinterface_p.h | 2 + src/concurrent/qfuturesynchronizer.h | 2 + src/concurrent/qfuturewatcher.h | 2 + src/concurrent/qfuturewatcher_p.h | 2 + src/concurrent/qtconcurrent_global.h | 84 +++++++++++++++++++++++++ src/concurrent/qtconcurrentcompilertest.h | 9 +-- src/concurrent/qtconcurrentexception.h | 2 +- src/concurrent/qtconcurrentfilter.h | 2 +- src/concurrent/qtconcurrentfilterkernel.h | 2 +- src/concurrent/qtconcurrentfunctionwrappers.h | 2 +- src/concurrent/qtconcurrentiteratekernel.h | 2 +- src/concurrent/qtconcurrentmap.h | 2 +- src/concurrent/qtconcurrentmapkernel.h | 2 +- src/concurrent/qtconcurrentmedian.h | 2 +- src/concurrent/qtconcurrentreducekernel.h | 2 +- src/concurrent/qtconcurrentresultstore.h | 2 +- src/concurrent/qtconcurrentrun.h | 2 +- src/concurrent/qtconcurrentrunbase.h | 2 +- src/concurrent/qtconcurrentstoredfunctioncall.h | 2 +- src/concurrent/qtconcurrentthreadengine.h | 2 +- src/corelib/global/qglobal.h | 19 ------ 24 files changed, 111 insertions(+), 43 deletions(-) create mode 100644 src/concurrent/qtconcurrent_global.h diff --git a/src/concurrent/concurrent.pro b/src/concurrent/concurrent.pro index 8ef3c5ca59..6bf16e6a0a 100644 --- a/src/concurrent/concurrent.pro +++ b/src/concurrent/concurrent.pro @@ -31,6 +31,7 @@ SOURCES += \ qtconcurrentexception.cpp HEADERS += \ + qtconcurrent_global.h \ qfuture.h \ qfutureinterface.h \ qfuturesynchronizer.h \ diff --git a/src/concurrent/qfuture.h b/src/concurrent/qfuture.h index 6e99a6068e..4005fe58fa 100644 --- a/src/concurrent/qfuture.h +++ b/src/concurrent/qfuture.h @@ -42,7 +42,7 @@ #ifndef QFUTURE_H #define QFUTURE_H -#include +#include #ifndef QT_NO_QFUTURE diff --git a/src/concurrent/qfutureinterface.h b/src/concurrent/qfutureinterface.h index 3f05466cc6..9ae2df5d07 100644 --- a/src/concurrent/qfutureinterface.h +++ b/src/concurrent/qfutureinterface.h @@ -42,7 +42,8 @@ #ifndef QFUTUREINTERFACE_H #define QFUTUREINTERFACE_H -#include +#include + #include #ifndef QT_NO_QFUTURE diff --git a/src/concurrent/qfutureinterface_p.h b/src/concurrent/qfutureinterface_p.h index ea52621378..3a73f846ac 100644 --- a/src/concurrent/qfutureinterface_p.h +++ b/src/concurrent/qfutureinterface_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #include #include #include diff --git a/src/concurrent/qfuturesynchronizer.h b/src/concurrent/qfuturesynchronizer.h index 8b7e710ea9..3106dd44ac 100644 --- a/src/concurrent/qfuturesynchronizer.h +++ b/src/concurrent/qfuturesynchronizer.h @@ -42,6 +42,8 @@ #ifndef QFUTRUESYNCHRONIZER_H #define QFUTRUESYNCHRONIZER_H +#include + #include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qfuturewatcher.h b/src/concurrent/qfuturewatcher.h index 6b4b941621..11dab42174 100644 --- a/src/concurrent/qfuturewatcher.h +++ b/src/concurrent/qfuturewatcher.h @@ -42,6 +42,8 @@ #ifndef QFUTUREWATCHER_H #define QFUTUREWATCHER_H +#include + #include #ifndef QT_NO_QFUTURE diff --git a/src/concurrent/qfuturewatcher_p.h b/src/concurrent/qfuturewatcher_p.h index 27bc49439a..46486bf571 100644 --- a/src/concurrent/qfuturewatcher_p.h +++ b/src/concurrent/qfuturewatcher_p.h @@ -53,6 +53,8 @@ // We mean it. // +#include + #include "qfutureinterface_p.h" #include diff --git a/src/concurrent/qtconcurrent_global.h b/src/concurrent/qtconcurrent_global.h new file mode 100644 index 0000000000..1e26c2321d --- /dev/null +++ b/src/concurrent/qtconcurrent_global.h @@ -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 + +#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 diff --git a/src/concurrent/qtconcurrentcompilertest.h b/src/concurrent/qtconcurrentcompilertest.h index 7818423090..7f3f7d4262 100644 --- a/src/concurrent/qtconcurrentcompilertest.h +++ b/src/concurrent/qtconcurrentcompilertest.h @@ -42,20 +42,13 @@ #ifndef QTCONCURRENT_COMPILERTEST_H #define QTCONCURRENT_COMPILERTEST_H -#include +#include #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 diff --git a/src/concurrent/qtconcurrentexception.h b/src/concurrent/qtconcurrentexception.h index 2021e7787c..80926c49c1 100644 --- a/src/concurrent/qtconcurrentexception.h +++ b/src/concurrent/qtconcurrentexception.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_EXCEPTION_H #define QTCONCURRENT_EXCEPTION_H -#include +#include #ifndef QT_NO_QFUTURE diff --git a/src/concurrent/qtconcurrentfilter.h b/src/concurrent/qtconcurrentfilter.h index 1de8d230b1..3d4c1d6f57 100644 --- a/src/concurrent/qtconcurrentfilter.h +++ b/src/concurrent/qtconcurrentfilter.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_FILTER_H #define QTCONCURRENT_FILTER_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentfilterkernel.h b/src/concurrent/qtconcurrentfilterkernel.h index 71112cb5a3..9bb4396f41 100644 --- a/src/concurrent/qtconcurrentfilterkernel.h +++ b/src/concurrent/qtconcurrentfilterkernel.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_FILTERKERNEL_H #define QTCONCURRENT_FILTERKERNEL_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentfunctionwrappers.h b/src/concurrent/qtconcurrentfunctionwrappers.h index 9b86b73f6d..c87770f6c0 100644 --- a/src/concurrent/qtconcurrentfunctionwrappers.h +++ b/src/concurrent/qtconcurrentfunctionwrappers.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_FUNCTIONWRAPPERS_H #define QTCONCURRENT_FUNCTIONWRAPPERS_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentiteratekernel.h b/src/concurrent/qtconcurrentiteratekernel.h index 4858053752..6776ff0346 100644 --- a/src/concurrent/qtconcurrentiteratekernel.h +++ b/src/concurrent/qtconcurrentiteratekernel.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_ITERATEKERNEL_H #define QTCONCURRENT_ITERATEKERNEL_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentmap.h b/src/concurrent/qtconcurrentmap.h index 8a5557183d..4e51816b58 100644 --- a/src/concurrent/qtconcurrentmap.h +++ b/src/concurrent/qtconcurrentmap.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_MAP_H #define QTCONCURRENT_MAP_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentmapkernel.h b/src/concurrent/qtconcurrentmapkernel.h index ceeaa6e3b3..a1ca2b60fd 100644 --- a/src/concurrent/qtconcurrentmapkernel.h +++ b/src/concurrent/qtconcurrentmapkernel.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_MAPKERNEL_H #define QTCONCURRENT_MAPKERNEL_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentmedian.h b/src/concurrent/qtconcurrentmedian.h index 78fc3d97c8..9a17ecb3b4 100644 --- a/src/concurrent/qtconcurrentmedian.h +++ b/src/concurrent/qtconcurrentmedian.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_MEDIAN_H #define QTCONCURRENT_MEDIAN_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentreducekernel.h b/src/concurrent/qtconcurrentreducekernel.h index ddf56298ad..4eaa767b1d 100644 --- a/src/concurrent/qtconcurrentreducekernel.h +++ b/src/concurrent/qtconcurrentreducekernel.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_REDUCEKERNEL_H #define QTCONCURRENT_REDUCEKERNEL_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentresultstore.h b/src/concurrent/qtconcurrentresultstore.h index 4be3c20d48..bb7b39311f 100644 --- a/src/concurrent/qtconcurrentresultstore.h +++ b/src/concurrent/qtconcurrentresultstore.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_RESULTSTORE_H #define QTCONCURRENT_RESULTSTORE_H -#include +#include #ifndef QT_NO_QFUTURE diff --git a/src/concurrent/qtconcurrentrun.h b/src/concurrent/qtconcurrentrun.h index d7285388da..0e46db868d 100644 --- a/src/concurrent/qtconcurrentrun.h +++ b/src/concurrent/qtconcurrentrun.h @@ -43,7 +43,7 @@ #ifndef QTCONCURRENT_RUN_H #define QTCONCURRENT_RUN_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentrunbase.h b/src/concurrent/qtconcurrentrunbase.h index 2105437ede..2637abfc2e 100644 --- a/src/concurrent/qtconcurrentrunbase.h +++ b/src/concurrent/qtconcurrentrunbase.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_RUNBASE_H #define QTCONCURRENT_RUNBASE_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/concurrent/qtconcurrentstoredfunctioncall.h b/src/concurrent/qtconcurrentstoredfunctioncall.h index c311a72427..d980e25623 100644 --- a/src/concurrent/qtconcurrentstoredfunctioncall.h +++ b/src/concurrent/qtconcurrentstoredfunctioncall.h @@ -43,7 +43,7 @@ #ifndef QTCONCURRENT_STOREDFUNCTIONCALL_H #define QTCONCURRENT_STOREDFUNCTIONCALL_H -#include +#include #ifndef QT_NO_CONCURRENT #include diff --git a/src/concurrent/qtconcurrentthreadengine.h b/src/concurrent/qtconcurrentthreadengine.h index 679496ce40..3ecdc84600 100644 --- a/src/concurrent/qtconcurrentthreadengine.h +++ b/src/concurrent/qtconcurrentthreadengine.h @@ -42,7 +42,7 @@ #ifndef QTCONCURRENT_THREADENGINE_H #define QTCONCURRENT_THREADENGINE_H -#include +#include #ifndef QT_NO_CONCURRENT diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 456624071c..91ac4bd41d 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -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 -- cgit v1.2.3