diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/tools/qarraydata.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qvector_msvc.cpp | 60 | ||||
-rw-r--r-- | src/corelib/tools/tools.pri | 1 |
3 files changed, 63 insertions, 2 deletions
diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index 27f2606954..7df4694bcd 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -142,7 +142,7 @@ struct QTypedArrayData inline iterator() : i(0) {} inline iterator(T *n) : i(n) {} - inline iterator(const iterator &o): i(o.i){} + inline iterator(const iterator &o): i(o.i){} // #### Qt 6: remove, the implicit version is fine inline T &operator*() const { return *i; } inline T *operator->() const { return i; } inline T &operator[](int j) const { return *(i + j); } @@ -176,7 +176,7 @@ struct QTypedArrayData inline const_iterator() : i(0) {} inline const_iterator(const T *n) : i(n) {} - inline const_iterator(const const_iterator &o): i(o.i) {} + inline const_iterator(const const_iterator &o): i(o.i) {} // #### Qt 6: remove, the default version is fine inline explicit const_iterator(const iterator &o): i(o.i) {} inline const T &operator*() const { return *i; } inline const T *operator->() const { return i; } diff --git a/src/corelib/tools/qvector_msvc.cpp b/src/corelib/tools/qvector_msvc.cpp new file mode 100644 index 0000000000..8570fcf5fe --- /dev/null +++ b/src/corelib/tools/qvector_msvc.cpp @@ -0,0 +1,60 @@ +/**************************************************************************** +** +** Copyright (C) 2014 Intel Corporation +** Contact: http://www.qt-project.org/legal +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and Digia. For licensing terms and +** conditions see http://qt.digia.com/licensing. For further information +** use the contact form at http://qt.digia.com/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, 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, Digia gives you certain additional +** rights. These rights are described in the Digia 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. +** +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +// ### Qt6: verify if we can remove this, somehow. +// First, try to see if the extern template from qvector.h is necessary. +// If it still is, check if removing the copy constructors in qarraydata.h +// make the calling convention of both sets of begin() and end() functions +// match, as it does for the IA-64 C++ ABI. + +#ifdef QVECTOR_H +# error "This file must be compiled with no precompiled headers" +#endif + +// invert the setting of QT_STRICT_ITERATORS, whichever it was +#ifdef QT_STRICT_ITERATORS +# undef QT_STRICT_ITERATORS +#else +# define QT_STRICT_ITERATORS +#endif + +// the Q_TEMPLATE_EXTERN at the bottom of qvector.h will do the trick +#include <QtCore/qvector.h> diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri index a727315700..ba995b047d 100644 --- a/src/corelib/tools/tools.pri +++ b/src/corelib/tools/tools.pri @@ -115,6 +115,7 @@ SOURCES += \ tools/qvsnprintf.cpp NO_PCH_SOURCES = tools/qstring_compat.cpp +msvc: NO_PCH_SOURCES += tools/qvector_msvc.cpp false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator !nacl:mac: { |