From 8435ba93fad9eb799764eb3b66a8a9838db3fea3 Mon Sep 17 00:00:00 2001 From: miniak Date: Tue, 3 Aug 2010 18:33:07 +0200 Subject: Remove obsolete code & workarounds for unsupported versions of MS Visual C++ The minimum supported version of MS Visual C++ 2003, which is _MSC_VER 1310. Merge-request: 756 Reviewed-by: Olivier Goffart --- src/corelib/concurrent/qtconcurrentcompilertest.h | 6 -- src/corelib/global/qendian.h | 4 +- src/corelib/global/qglobal.h | 60 +++--------- src/corelib/kernel/qobject.h | 101 +-------------------- src/corelib/kernel/qvariant.cpp | 8 -- src/corelib/tools/qmap.h | 4 +- src/corelib/tools/qsharedpointer_impl.h | 1 - src/corelib/tools/qstring.cpp | 4 - src/corelib/tools/qstring.h | 9 +- src/corelib/tools/qvector.h | 3 - .../qml/parser/qdeclarativejsengine_p.h | 6 -- src/gui/kernel/qwidget.h | 8 -- src/gui/text/qcssparser.cpp | 8 -- src/gui/text/qfontdatabase.cpp | 4 - src/network/kernel/qhostinfo_win.cpp | 5 - src/script/api/qscriptengine.cpp | 7 -- src/script/api/qscriptengine.h | 12 +-- src/script/api/qscriptvalue.cpp | 12 +-- src/sql/drivers/odbc/qsql_odbc.cpp | 37 +++----- src/testlib/qtest_global.h | 2 +- tests/auto/collections/tst_collections.cpp | 11 --- tests/auto/qwidget/tst_qwidget.cpp | 28 +----- tools/configure/configureapp.cpp | 7 +- tools/configure/environment.cpp | 12 +-- tools/configure/environment.h | 4 - 25 files changed, 37 insertions(+), 326 deletions(-) diff --git a/src/corelib/concurrent/qtconcurrentcompilertest.h b/src/corelib/concurrent/qtconcurrentcompilertest.h index 982a50c..4fbb3d7 100644 --- a/src/corelib/concurrent/qtconcurrentcompilertest.h +++ b/src/corelib/concurrent/qtconcurrentcompilertest.h @@ -51,12 +51,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Core) -#ifdef Q_CC_MSVC -# if _MSC_VER < 1300 -# define QT_CONURRENT_NONSTANDARD_COMPILER -# endif -#endif - #if defined (Q_CC_MSVC) && (_MSC_VER < 1300) # define QT_TYPENAME #else diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index d53504a..e0e946b 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -89,7 +89,7 @@ template inline void qToUnaligned(const T src, uchar *dest) * and return the value in host-endian encoding. * There is no requirement that \a src must be aligned. */ -#if defined Q_CC_MSVC && _MSC_VER < 1300 || defined Q_CC_SUN +#if defined Q_CC_SUN inline quint64 qFromLittleEndian_helper(const uchar *src, quint64 *dest) { return 0 @@ -177,7 +177,7 @@ template <> inline qint16 qFromLittleEndian(const uchar *src) * and return the value in host-endian encoding. * There is no requirement that \a src must be aligned. */ -#if defined Q_CC_MSVC && _MSC_VER < 1300 || defined Q_CC_SUN +#if defined Q_CC_SUN inline quint64 qFromBigEndian_helper(const uchar *src, quint64 *dest) { return 0 diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 519e6e0..1d78cbd 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -383,31 +383,12 @@ namespace QT_NAMESPACE {} #elif defined(_MSC_VER) # define Q_CC_MSVC -/* proper support of bool for _MSC_VER >= 1100 */ +# define Q_CC_MSVC_NET # define Q_CANNOT_DELETE_CONSTANT # define Q_OUTOFLINE_TEMPLATE inline # define Q_NO_TEMPLATE_FRIENDS -# define QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION -# define Q_ALIGNOF(type) __alignof(type) -# define Q_DECL_ALIGN(n) __declspec(align(n)) - -/* Visual C++.Net issues for _MSC_VER >= 1300 */ -# if _MSC_VER >= 1300 -# define Q_CC_MSVC_NET -# if _MSC_VER < 1310 || (defined(Q_OS_WIN64) && defined(_M_IA64)) -# define Q_TYPENAME -# else -# undef QT_NO_PARTIAL_TEMPLATE_SPECIALIZATION -# endif -# else -# define Q_NO_USING_KEYWORD -# define QT_NO_MEMBER_TEMPLATES -# endif -# if _MSC_VER < 1310 -# define QT_NO_QOBJECT_CHECK -# define Q_TYPENAME -# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS -# endif +# define Q_ALIGNOF(type) __alignof(type) +# define Q_DECL_ALIGN(n) __declspec(align(n)) /* Intel C++ disguising as Visual C++: the `using' keyword avoids warnings */ # if defined(__INTEL_COMPILER) # define Q_CC_INTEL @@ -924,10 +905,10 @@ redefine to built-in booleans to make autotests work properly */ #endif /* - Proper for-scoping in VC++6 and MIPSpro CC + Proper for-scoping in MIPSpro CC */ #ifndef QT_NO_KEYWORDS -# if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64)) +# if defined(Q_CC_MIPS) || (defined(Q_CC_HPACC) && defined(__ia64)) # define for if(0){}else for # endif #endif @@ -951,7 +932,7 @@ redefine to built-in booleans to make autotests work properly */ # define Q_DECL_DEPRECATED Q_DECL_DEPRECATED #elif (defined(Q_CC_GNU) && !defined(Q_CC_INTEL) && (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))) || defined(Q_CC_RVCT) # define Q_DECL_DEPRECATED __attribute__ ((__deprecated__)) -#elif defined(Q_CC_MSVC) && (_MSC_VER >= 1300) +#elif defined(Q_CC_MSVC) # define Q_DECL_DEPRECATED __declspec(deprecated) # if defined (Q_CC_INTEL) # define Q_DECL_VARIABLE_DEPRECATED @@ -1053,7 +1034,7 @@ redefine to built-in booleans to make autotests work properly */ #else # define QT_FASTCALL #endif -# elif defined(Q_CC_MSVC) && (_MSC_VER > 1300 || defined(Q_CC_INTEL)) +# elif defined(Q_CC_MSVC) # define QT_FASTCALL __fastcall # else # define QT_FASTCALL @@ -1721,12 +1702,7 @@ inline T *q_check_ptr(T *p) { Q_CHECK_PTR(p); return p; } #if (defined(Q_CC_GNU) && !defined(Q_OS_SOLARIS)) || defined(Q_CC_HPACC) || defined(Q_CC_DIAB) # define Q_FUNC_INFO __PRETTY_FUNCTION__ #elif defined(_MSC_VER) - /* MSVC 2002 doesn't have __FUNCSIG__ nor can it handle QT_STRINGIFY. */ -# if _MSC_VER <= 1300 -# define Q_FUNC_INFO __FILE__ "(line number unavailable)" -# else -# define Q_FUNC_INFO __FUNCSIG__ -# endif +# define Q_FUNC_INFO __FUNCSIG__ #else # if defined(Q_OS_SOLARIS) || defined(Q_CC_XLC) || defined(Q_OS_SYMBIAN) # define Q_FUNC_INFO __FILE__ "(line number unavailable)" @@ -2149,10 +2125,6 @@ Q_CORE_EXPORT void *qMemSet(void *dest, int c, size_t n); # pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */ # pragma warning(disable: 4710) /* function not inlined */ # pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify -GX */ -# if _MSC_VER < 1300 -# pragma warning(disable: 4284) /* return type for 'type1::operator ->' is 'type2 *' */ - /* (ie; not a UDT or reference to a UDT. Will produce errors if applied using infix notation) */ -# endif # elif defined(Q_CC_BOR) # pragma option -w-inl # pragma option -w-aus @@ -2226,13 +2198,9 @@ public: #define Q_DECLARE_FLAGS(Flags, Enum)\ typedef QFlags Flags; -#if defined Q_CC_MSVC && _MSC_VER < 1300 -# define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) -#else -# define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ +#define Q_DECLARE_INCOMPATIBLE_FLAGS(Flags) \ inline QIncompatibleFlag operator|(Flags::enum_type f1, int f2) \ { return QIncompatibleFlag(int(f1) | f2); } -#endif #define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags) \ inline QFlags operator|(Flags::enum_type f1, Flags::enum_type f2) \ @@ -2289,9 +2257,9 @@ template inline const QForeachContainer *qForeachContainer(const QForeachContainerBase *base, const T *) { return static_cast *>(base); } -#if (defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) && !defined(Q_CC_INTEL)) || defined(Q_CC_MIPS) +#if defined(Q_CC_MIPS) /* - Proper for-scoping in VC++6 and MIPSpro CC + Proper for-scoping in MIPSpro CC */ # define Q_FOREACH(variable,container) \ if(0){}else \ @@ -2648,12 +2616,6 @@ QT_LICENSED_MODULE(DBus) # define QT_NO_QFUTURE #endif -// MSVC 6.0 and MSVC .NET 2002, can`t handle the map(), etc templates, -// but the QFuture class compiles. -#if (defined(Q_CC_MSVC) && _MSC_VER <= 1300) -# define QT_NO_CONCURRENT -#endif - // gcc 3 version has problems with some of the // map/filter overloads. #if defined(Q_CC_GNU) && (__GNUC__ < 4) diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h index d26f078..7f0084c 100644 --- a/src/corelib/kernel/qobject.h +++ b/src/corelib/kernel/qobject.h @@ -77,18 +77,10 @@ class QObjectUserData; typedef QList QObjectList; -#if defined Q_CC_MSVC && _MSC_VER < 1300 -template inline T qFindChild(const QObject *o, const QString &name = QString(), T = 0); -template inline QList qFindChildren(const QObject *o, const QString &name = QString(), T = 0); -# ifndef QT_NO_REGEXP -template inline QList qFindChildren(const QObject *o, const QRegExp &re, T = 0); -# endif -#else template inline T qFindChild(const QObject *, const QString & = QString()); template inline QList qFindChildren(const QObject *, const QString & = QString()); -# ifndef QT_NO_REGEXP +#ifndef QT_NO_REGEXP template inline QList qFindChildren(const QObject *, const QRegExp &); -# endif #endif class @@ -342,95 +334,6 @@ Q_CORE_EXPORT void qt_qFindChildren_helper(const QObject *parent, const QString const QMetaObject &mo, QList *list); Q_CORE_EXPORT QObject *qt_qFindChild_helper(const QObject *parent, const QString &name, const QMetaObject &mo); -#if defined Q_CC_MSVC && _MSC_VER < 1300 - -template -inline T qFindChild(const QObject *o, const QString &name, T) -{ return static_cast(qt_qFindChild_helper(o, name, ((T)0)->staticMetaObject)); } - -template -inline QList qFindChildren(const QObject *o, const QString &name, T) -{ - QList list; - union { - QList *typedList; - QList *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(o, name, 0, ((T)0)->staticMetaObject, u.voidList); - return list; -} - -template -inline T qFindChild(const QObject *o, const QString &name) -{ return qFindChild(o, name, T(0)); } - -template -inline T qFindChild(const QObject *o) -{ return qFindChild(o, QString(), T(0)); } - -template -inline QList qFindChildren(const QObject *o, const QString &name) -{ return qFindChildren(o, name, T(0)); } - -template -inline QList qFindChildren(const QObject *o) -{ return qFindChildren(o, QString(), T(0)); } - -#ifndef QT_NO_REGEXP -template -inline QList qFindChildren(const QObject *o, const QRegExp &re, T) -{ - QList list; - union { - QList *typedList; - QList *voidList; - } u; - u.typedList = &list; - qt_qFindChildren_helper(o, 0, &re, ((T)0)->staticMetaObject, u.voidList); - return list; -} - -template -inline QList qFindChildren(const QObject *o, const QRegExp &re) -{ return qFindChildren(o, re, T(0)); } - -#endif - -#ifdef Q_MOC_RUN -# define Q_DECLARE_INTERFACE(IFace, IId) Q_DECLARE_INTERFACE(IFace, IId) -#endif // Q_MOC_RUN - - -template inline const char * qobject_interface_iid() -{ return 0; } - -template inline T qobject_cast_helper(QObject *object, T) -{ return static_cast(((T)0)->staticMetaObject.cast(object)); } - -template inline T qobject_cast_helper(const QObject *object, T) -{ return static_cast(const_cast(((T)0)->staticMetaObject.cast(const_cast(object)))); } - -template -inline T qobject_cast(QObject *object) -{ return qobject_cast_helper(object, T(0)); } - -template -inline T qobject_cast(const QObject *object) -{ return qobject_cast_helper(object, T(0)); } - -#ifndef Q_MOC_RUN -# define Q_DECLARE_INTERFACE(IFace, IId) \ - template <> inline const char *qobject_interface_iid() \ - { return IId; } \ - template <> inline IFace *qobject_cast_helper(QObject *object, IFace *) \ - { return (IFace *)(object ? object->qt_metacast(IId) : 0); } \ - template <> inline IFace *qobject_cast_helper(const QObject *object, IFace *) \ - { return (IFace *)(object ? const_cast(object)->qt_metacast(IId) : 0); } -#endif // Q_MOC_RUN - -#else - template inline T qFindChild(const QObject *o, const QString &name) { return static_cast(qt_qFindChild_helper(o, name, reinterpret_cast(0)->staticMetaObject)); } @@ -499,8 +402,6 @@ template inline const char * qobject_interface_iid() { return reinterpret_cast((object ? const_cast(object)->qt_metacast(IId) : 0)); } #endif // Q_MOC_RUN -#endif - #ifndef QT_NO_DEBUG_STREAM Q_CORE_EXPORT QDebug operator<<(QDebug, const QObject *); #endif diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index f5d7c0d..9617e0c 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -947,11 +947,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, case QMetaType::UChar: case QMetaType::UShort: case QMetaType::ULong: -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - *f = (double)(qlonglong)qMetaTypeUNumber(d); -#else *f = double(qMetaTypeUNumber(d)); -#endif break; default: *f = 0.0; @@ -986,11 +982,7 @@ static bool convert(const QVariant::Private *d, QVariant::Type t, void *result, case QMetaType::UChar: case QMetaType::UShort: case QMetaType::ULong: -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - *f = (float)(qlonglong)qMetaTypeUNumber(d); -#else *f = float(qMetaTypeUNumber(d)); -#endif break; default: *f = 0.0f; diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h index e4b73a1..d15df0b 100644 --- a/src/corelib/tools/qmap.h +++ b/src/corelib/tools/qmap.h @@ -639,13 +639,13 @@ Q_OUTOFLINE_TEMPLATE void QMap::freeData(QMapData *x) while (next != x) { cur = next; next = cur->forward[0]; -#if defined(_MSC_VER) && (_MSC_VER >= 1300) +#if defined(_MSC_VER) #pragma warning(disable:4189) #endif Node *concreteNode = concrete(reinterpret_cast(cur)); concreteNode->key.~Key(); concreteNode->value.~T(); -#if defined(_MSC_VER) && (_MSC_VER >= 1300) +#if defined(_MSC_VER) #pragma warning(default:4189) #endif } diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 083c7c2..dd27f7e 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -109,7 +109,6 @@ namespace QtSharedPointer { template inline void normalDeleter(T *t) { delete t; } // this uses partial template specialization - // the only compilers that didn't support this were MSVC 6.0 and 2002 template struct RemovePointer; template struct RemovePointer { typedef T Type; }; template struct RemovePointer > { typedef T Type; }; diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 3068af7..3371b36 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -336,11 +336,7 @@ inline char qToLower(char ch) return ch; } -#if defined(Q_CC_MSVC) && _MSC_VER <= 1300 -const QString::Null QString::null; -#else const QString::Null QString::null = { }; -#endif /*! \macro QT_NO_CAST_FROM_ASCII diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 952c572..7f7e475 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -51,14 +51,7 @@ #endif #ifndef QT_NO_STL -# if defined (Q_CC_MSVC_NET) && _MSC_VER < 1310 // Avoids nasty warning for xlocale, line 450 -# pragma warning (push) -# pragma warning (disable : 4189) -# include -# pragma warning (pop) -# else -# include -# endif +# include # ifndef QT_NO_STL_WCHAR // workaround for some headers not typedef'ing std::wstring diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h index c2e2485..5613c12 100644 --- a/src/corelib/tools/qvector.h +++ b/src/corelib/tools/qvector.h @@ -789,11 +789,8 @@ QT_END_INCLUDE_NAMESPACE #else #define Q_TEMPLATE_EXTERN extern #endif -# pragma warning(push) /* MSVC 6.0 doesn't care about the disabling in qglobal.h (why?), so do it here */ -# pragma warning(disable: 4231) /* nonstandard extension used : 'extern' before template explicit instantiation */ Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector; Q_TEMPLATE_EXTERN template class Q_CORE_EXPORT QVector; -# pragma warning(pop) #endif QT_END_NAMESPACE diff --git a/src/declarative/qml/parser/qdeclarativejsengine_p.h b/src/declarative/qml/parser/qdeclarativejsengine_p.h index 1389244..d0b744d 100644 --- a/src/declarative/qml/parser/qdeclarativejsengine_p.h +++ b/src/declarative/qml/parser/qdeclarativejsengine_p.h @@ -88,12 +88,6 @@ uint qHash(const QDeclarativeJS::NameId &id); } // end of namespace QDeclarativeJS -#if defined(Q_CC_MSVC) && _MSC_VER <= 1300 -//this ensures that code outside QDeclarativeJS can use the hash function -//it also a workaround for some compilers -inline uint qHash(const QDeclarativeJS::NameId &nameId) { return QDeclarativeJS::qHash(nameId); } -#endif - namespace QDeclarativeJS { class Lexer; diff --git a/src/gui/kernel/qwidget.h b/src/gui/kernel/qwidget.h index 941bd68..980f40f 100644 --- a/src/gui/kernel/qwidget.h +++ b/src/gui/kernel/qwidget.h @@ -898,13 +898,6 @@ protected: Q_DECLARE_OPERATORS_FOR_FLAGS(QWidget::RenderFlags) -#if defined Q_CC_MSVC && _MSC_VER < 1300 -template <> inline QWidget *qobject_cast_helper(QObject *o, QWidget *) -{ - if (!o || !o->isWidgetType()) return 0; - return (QWidget*)(o); -} -#else template <> inline QWidget *qobject_cast(QObject *o) { if (!o || !o->isWidgetType()) return 0; @@ -915,7 +908,6 @@ template <> inline const QWidget *qobject_cast(const QObject *o) if (!o || !o->isWidgetType()) return 0; return static_cast(o); } -#endif inline QWidget *QWidget::childAt(int ax, int ay) const { return childAt(QPoint(ax, ay)); } diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp index b3d2526..39c4053 100644 --- a/src/gui/text/qcssparser.cpp +++ b/src/gui/text/qcssparser.cpp @@ -1032,15 +1032,7 @@ bool ValueExtractor::extractBackground(QBrush *brush, QString *image, Repeat *re parseShorthandBackgroundProperty(decl.d->values, &brushData, image, repeat, alignment, pal); *brush = brushFromData(brushData, pal); if (brushData.type != BrushData::DependsOnThePalette) { -#if defined Q_CC_MSVC && _MSC_VER <= 1300 - BackgroundData data; - data.brush = brushData; - data.image = *image; - data.repeat = *repeat; - data.alignment = *alignment; -#else BackgroundData data = { brushData, *image, *repeat, *alignment }; -#endif decl.d->parsed = qVariantFromValue(data); } } diff --git a/src/gui/text/qfontdatabase.cpp b/src/gui/text/qfontdatabase.cpp index e6c36a4..2b26638 100644 --- a/src/gui/text/qfontdatabase.cpp +++ b/src/gui/text/qfontdatabase.cpp @@ -75,10 +75,6 @@ # define FM_DEBUG if (false) qDebug #endif -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) -# define for if(0){}else for -#endif - QT_BEGIN_NAMESPACE #define SMOOTH_SCALABLE 0xffff diff --git a/src/network/kernel/qhostinfo_win.cpp b/src/network/kernel/qhostinfo_win.cpp index 65257e8..1671ae4 100644 --- a/src/network/kernel/qhostinfo_win.cpp +++ b/src/network/kernel/qhostinfo_win.cpp @@ -39,11 +39,6 @@ ** ****************************************************************************/ -#if defined Q_CC_MSVC && _MSC_VER <=1300 -//VC.net 2002 support for templates doesn't match some PSDK requirements -#define _WSPIAPI_COUNTOF(_Array) (sizeof(_Array) / sizeof(_Array[0])) -#endif - #include #include "qhostinfo_p.h" diff --git a/src/script/api/qscriptengine.cpp b/src/script/api/qscriptengine.cpp index 4a18c7d..30c197e 100644 --- a/src/script/api/qscriptengine.cpp +++ b/src/script/api/qscriptengine.cpp @@ -2986,14 +2986,7 @@ JSC::JSValue QScriptEnginePrivate::create(JSC::ExecState *exec, int type, const case QMetaType::LongLong: return JSC::jsNumber(exec, qsreal(*reinterpret_cast(ptr))); case QMetaType::ULongLong: -#if defined(Q_OS_WIN) && defined(_MSC_FULL_VER) && _MSC_FULL_VER <= 12008804 -#pragma message("** NOTE: You need the Visual Studio Processor Pack to compile support for 64bit unsigned integers.") - return JSC::jsNumber(exec, qsreal((qlonglong)*reinterpret_cast(ptr))); -#elif defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - return JSC::jsNumber(exec, qsreal((qlonglong)*reinterpret_cast(ptr))); -#else return JSC::jsNumber(exec, qsreal(*reinterpret_cast(ptr))); -#endif case QMetaType::Double: return JSC::jsNumber(exec, qsreal(*reinterpret_cast(ptr))); case QMetaType::QString: diff --git a/src/script/api/qscriptengine.h b/src/script/api/qscriptengine.h index 3212ed5..1fe65db 100644 --- a/src/script/api/qscriptengine.h +++ b/src/script/api/qscriptengine.h @@ -349,11 +349,7 @@ inline bool qscriptvalue_cast_helper(const QScriptValue &value, int type, void * } template -T qscriptvalue_cast(const QScriptValue &value -#if !defined qdoc && defined Q_CC_MSVC && _MSC_VER < 1300 -, T * = 0 -#endif - ) +T qscriptvalue_cast(const QScriptValue &value) { T t; const int id = qMetaTypeId(); @@ -366,13 +362,11 @@ T qscriptvalue_cast(const QScriptValue &value return T(); } -#if !defined Q_CC_MSVC || _MSC_VER >= 1300 template <> inline QVariant qscriptvalue_cast(const QScriptValue &value) { return value.toVariant(); } -#endif template inline T qScriptValueToValue(const QScriptValue &value) @@ -428,11 +422,7 @@ void qScriptValueToSequence(const QScriptValue &value, Container &cont) quint32 len = value.property(QLatin1String("length")).toUInt32(); for (quint32 i = 0; i < len; ++i) { QScriptValue item = value.property(i); -#if defined Q_CC_MSVC && !defined Q_CC_MSVC_NET - cont.push_back(qscriptvalue_cast(item)); -#else cont.push_back(qscriptvalue_cast(item)); -#endif } } diff --git a/src/script/api/qscriptvalue.cpp b/src/script/api/qscriptvalue.cpp index f6390bb..fbd5d96 100644 --- a/src/script/api/qscriptvalue.cpp +++ b/src/script/api/qscriptvalue.cpp @@ -688,10 +688,6 @@ static bool LessThan(QScriptValue lhs, QScriptValue rhs) return false; case Number: -#if defined Q_CC_MSVC && !defined Q_CC_MSVC_NET - if (qIsNaN(lhs.toNumber()) || qIsNaN(rhs.toNumber())) - return false; -#endif return lhs.toNumber() < rhs.toNumber(); case Boolean: @@ -714,13 +710,7 @@ static bool LessThan(QScriptValue lhs, QScriptValue rhs) if (lhs.isString() && rhs.isString()) return lhs.toString() < rhs.toString(); - qsreal n1 = lhs.toNumber(); - qsreal n2 = rhs.toNumber(); -#if defined Q_CC_MSVC && !defined Q_CC_MSVC_NET - if (qIsNaN(n1) || qIsNaN(n2)) - return false; -#endif - return n1 < n2; + return lhs.toNumber() < rhs.toNumber(); } static bool Equals(QScriptValue lhs, QScriptValue rhs) diff --git a/src/sql/drivers/odbc/qsql_odbc.cpp b/src/sql/drivers/odbc/qsql_odbc.cpp index 9a35ac5..cc73f1b 100644 --- a/src/sql/drivers/odbc/qsql_odbc.cpp +++ b/src/sql/drivers/odbc/qsql_odbc.cpp @@ -62,15 +62,6 @@ QT_BEGIN_NAMESPACE // undefine this to prevent initial check of the ODBC driver #define ODBC_CHECK_DRIVER -// newer platform SDKs use SQLLEN instead of SQLINTEGER -#if defined(WIN32) && (_MSC_VER < 1300) && !defined(__MINGW64_VERSION_MAJOR) -# define QSQLLEN SQLINTEGER -# define QSQLULEN SQLUINTEGER -#else -# define QSQLLEN SQLLEN -# define QSQLULEN SQLULEN -#endif - static const int COLNAMESIZE = 256; //Map Qt parameter types to ODBC types static const SQLSMALLINT qParamType[4] = { SQL_PARAM_INPUT, SQL_PARAM_INPUT, SQL_PARAM_OUTPUT, SQL_PARAM_INPUT_OUTPUT }; @@ -360,7 +351,7 @@ static QString qGetStringData(SQLHANDLE hStmt, int column, int colSize, bool uni { QString fieldVal; SQLRETURN r = SQL_ERROR; - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; // NB! colSize must be a multiple of 2 for unicode enabled DBs if (colSize <= 0) { @@ -462,10 +453,10 @@ static QVariant qGetBinaryData(SQLHANDLE hStmt, int column) QByteArray fieldVal; SQLSMALLINT colNameLen; SQLSMALLINT colType; - QSQLULEN colSize; + SQLULEN colSize; SQLSMALLINT colScale; SQLSMALLINT nullable; - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQL_ERROR; QVarLengthArray colName(COLNAMESIZE); @@ -499,7 +490,7 @@ static QVariant qGetBinaryData(SQLHANDLE hStmt, int column) break; if (lengthIndicator == SQL_NULL_DATA) return QVariant(QVariant::ByteArray); - if (lengthIndicator > QSQLLEN(colSize) || lengthIndicator == SQL_NO_TOTAL) { + if (lengthIndicator > SQLLEN(colSize) || lengthIndicator == SQL_NO_TOTAL) { read += colSize; colSize = 65536; } else { @@ -517,7 +508,7 @@ static QVariant qGetBinaryData(SQLHANDLE hStmt, int column) static QVariant qGetIntData(SQLHANDLE hStmt, int column, bool isSigned = true) { SQLINTEGER intbuf = 0; - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column+1, isSigned ? SQL_C_SLONG : SQL_C_ULONG, @@ -537,7 +528,7 @@ static QVariant qGetIntData(SQLHANDLE hStmt, int column, bool isSigned = true) static QVariant qGetDoubleData(SQLHANDLE hStmt, int column) { SQLDOUBLE dblbuf; - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column+1, SQL_C_DOUBLE, @@ -557,7 +548,7 @@ static QVariant qGetDoubleData(SQLHANDLE hStmt, int column) static QVariant qGetBigIntData(SQLHANDLE hStmt, int column, bool isSigned = true) { SQLBIGINT lngbuf = 0; - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; SQLRETURN r = SQLGetData(hStmt, column+1, isSigned ? SQL_C_SBIGINT : SQL_C_UBIGINT, @@ -601,7 +592,7 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) { SQLSMALLINT colNameLen; SQLSMALLINT colType; - QSQLULEN colSize; + SQLULEN colSize; SQLSMALLINT colScale; SQLSMALLINT nullable; SQLRETURN r = SQL_ERROR; @@ -621,7 +612,7 @@ static QSqlField qMakeFieldInfo(const QODBCPrivate* p, int i ) return QSqlField(); } - QSQLLEN unsignedFlag = SQL_FALSE; + SQLLEN unsignedFlag = SQL_FALSE; r = SQLColAttribute (p->hStmt, i + 1, SQL_DESC_UNSIGNED, @@ -1146,7 +1137,7 @@ QVariant QODBCResult::data(int field) return d->fieldCache.at(field); SQLRETURN r(0); - QSQLLEN lengthIndicator = 0; + SQLLEN lengthIndicator = 0; for (int i = d->fieldCacheIdx; i <= field; ++i) { // some servers do not support fetching column n after we already @@ -1256,7 +1247,7 @@ int QODBCResult::size() int QODBCResult::numRowsAffected() { - QSQLLEN affectedRowCount = 0; + SQLLEN affectedRowCount = 0; SQLRETURN r = SQLRowCount(d->hStmt, &affectedRowCount); if (r == SQL_SUCCESS) return affectedRowCount; @@ -1343,8 +1334,8 @@ bool QODBCResult::exec() SQLCloseCursor(d->hStmt); QList tmpStorage; // holds temporary buffers - QVarLengthArray indicators(boundValues().count()); - memset(indicators.data(), 0, indicators.size() * sizeof(QSQLLEN)); + QVarLengthArray indicators(boundValues().count()); + memset(indicators.data(), 0, indicators.size() * sizeof(SQLLEN)); // bind parameters - only positional binding allowed QVector& values = boundValues(); @@ -1354,7 +1345,7 @@ bool QODBCResult::exec() if (bindValueType(i) & QSql::Out) values[i].detach(); const QVariant &val = values.at(i); - QSQLLEN *ind = &indicators[i]; + SQLLEN *ind = &indicators[i]; if (val.isNull()) *ind = SQL_NULL_DATA; switch (val.type()) { diff --git a/src/testlib/qtest_global.h b/src/testlib/qtest_global.h index a78113a..4dd0cb7 100644 --- a/src/testlib/qtest_global.h +++ b/src/testlib/qtest_global.h @@ -62,7 +62,7 @@ QT_MODULE(Test) # endif #endif -#if (defined (Q_CC_MSVC) && _MSC_VER < 1310) || defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3)) || defined (Q_CC_NOKIAX86) +#if defined (Q_CC_SUN) || defined (Q_CC_XLC) || (defined (Q_CC_GNU) && (__GNUC__ - 0 < 3)) || defined (Q_CC_NOKIAX86) # define QTEST_NO_SPECIALIZATIONS #endif diff --git a/tests/auto/collections/tst_collections.cpp b/tests/auto/collections/tst_collections.cpp index d092c34..4ecd392 100644 --- a/tests/auto/collections/tst_collections.cpp +++ b/tests/auto/collections/tst_collections.cpp @@ -3447,27 +3447,16 @@ void tst_Collections::containerTypedefs() testSetContainerTypedefs(QSet()); } -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) -class Key1 -{}; -class T1 -{}; -class T2 -{}; -#else class Key1; class T1; class T2; -#endif void tst_Collections::forwardDeclared() { { typedef QHash C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) } { typedef QMultiHash C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) } -#if !defined(Q_CC_MSVC_NET) || _MSC_VER >= 1310 { typedef QMap C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) } { typedef QMultiMap C; C *x = 0; C::iterator i; C::const_iterator j; Q_UNUSED(x) } -#endif #if !defined(Q_CC_RVCT) // RVCT can't handle forward declared template parameters if those are used to declare // class members inside templated class. diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp index f722f89..2413888 100644 --- a/tests/auto/qwidget/tst_qwidget.cpp +++ b/tests/auto/qwidget/tst_qwidget.cpp @@ -456,23 +456,15 @@ void tst_QWidget::getSetCheck() QCOMPARE(obj1.minimumWidth(), 0); // A widgets width can never be less than 0 obj1.setMinimumWidth(INT_MAX); #ifndef Q_WS_QWS //QWS doesn't allow toplevels to be bigger than the screen -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)obj1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#else QCOMPARE(obj1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium #endif -#endif child1.setMinimumWidth(0); QCOMPARE(child1.minimumWidth(), 0); child1.setMinimumWidth(INT_MIN); QCOMPARE(child1.minimumWidth(), 0); // A widgets width can never be less than 0 child1.setMinimumWidth(INT_MAX); -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)child1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#else QCOMPARE(child1.minimumWidth(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#endif // int QWidget::minimumHeight() // void QWidget::setMinimumHeight(int) @@ -482,38 +474,24 @@ void tst_QWidget::getSetCheck() QCOMPARE(obj1.minimumHeight(), 0); // A widgets height can never be less than 0 obj1.setMinimumHeight(INT_MAX); #ifndef Q_WS_QWS //QWS doesn't allow toplevels to be bigger than the screen -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)obj1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#else QCOMPARE(obj1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium #endif -#endif child1.setMinimumHeight(0); QCOMPARE(child1.minimumHeight(), 0); child1.setMinimumHeight(INT_MIN); QCOMPARE(child1.minimumHeight(), 0); // A widgets height can never be less than 0 child1.setMinimumHeight(INT_MAX); -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)child1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#else QCOMPARE(child1.minimumHeight(), QWIDGETSIZE_MAX); // The largest minimum size should only be as big as the maximium -#endif - - -// int QWidget::maximumWidth() + // int QWidget::maximumWidth() // void QWidget::setMaximumWidth(int) obj1.setMaximumWidth(0); QCOMPARE(obj1.maximumWidth(), 0); obj1.setMaximumWidth(INT_MIN); QCOMPARE(obj1.maximumWidth(), 0); // A widgets width can never be less than 0 obj1.setMaximumWidth(INT_MAX); -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)obj1.maximumWidth(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX -#else QCOMPARE(obj1.maximumWidth(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX -#endif // int QWidget::maximumHeight() // void QWidget::setMaximumHeight(int) @@ -522,11 +500,7 @@ void tst_QWidget::getSetCheck() obj1.setMaximumHeight(INT_MIN); QCOMPARE(obj1.maximumHeight(), 0); // A widgets height can never be less than 0 obj1.setMaximumHeight(INT_MAX); -#if defined(Q_CC_MSVC) && !defined(Q_CC_MSVC_NET) - QCOMPARE((long)obj1.maximumHeight(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX -#else QCOMPARE(obj1.maximumHeight(), QWIDGETSIZE_MAX); // QWIDGETSIZE_MAX is the abs max, not INT_MAX -#endif // back to normal obj1.setMinimumWidth(0); diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index 69e4727..3f0fe87 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -2098,12 +2098,7 @@ bool Configure::checkAvailability(const QString &part) else if (part == "INCREDIBUILD_XGE") available = findFile("BuildConsole.exe") && findFile("xgConsole.exe"); else if (part == "XMLPATTERNS") - { - /* MSVC 6.0 and MSVC 2002/7.0 has too poor C++ support for QtXmlPatterns. */ - return dictionary.value("QMAKESPEC") != "win32-msvc" - && dictionary.value("QMAKESPEC") != "win32-msvc.net" // Leave for now, since we can't be sure if they are using 2002 or 2003 with this spec - && dictionary.value("QMAKESPEC") != "win32-msvc2002" - && dictionary.value("EXCEPTIONS") == "yes"; + available = dictionary.value("EXCEPTIONS") == "yes"; } else if (part == "PHONON") { if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) { available = true; diff --git a/tools/configure/environment.cpp b/tools/configure/environment.cpp index 943a8a2..5d9851f 100644 --- a/tools/configure/environment.cpp +++ b/tools/configure/environment.cpp @@ -75,8 +75,6 @@ struct CompilerInfo{ {CC_BORLAND, "Borland C++", 0, "bcc32.exe"}, {CC_MINGW, "MinGW (Minimalist GNU for Windows)", 0, "g++.exe"}, {CC_INTEL, "Intel(R) C++ Compiler for 32-bit applications", 0, "icl.exe"}, // xilink.exe, xilink5.exe, xilink6.exe, xilib.exe - {CC_MSVC6, "Microsoft (R) 32-bit C/C++ Optimizing Compiler (6.x)", "Software\\Microsoft\\VisualStudio\\6.0\\Setup\\Microsoft Visual C++\\ProductDir", "cl.exe"}, // link.exe, lib.exe - {CC_NET2002, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2002 (7.0)", "Software\\Microsoft\\VisualStudio\\7.0\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe {CC_NET2003, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2003 (7.1)", "Software\\Microsoft\\VisualStudio\\7.1\\Setup\\VC\\ProductDir", "cl.exe"}, // link.exe, lib.exe {CC_NET2005, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2005 (8.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\8.0", "cl.exe"}, // link.exe, lib.exe {CC_NET2008, "Microsoft (R) 32-bit C/C++ Optimizing Compiler.NET 2008 (9.0)", "Software\\Microsoft\\VisualStudio\\SxS\\VC7\\9.0", "cl.exe"}, // link.exe, lib.exe @@ -118,14 +116,6 @@ QString Environment::detectQMakeSpec() case CC_NET2003: spec = "win32-msvc2003"; break; - case CC_NET2002: - spec = "win32-msvc2002"; - break; - case CC_MSVC4: - case CC_MSVC5: - case CC_MSVC6: - spec = "win32-msvc"; - break; case CC_INTEL: spec = "win32-icc"; break; @@ -152,7 +142,7 @@ QString Environment::detectQMakeSpec() Compiler Environment::detectCompiler() { #ifndef Q_OS_WIN32 - return MSVC6; // Always generate MSVC 6.0 versions on other platforms + return CC_UNKNOWN; // Always generate CC_UNKNOWN on other platforms #else if(detectedCompiler != CC_UNKNOWN) return detectedCompiler; diff --git a/tools/configure/environment.h b/tools/configure/environment.h index 16af8df..9efaea1 100644 --- a/tools/configure/environment.h +++ b/tools/configure/environment.h @@ -50,10 +50,6 @@ enum Compiler { CC_BORLAND = 0x01, CC_MINGW = 0x02, CC_INTEL = 0x03, - CC_MSVC4 = 0x40, - CC_MSVC5 = 0x50, - CC_MSVC6 = 0x60, - CC_NET2002 = 0x70, CC_NET2003 = 0x71, CC_NET2005 = 0x80, CC_NET2008 = 0x90, -- cgit v0.12