summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoão Abecasis <joao@abecasis.name>2009-10-29 14:32:03 (GMT)
committerJoão Abecasis <joao@abecasis.name>2009-10-29 17:38:49 (GMT)
commit764d195bfa252775702bffc93989a35d0c19f035 (patch)
treee92f4b77e687abc23bcdd7fa4c2d656df0275957
parent79da7bb4739f9f63178ce5146702dce6b8feafb9 (diff)
downloadQt-764d195bfa252775702bffc93989a35d0c19f035.zip
Qt-764d195bfa252775702bffc93989a35d0c19f035.tar.gz
Qt-764d195bfa252775702bffc93989a35d0c19f035.tar.bz2
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.
-rw-r--r--mkspecs/win32-msvc.net/qplatformdefs.h6
-rw-r--r--tests/auto/qfile/largefile/tst_largefile.cpp5
2 files changed, 9 insertions, 2 deletions
diff --git a/mkspecs/win32-msvc.net/qplatformdefs.h b/mkspecs/win32-msvc.net/qplatformdefs.h
index e3e287e..da092fa 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 d2bbffe..53dbc12 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_ );