Use the WINAPI_PARTITION macro to filter desktop/app flavors.
We use a negated desktop check because the default (for mingw-w64 at
least) is to allow all API by combining desktop + app partitions.
This causes build failures if we were to filter using
WINAPI_PARTITION(WINAPI_FAMILY_APP) because it would always be true, but
those API also require Windows 8 or later, while we only require Vista
Fixes warnings like
../src/hb-blob.cc:572:47: warning: 'WINAPI_FAMILY_PC_APP' is not defined, evaluates to 0 [-Wundef]
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
^
../src/hb-blob.cc:572:86: warning: 'WINAPI_FAMILY_PHONE_APP' is not defined, evaluates to 0 [-Wundef]
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY==WINAPI_FAMILY_PC_APP || WINAPI_FAMILY==WINAPI_FAMILY_PHONE_APP)
MSVC warning:
c:\projects\harfbuzz\src\hb-ot-layout-gsubgpos.hh(2732): error C2121: '#': invalid character: possibly the result of a macro expansion [C:\projects\harfbuzz\build\harfbuzz.vcxproj]
Clang warning for it:
./hb-ot-layout-gsubgpos.hh:2729:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
It was cumbersome to get it to work reliably, for dubious performance
gain, mostly in the subsetter maybe...
Life is easier without. It was disabled forever anyway.
Added in 01dff1e and 19256bef, this was targeted at older
msvc versions that don't support C99 but now as we require
C++11 we don't target places those envs thus removing this.
mingw.org's MinGW.
src/hb-algs.hh: Don't compile _BitScanForward and _BitScanReverse
for GCC >= 4. mingw.org's MinGW doesn't have these functions.
src/hb-atomic.hh: MemoryBarrier does exist in mingw.org's MinGW,
but it is not a macro, it is an inline function. __MINGW32_VERSION
is a macro that exists only in mingw.org's MinGW, so conditioning
on it should not affect MinGW64, where MemoryBarrier is a macro.
src/hb-uniscribe.cc: Define E_NOT_SUFFICIENT_BUFFER if it is not
defined (mingw.org's MinGW doesn't).
src/hb.hh: Don't include intrin.h for mingw.org's MinGW, since that
header is not available; instead, include windows.h. Conditioned
on __MINGW32_VERSION to avoid affecting MinGW64.