Move QtConcurrent configuration to a single file

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>
This commit is contained in:
João Abecasis 2012-02-06 00:40:36 +01:00 committed by Qt by Nokia
parent 4a99a42adb
commit 5fb2122c34
24 changed files with 111 additions and 43 deletions

View File

@ -31,6 +31,7 @@ SOURCES += \
qtconcurrentexception.cpp
HEADERS += \
qtconcurrent_global.h \
qfuture.h \
qfutureinterface.h \
qfuturesynchronizer.h \

View File

@ -42,7 +42,7 @@
#ifndef QFUTURE_H
#define QFUTURE_H
#include <QtCore/qglobal.h>
#include <QtConcurrent/qtconcurrent_global.h>
#ifndef QT_NO_QFUTURE

View 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

View 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>

View File

@ -42,6 +42,8 @@
#ifndef QFUTRUESYNCHRONIZER_H
#define QFUTRUESYNCHRONIZER_H
#include <QtConcurrent/qtconcurrent_global.h>
#include <QtConcurrent/qfuture.h>
#ifndef QT_NO_CONCURRENT

View File

@ -42,6 +42,8 @@
#ifndef QFUTUREWATCHER_H
#define QFUTUREWATCHER_H
#include <QtConcurrent/qtconcurrent_global.h>
#include <QtConcurrent/qfuture.h>
#ifndef QT_NO_QFUTURE

View File

@ -53,6 +53,8 @@
// We mean it.
//
#include <QtConcurrent/qtconcurrent_global.h>
#include "qfutureinterface_p.h"
#include <qlist.h>

View File

@ -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

View File

@ -42,20 +42,13 @@
#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>

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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>

View 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

View 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