diff options
author | Kamil Trzcinski <ayufan@ayufan.eu> | 2013-08-29 18:32:34 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-20 13:54:02 +0200 |
commit | 95e0da216f0a94d5b1bfa7aec77d20fe5ba01f55 (patch) | |
tree | dd458bf0e845dcb2d7655ec47468d1274c86a0b8 | |
parent | d959c37eaa66298579ca55440aff5fdb8b3126b2 (diff) |
Fixed compilation of QSystemsemaphore for WinRT
As CreateSemaphore and WaitForSingleObject are
not supported on WinRT their supported alternatives
are used.
Change-Id: I1aa20076e286ed8ae28ba332bbed41ff8ce0feff
Reviewed-by: Andrew Knight <andrew.knight@digia.com>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r-- | src/corelib/kernel/qsystemsemaphore_win.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/corelib/kernel/qsystemsemaphore_win.cpp b/src/corelib/kernel/qsystemsemaphore_win.cpp index 835a9fde5b..55df20b24e 100644 --- a/src/corelib/kernel/qsystemsemaphore_win.cpp +++ b/src/corelib/kernel/qsystemsemaphore_win.cpp @@ -87,7 +87,11 @@ HANDLE QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode) // Create it if it doesn't already exists. if (semaphore == 0) { +#if defined(Q_OS_WINRT) + semaphore = CreateSemaphoreEx(0, initialValue, MAXLONG, (wchar_t*)fileName.utf16(), 0, SEMAPHORE_ALL_ACCESS); +#else semaphore = CreateSemaphore(0, initialValue, MAXLONG, (wchar_t*)fileName.utf16()); +#endif if (semaphore == NULL) setErrorString(QLatin1String("QSystemSemaphore::handle")); } @@ -119,7 +123,11 @@ bool QSystemSemaphorePrivate::modifySemaphore(int count) return false; } } else { +#if defined(Q_OS_WINRT) + if (WAIT_OBJECT_0 != WaitForSingleObjectEx(semaphore, INFINITE, FALSE)) { +#else if (WAIT_OBJECT_0 != WaitForSingleObject(semaphore, INFINITE)) { +#endif setErrorString(QLatin1String("QSystemSemaphore::modifySemaphore")); #if defined QSYSTEMSEMAPHORE_DEBUG qDebug() << QLatin1String("QSystemSemaphore::modifySemaphore WaitForSingleObject failed"); |