Merge pull request #106 from mstorsjo/windows-api-subset
Allow building for the WinRT/Windows Phone API subsets
This commit is contained in:
commit
3cdd792aba
@ -47,8 +47,15 @@
|
||||
#include "codec_def.h"
|
||||
|
||||
#if defined(_MSC_VER) && (_MSC_VER>=1500) // vs2008 and upper
|
||||
#ifdef WINAPI_FAMILY
|
||||
#include <winapifamily.h>
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
#define ENABLE_DISPLAY_MODULE // enable/disable the render feature
|
||||
#endif
|
||||
#else /* defined(WINAPI_FAMILY) */
|
||||
#define ENABLE_DISPLAY_MODULE // enable/disable the render feature
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_DISPLAY_MODULE
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -83,6 +83,17 @@
|
||||
#include "WelsThreadLib.h"
|
||||
#endif//MT_ENABLED
|
||||
|
||||
#ifdef WIN32
|
||||
#ifdef WINAPI_FAMILY
|
||||
#include <winapifamily.h>
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
#define HAVE_PROCESS_AFFINITY
|
||||
#endif
|
||||
#else /* defined(WINAPI_FAMILY) */
|
||||
#define HAVE_PROCESS_AFFINITY
|
||||
#endif
|
||||
#endif /* WIN32 */
|
||||
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
using namespace WelsSVCEnc;
|
||||
@ -1207,9 +1218,9 @@ INSIDE_MEM_FREE: {
|
||||
|
||||
// Merge from Heifei's Wonder. Lock process to a single core
|
||||
void LockToSingleCore() {
|
||||
#if defined(WIN32) && !defined(WIN64)
|
||||
#ifdef HAVE_PROCESS_AFFINITY
|
||||
//for 2005 compiler, change "DWORD" to "DWORD_PTR"
|
||||
DWORD ProcessAffMask = 0, SystemAffMask = 0;
|
||||
ULONG_PTR ProcessAffMask = 0, SystemAffMask = 0;
|
||||
HANDLE hProcess = GetCurrentProcess();
|
||||
|
||||
GetProcessAffinityMask (hProcess, &ProcessAffMask, &SystemAffMask);
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user