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.
This commit is contained in:
Martin Storsjö 2013-12-28 00:09:02 +02:00
parent cc2ffee5d2
commit 05bf57a2af

View File

@ -43,6 +43,12 @@ WELSVP_NAMESPACE_BEGIN
#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);