Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of it

QLinkedList is still used in several tests. Add exceptions for
these subdirs.

Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This commit is contained in:
Marc Mutz 2019-07-02 12:36:13 +02:00
parent 389988c42f
commit 0a724ac74c
13 changed files with 25 additions and 1 deletions

View File

@ -2,6 +2,7 @@ load(qt_build_config)
CONFIG += warning_clean
DEFINES += QT_NO_JAVA_STYLE_ITERATORS
DEFINES += QT_NO_LINKED_LIST
QT_SOURCE_TREE = $$PWD
QT_BUILD_TREE = $$shadowed($$PWD)

View File

@ -216,7 +216,7 @@ inline Q_DECL_CONSTEXPR int qMetaTypeId();
F(QQueue) \
F(QStack) \
F(QSet) \
F(QLinkedList)
/*end*/
#define QT_FOR_EACH_AUTOMATIC_TEMPLATE_2ARG(F) \
F(QHash, class) \

View File

@ -47,7 +47,9 @@ QT_BEGIN_NAMESPACE
template <class Key, class T> class QCache;
template <class Key, class T> class QHash;
#ifndef QT_NO_LINKED_LIST
template <class T> class QLinkedList;
#endif
template <class T> class QList;
template <class Key, class T> class QMap;
template <class Key, class T> class QMultiHash;

View File

@ -37,6 +37,10 @@
**
****************************************************************************/
#ifdef QT_NO_LINKED_LIST
# undef QT_NO_LINKED_LIST
#endif
#include "qlinkedlist.h"
QT_BEGIN_NAMESPACE

View File

@ -40,6 +40,10 @@
#ifndef QLINKEDLIST_H
#define QLINKEDLIST_H
#include <QtCore/qglobal.h>
#ifndef QT_NO_LINKED_LIST
#include <QtCore/qiterator.h>
#include <QtCore/qrefcount.h>
#include <QtCore/qcontainertools_impl.h>
@ -581,4 +585,8 @@ inline QDataStream &operator<<(QDataStream &s, const QLinkedList<T> &l)
QT_END_NAMESPACE
Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(QLinkedList)
#endif // QT_NO_LINKED_LIST
#endif // QLINKEDLIST_H

View File

@ -3,3 +3,4 @@ TARGET = tst_qtconcurrentfilter
QT = core testlib concurrent
SOURCES = tst_qtconcurrentfilter.cpp
DEFINES += QT_STRICT_ITERATORS
DEFINES -= QT_NO_LINKED_LIST

View File

@ -3,6 +3,7 @@ TARGET = tst_qtconcurrentmap
QT = core testlib concurrent
SOURCES = tst_qtconcurrentmap.cpp
DEFINES += QT_STRICT_ITERATORS
DEFINES -= QT_NO_LINKED_LIST
# Force C++17 if available
contains(QT_CONFIG, c++1z): CONFIG += c++1z

View File

@ -5,6 +5,7 @@ INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qmetatype.cpp
TESTDATA=./typeFlags.bin
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
DEFINES -= QT_NO_LINKED_LIST
msvc|winrt {
# Prevents "fatal error C1128: number of sections exceeded object file format limit".

View File

@ -5,6 +5,7 @@ INCLUDEPATH += $$PWD/../../../other/qvariant_common
SOURCES = tst_qvariant.cpp
RESOURCES += qvariant.qrc
DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0
DEFINES -= QT_NO_LINKED_LIST
qtConfig(c++14): CONFIG += c++14
qtConfig(c++1z): CONFIG += c++1z
!qtConfig(doubleconversion):!qtConfig(system-doubleconversion) {

View File

@ -3,6 +3,8 @@ TARGET = tst_qdatastream
QT += testlib
SOURCES = tst_qdatastream.cpp
DEFINES -= QT_NO_LINKED_LIST
TESTDATA += datastream.q42
android:!android-embedded {

View File

@ -4,5 +4,6 @@ SOURCES += tst_collections.cpp
QT = core testlib
# This test does not work with strict iterators
DEFINES -= QT_NO_LINKED_LIST
DEFINES -= QT_STRICT_ITERATORS
DEFINES -= QT_NO_JAVA_STYLE_ITERATORS

View File

@ -5,3 +5,4 @@ QT = core testlib
# This test does not work with strict iterators
DEFINES -= QT_STRICT_ITERATORS
DEFINES -= QT_NO_LINKED_LIST

View File

@ -2,3 +2,4 @@ CONFIG += testcase
TARGET = tst_qlinkedlist
QT = core testlib
SOURCES = tst_qlinkedlist.cpp
DEFINES -= QT_NO_LINKED_LIST