Remove QT_NO_STL_WCHAR hack

We don't support gcc 2.95 any more.

Change-Id: I842f1f8ac64b9006516c104add0991830ac9a46a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Harald Fernengel 2011-12-21 10:40:36 +01:00 committed by Qt by Nokia
parent c02ca6752a
commit d868c9945a
3 changed files with 4 additions and 26 deletions

View File

@ -450,7 +450,6 @@ namespace QT_NAMESPACE {}
/* GCC 2.95 knows "using" but does not support it correctly */
# if __GNUC__ == 2 && __GNUC_MINOR__ <= 95
# define Q_NO_USING_KEYWORD
# define QT_NO_STL_WCHAR
# endif
# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
# define Q_ALIGNOF(type) __alignof__(type)

View File

@ -49,12 +49,6 @@
#ifndef QT_NO_STL
# include <string>
# ifndef QT_NO_STL_WCHAR
// workaround for some headers not typedef'ing std::wstring
typedef std::basic_string<wchar_t> QStdWString;
# endif // QT_NO_STL_WCHAR
#endif // QT_NO_STL
#include <stdarg.h>
@ -576,15 +570,8 @@ public:
#ifndef QT_NO_STL
static inline QString fromStdString(const std::string &s);
inline std::string toStdString() const;
# ifdef qdoc
static inline QString fromStdWString(const std::wstring &s);
inline std::wstring toStdWString() const;
# else
# ifndef QT_NO_STL_WCHAR
static inline QString fromStdWString(const QStdWString &s);
inline QStdWString toStdWString() const;
# endif // QT_NO_STL_WCHAR
# endif // qdoc
#endif
// compatibility
@ -1066,10 +1053,9 @@ inline std::string QString::toStdString() const
inline QString QString::fromStdString(const std::string &s)
{ return fromAscii(s.data(), int(s.size())); }
# ifndef QT_NO_STL_WCHAR
inline QStdWString QString::toStdWString() const
inline std::wstring QString::toStdWString() const
{
QStdWString str;
std::wstring str;
str.resize(length());
#if defined(_MSC_VER) && _MSC_VER >= 1400
@ -1081,9 +1067,8 @@ inline QStdWString QString::toStdWString() const
str.resize(toWCharArray(&(*str.begin())));
return str;
}
inline QString QString::fromStdWString(const QStdWString &s)
inline QString QString::fromStdWString(const std::wstring &s)
{ return fromWCharArray(s.data(), int(s.size())); }
# endif
#endif
#if !defined(QT_NO_DATASTREAM) || (defined(QT_BOOTSTRAPPED) && !defined(QT_BUILD_QMAKE))

View File

@ -811,9 +811,6 @@ void tst_QString::constructorQByteArray()
void tst_QString::STL()
{
#ifdef Q_CC_HPACC
QSKIP("This test crashes on HP-UX with aCC");
#endif
#ifndef QT_NO_STL
#ifndef QT_NO_CAST_TO_ASCII
QString qt( "QString" );
@ -851,16 +848,13 @@ void tst_QString::STL()
QVERIFY( !stdstr3.length() );
#endif
// Skip the rest of the test if glibc is not compiled with wide character support
#if !(defined Q_CC_GNU && !defined _GLIBCPP_USE_WCHAR_T) && !defined QT_NO_STL_WCHAR
const wchar_t arr[] = {'h', 'e', 'l', 'l', 'o', 0};
QStdWString stlStr = arr;
std::wstring stlStr = arr;
QString s = QString::fromStdWString(stlStr);
QCOMPARE(s, QString::fromLatin1("hello"));
QCOMPARE(stlStr, s.toStdWString());
#endif
#else
QSKIP( "Not tested without STL support");
#endif