diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-09 15:10:57 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-11-11 17:21:23 (GMT) |
commit | 0552728d941622e6af0fad20374c02780ce4a964 (patch) | |
tree | a4a3ebb14b70de1546a69838e7bcd186853acef1 | |
parent | cb480bcf1e5cfc9f3fe5e5eaee415e1d8493f8b0 (diff) | |
download | Qt-0552728d941622e6af0fad20374c02780ce4a964.zip Qt-0552728d941622e6af0fad20374c02780ce4a964.tar.gz Qt-0552728d941622e6af0fad20374c02780ce4a964.tar.bz2 |
tst_largefile.cpp Windows CE compile fix
Reviewed-by: thartman
-rw-r--r-- | tests/auto/qfile/largefile/largefile.pro | 2 | ||||
-rw-r--r-- | tests/auto/qfile/largefile/tst_largefile.cpp | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/tests/auto/qfile/largefile/largefile.pro b/tests/auto/qfile/largefile/largefile.pro index 0f96865..d67cb46 100644 --- a/tests/auto/qfile/largefile/largefile.pro +++ b/tests/auto/qfile/largefile/largefile.pro @@ -2,3 +2,5 @@ load(qttest_p4) QT = core SOURCES += tst_largefile.cpp + +wince*: SOURCES += $$QT_SOURCE_TREE/src/corelib/kernel/qfunctions_wince.cpp diff --git a/tests/auto/qfile/largefile/tst_largefile.cpp b/tests/auto/qfile/largefile/tst_largefile.cpp index 9105063..980f4ba 100644 --- a/tests/auto/qfile/largefile/tst_largefile.cpp +++ b/tests/auto/qfile/largefile/tst_largefile.cpp @@ -54,7 +54,10 @@ #ifdef Q_OS_WIN #include <windows.h> + +#ifndef Q_OS_WINCE #include <io.h> +#endif #ifndef FSCTL_SET_SPARSE // MinGW doesn't define this. @@ -295,7 +298,7 @@ void tst_LargeFile::sparseFileData() void tst_LargeFile::createSparseFile() { -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) // On Windows platforms, we must explicitly set the file to be sparse, // so disk space is not allocated for the full file when writing to it. HANDLE handle = ::CreateFileA("qt_largefile.tmp", @@ -313,7 +316,7 @@ void tst_LargeFile::createSparseFile() int fd = ::_open_osfhandle((intptr_t)handle, 0); QVERIFY( -1 != fd ); QVERIFY( largeFile.open(fd, QIODevice::WriteOnly | QIODevice::Unbuffered) ); -#else // !Q_OS_WIN +#else // !Q_OS_WIN32 largeFile.setFileName("qt_largefile.tmp"); QVERIFY( largeFile.open(QIODevice::WriteOnly | QIODevice::Unbuffered) ); #endif @@ -321,13 +324,13 @@ void tst_LargeFile::createSparseFile() void tst_LargeFile::closeSparseFile() { -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) int fd = largeFile.handle(); #endif largeFile.close(); -#if defined(Q_OS_WIN) +#if defined(Q_OS_WIN32) if (-1 != fd) ::_close(fd); #endif |