diff options
author | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-09 15:10:57 (GMT) |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@nokia.com> | 2009-11-09 15:10:57 (GMT) |
commit | 3d2cb04d31cfa862c4d8aa383ae38b8b09e6546a (patch) | |
tree | fbc413a2022f210208bd07a535e4b446717e8e1e /tests | |
parent | c9aa65bf79fdd09ad5d6405ba1d127888e26fd26 (diff) | |
download | Qt-3d2cb04d31cfa862c4d8aa383ae38b8b09e6546a.zip Qt-3d2cb04d31cfa862c4d8aa383ae38b8b09e6546a.tar.gz Qt-3d2cb04d31cfa862c4d8aa383ae38b8b09e6546a.tar.bz2 |
tst_largefile.cpp Windows CE compile fix
Reviewed-by: thartman
Diffstat (limited to 'tests')
-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 |