From c26d5cf6ef50ea102cfb18eb2109f60bcdfdafb6 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Mon, 18 Aug 2014 14:18:48 +0200 Subject: Harfbuzz-NG: Compile on WinRT There is no environment (like WinCE) and the basic version of InitializeCriticalSection is unsupported. Change-Id: I7c5038115f0dbfdc616bce89a9be166b5f2a1dcc Reviewed-by: Andrew Knight Reviewed-by: Konstantin Ritt --- src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh | 6 ++++++ src/3rdparty/harfbuzz-ng/src/hb-private.hh | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh index e2ee78b290..40f2e3d152 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-mutex-private.hh @@ -52,7 +52,13 @@ typedef CRITICAL_SECTION hb_mutex_impl_t; #else #define HB_MUTEX_IMPL_INIT { NULL, 0, 0, NULL, NULL, 0 } #endif + +#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) +#define hb_mutex_impl_init(M) InitializeCriticalSectionEx (M, 0, 0) +#else #define hb_mutex_impl_init(M) InitializeCriticalSection (M) +#endif + #define hb_mutex_impl_lock(M) EnterCriticalSection (M) #define hb_mutex_impl_unlock(M) LeaveCriticalSection (M) #define hb_mutex_impl_finish(M) DeleteCriticalSection (M) diff --git a/src/3rdparty/harfbuzz-ng/src/hb-private.hh b/src/3rdparty/harfbuzz-ng/src/hb-private.hh index 58d766c85c..3f70d74c26 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-private.hh +++ b/src/3rdparty/harfbuzz-ng/src/hb-private.hh @@ -117,15 +117,16 @@ #endif // Take from https://github.com/behdad/harfbuzz/commit/26a963b9cb4af3119177f277a2d48a5d537458fb -#ifdef _WIN32_WCE +#if defined(_WIN32_WCE) /* Some things not defined on Windows CE. */ #define MemoryBarrier() #define getenv(Name) NULL #define setlocale(Category, Locale) "C" static int errno = 0; /* Use something better? */ +#elif defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP) +#define getenv(Name) NULL #endif - /* Basics */ -- cgit v1.2.3