From 764d195bfa252775702bffc93989a35d0c19f035 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jo=C3=A3o=20Abecasis?= Date: Thu, 29 Oct 2009 15:32:03 +0100 Subject: [PATCH] Turns out 64-bit fseek/ftell are not available on VS 2003/2002... Not when linking dynamically to the CRT (/MT). So we can't rely on them. The declarations for those are also not on the standard headers. Reverts "(MSVC 2002/2003) Use 64-bit versions of ftell and fseek", fixes return type of QT_FTELL and skips known failures on large-file test case. --- mkspecs/win32-msvc.net/qplatformdefs.h | 6 ++++-- tests/auto/qfile/largefile/tst_largefile.cpp | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/mkspecs/win32-msvc.net/qplatformdefs.h b/mkspecs/win32-msvc.net/qplatformdefs.h index e3e287e59c..da092facbc 100644 --- a/mkspecs/win32-msvc.net/qplatformdefs.h +++ b/mkspecs/win32-msvc.net/qplatformdefs.h @@ -115,8 +115,10 @@ #define QT_FOPEN ::fopen #ifdef QT_LARGEFILE_SUPPORT -#define QT_FSEEK ::_fseeki64 -#define QT_FTELL ::_ftelli64 +// 64-bit versions of fseek/ftell not always available. E.g., when linking +// dynamically to CRT (/MT) +#define QT_FSEEK ::fseek +#define QT_FTELL (QT_OFF_T)::ftell #else #define QT_FSEEK ::fseek #define QT_FTELL ::ftell diff --git a/tests/auto/qfile/largefile/tst_largefile.cpp b/tests/auto/qfile/largefile/tst_largefile.cpp index d2bbffe082..53dbc127a8 100644 --- a/tests/auto/qfile/largefile/tst_largefile.cpp +++ b/tests/auto/qfile/largefile/tst_largefile.cpp @@ -402,6 +402,11 @@ void tst_LargeFile::streamPositioning() { QFETCH( qint64, position ); +#if defined(QT_LARGEFILE_SUPPORT) && defined(Q_CC_MSVC) && _MSC_VER < 1400 + if (position >= (qint64)1 << 31) + QSKIP("MSVC 2003 doesn't have 64 bit versions of fseek/ftell.", SkipSingle); +#endif + stream_ = QT_FOPEN("qt_largefile.tmp", "rb"); QVERIFY( 0 != stream_ ); -- 2.11.4.GIT