shithub: openh264

Download patch

ref: 05bf57a2af593ff8d946b8619262ece147ab5fa9
parent: cc2ffee5d2178e90407a89cfa7dc644cdb35ac27
author: Martin Storsjö <martin@martin.st>
date: Fri Dec 27 19:09:02 EST 2013

Use InitializeCriticalSectionEx for Windows Store or Windows Phone apps

The old InitializeCriticalSection function isn't available in
these API partitions, and the new InitializeCriticalSectionEx
function is only available since Vista, so we want to keep using
the old function for normal desktop code.

--- a/codec/processing/src/common/thread.cpp
+++ b/codec/processing/src/common/thread.cpp
@@ -43,6 +43,12 @@
 
 #if defined(_WIN32)
 
+#ifdef WINAPI_FAMILY
+#if !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+#define InitializeCriticalSection(x) InitializeCriticalSectionEx(x, 0, 0)
+#endif
+#endif
+
 WELS_THREAD_ERROR_CODE    WelsMutexInit (WELS_MUTEX*    mutex) {
   InitializeCriticalSection (mutex);