From 95e0da216f0a94d5b1bfa7aec77d20fe5ba01f55 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Thu, 29 Aug 2013 18:32:34 +0200 Subject: 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 Reviewed-by: Maurice Kalinowski Reviewed-by: Lars Knoll --- src/corelib/kernel/qsystemsemaphore_win.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') 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"); -- cgit v1.2.3