From 45b0f1be686cfba8dcecb9be5c875cae59c69276 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 5 Jun 2020 09:24:37 +0200 Subject: Remove winrt MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø --- .../corelib/io/qdir/10000/bench_qdir_10000.cpp | 5 ----- tests/benchmarks/corelib/io/qdiriterator/main.cpp | 5 ----- .../io/qdiriterator/qfilesystemiterator.cpp | 5 ----- tests/benchmarks/corelib/io/qfile/main.cpp | 26 ---------------------- tests/benchmarks/corelib/io/qfileinfo/main.cpp | 4 ++-- .../testProcessLoopback/.prev_CMakeLists.txt | 13 +++++++++++ .../io/qprocess/testProcessLoopback/CMakeLists.txt | 11 ++------- .../testProcessLoopback/testProcessLoopback.pro | 1 - .../corelib/thread/qmutex/tst_qmutex.cpp | 8 +------ 9 files changed, 18 insertions(+), 60 deletions(-) create mode 100644 tests/benchmarks/corelib/io/qprocess/testProcessLoopback/.prev_CMakeLists.txt (limited to 'tests/benchmarks/corelib') diff --git a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp index 0b831f6625..d1aba9fa5f 100644 --- a/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp +++ b/tests/benchmarks/corelib/io/qdir/10000/bench_qdir_10000.cpp @@ -163,12 +163,7 @@ private slots: wcscat(appendedPath, L"\\*"); WIN32_FIND_DATA fd; -#ifndef Q_OS_WINRT HANDLE hSearch = FindFirstFileW(appendedPath, &fd); -#else - HANDLE hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd, - FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); -#endif QVERIFY(hSearch != INVALID_HANDLE_VALUE); QBENCHMARK { diff --git a/tests/benchmarks/corelib/io/qdiriterator/main.cpp b/tests/benchmarks/corelib/io/qdiriterator/main.cpp index 5b10a4a689..367913338f 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/main.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/main.cpp @@ -95,12 +95,7 @@ static int posix_helper(const wchar_t *dirpath, size_t length) Q_ASSERT(MAX_PATH > length + 3); wcsncpy(appendedPath, dirpath, length); wcscpy(appendedPath + length, L"\\*"); -#ifndef Q_OS_WINRT hSearch = FindFirstFile(appendedPath, &fd); -#else - hSearch = FindFirstFileEx(appendedPath, FindExInfoStandard, &fd, - FindExSearchNameMatch, NULL, FIND_FIRST_EX_LARGE_FETCH); -#endif if (hSearch == INVALID_HANDLE_VALUE) { qWarning("FindFirstFile failed"); diff --git a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp index 6ee8b4e93b..21018920f7 100644 --- a/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp +++ b/tests/benchmarks/corelib/io/qdiriterator/qfilesystemiterator.cpp @@ -221,12 +221,7 @@ void QFileSystemIteratorPrivate::pushSubDirectory(const QByteArray &path) const int end = QString::fromLatin1(path + "\\*").toWCharArray(szSearchPath); Q_ASSERT(end < MAX_PATH); szSearchPath[end] = L'\0'; -#ifndef Q_OS_WINRT HANDLE dir = FindFirstFile(szSearchPath, &m_fileSearchResult); -#else - HANDLE dir = FindFirstFileEx(szSearchPath, FindExInfoStandard, &m_fileSearchResult, - FindExSearchLimitToDirectories, NULL, FIND_FIRST_EX_LARGE_FETCH); -#endif m_bFirstSearchResult = true; #else DIR *dir = ::opendir(path.constData()); diff --git a/tests/benchmarks/corelib/io/qfile/main.cpp b/tests/benchmarks/corelib/io/qfile/main.cpp index 1966b30773..73b3ba8c48 100644 --- a/tests/benchmarks/corelib/io/qfile/main.cpp +++ b/tests/benchmarks/corelib/io/qfile/main.cpp @@ -297,11 +297,7 @@ void tst_qfile::readBigFile() // ensure we don't account string conversion wchar_t* cfilename = (wchar_t*)filename.utf16(); -#ifndef Q_OS_WINRT hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); -#else - hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0); -#endif Q_ASSERT(hndl); wchar_t* nativeBuffer = new wchar_t[BUFSIZE]; DWORD numberOfBytesRead; @@ -310,12 +306,7 @@ void tst_qfile::readBigFile() do { ReadFile(hndl, nativeBuffer, blockSize, &numberOfBytesRead, NULL); } while(numberOfBytesRead != 0); -#ifndef Q_OS_WINRT SetFilePointer(hndl, 0, NULL, FILE_BEGIN); -#else - LARGE_INTEGER offset = { 0 }; - SetFilePointerEx(hndl, offset, NULL, FILE_BEGIN); -#endif } delete[] nativeBuffer; CloseHandle(hndl); @@ -396,20 +387,11 @@ void tst_qfile::seek() // ensure we don't account string conversion wchar_t* cfilename = (wchar_t*)filename.utf16(); -#ifndef Q_OS_WINRT hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); -#else - hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0); -#endif Q_ASSERT(hndl); QBENCHMARK { i=(i+1)%sp_size; -#ifndef Q_OS_WINRT SetFilePointer(hndl, seekpos[i], NULL, 0); -#else - LARGE_INTEGER offset = { seekpos[i] }; - SetFilePointerEx(hndl, offset, NULL, FILE_BEGIN); -#endif } CloseHandle(hndl); #else @@ -494,11 +476,7 @@ void tst_qfile::open() wchar_t* cfilename = (wchar_t*)filename.utf16(); QBENCHMARK { -#ifndef Q_OS_WINRT hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); -#else - hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0); -#endif Q_ASSERT(hndl); CloseHandle(hndl); } @@ -702,11 +680,7 @@ void tst_qfile::readSmallFiles() // ensure we don't account string conversion wchar_t* cfilename = (wchar_t*)filename.utf16(); -#ifndef Q_OS_WINRT hndl = CreateFile(cfilename, GENERIC_READ, 0, 0, OPEN_EXISTING, 0, 0); -#else - hndl = CreateFile2(cfilename, GENERIC_READ, 0, OPEN_EXISTING, 0); -#endif Q_ASSERT(hndl); wchar_t* nativeBuffer = new wchar_t[BUFSIZE]; DWORD numberOfBytesRead; diff --git a/tests/benchmarks/corelib/io/qfileinfo/main.cpp b/tests/benchmarks/corelib/io/qfileinfo/main.cpp index 6cc96777a1..f4c4f815da 100644 --- a/tests/benchmarks/corelib/io/qfileinfo/main.cpp +++ b/tests/benchmarks/corelib/io/qfileinfo/main.cpp @@ -41,7 +41,7 @@ class qfileinfo : public QObject private slots: void existsTemporary(); void existsStatic(); -#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) void symLinkTargetPerformanceLNK(); void symLinkTargetPerformanceMounpoint(); #endif @@ -71,7 +71,7 @@ void qfileinfo::existsStatic() QBENCHMARK { QFileInfo::exists(appPath); } } -#if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) +#if defined(Q_OS_WIN) void qfileinfo::symLinkTargetPerformanceLNK() { QVERIFY(QFile::link("file","link.lnk")); diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/.prev_CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/.prev_CMakeLists.txt new file mode 100644 index 0000000000..59806127fe --- /dev/null +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/.prev_CMakeLists.txt @@ -0,0 +1,13 @@ +# Generated from testProcessLoopback.pro. + +##################################################################### +## testProcessLoopback Binary: +##################################################################### + +add_qt_executable(testProcessLoopback + OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" + SOURCES + main.cpp + PUBLIC_LIBRARIES + Qt::Gui +) diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt index 44b18a4826..b5a7fe83f5 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/CMakeLists.txt @@ -4,18 +4,11 @@ ## testProcessLoopback Binary: ##################################################################### -add_qt_benchmark(testProcessLoopback +# add_qt_executable(testProcessLoopback # special case +add_qt_benchmark(testProcessLoopback # special case OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/" SOURCES main.cpp PUBLIC_LIBRARIES Qt::Gui ) - -## Scopes: -##################################################################### - -extend_target(testProcessLoopback CONDITION WINRT - LINK_OPTIONS - "/ENTRY:mainCRTStartup" -) diff --git a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro index 1f56ad6ee6..a5fe146e80 100644 --- a/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro +++ b/tests/benchmarks/corelib/io/qprocess/testProcessLoopback/testProcessLoopback.pro @@ -1,7 +1,6 @@ CONFIG += benchmark CONFIG -= qt CONFIG += cmdline -winrt: QMAKE_LFLAGS += /ENTRY:mainCRTStartup SOURCES = main.cpp DESTDIR = ./ diff --git a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp index 751fd9ce7c..b94d6ee619 100644 --- a/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp +++ b/tests/benchmarks/corelib/thread/qmutex/tst_qmutex.cpp @@ -75,18 +75,12 @@ void NativeMutexUnlock(NativeMutexType *mutex) } #endif #elif defined(Q_OS_WIN) -# ifndef Q_OS_WINRT -# define _WIN32_WINNT 0x0400 -# endif +# define _WIN32_WINNT 0x0400 # include typedef CRITICAL_SECTION NativeMutexType; void NativeMutexInitialize(NativeMutexType *mutex) { -#ifndef Q_OS_WINRT InitializeCriticalSection(mutex); -#else - InitializeCriticalSectionEx(mutex, 0, 0); -#endif } void NativeMutexDestroy(NativeMutexType *mutex) { -- cgit v1.2.3