I stumbled over this when trying to upgrade the version of HarfBuzz used by
LibreOffice to 3.2.1 (see <https://gerrit.libreoffice.org/plugins/gitiles/core/
+/b7ddc514bff9bdf682abae537f990aa01dc2c0fb%5E!/> "Upgrade to latest
HarfBuzz 2.3.1"), where building with MSVC 2017 failed like
> c:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\unpackedtarball\harfbuzz\src\hb-atomic.hh(272): error C2440: 'reinterpret_cast': cannot convert from 'const int *' to 'std::atomic<int> *'
> c:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\unpackedtarball\harfbuzz\src\hb-atomic.hh(272): note: Conversion loses qualifiers
> c:\cygwin\home\tdf\lode\jenkins\workspace\gerrit_windows\workdir\unpackedtarball\harfbuzz\src\hb-atomic.hh(272): error C2227: left of '->load' must point to class/struct/union/generic type
(see <https://ci.libreoffice.org/job/gerrit_windows/29916/>).
I added all the necessary "const" to make building of HarfBuzz 2.3.1 with
MSVC 2017 succeed for me. There may be more missing at least conceptually.
It makes a hb_face_t from IDWriteFontFace, useful when using
DirectWrite facilities for font selection, loading and rendering
but using harfbuzz for shaping.
Re-implemented & repurposed CFF:remap_t as hb_map2_t (moved to hb-ot-layout-common.hh) for two-way mapping for use by index map subsetting.
Hooked up HVAR subsetter through _subset2.
Some renaming in CFF code.
For some reasons djgpp doesn't understand "unsigned int" can be same
with one of uint*_t anyway so lets do that for it explicitly.
Just to note, our CI's djgpp is based GCC 7.2.0 and isn't old.
TARGET_OS_OSX was introduced only in late OS versions
so always returns as "0" on older systems.
if !TARGET_OS_IPHONE can work, as it returns as !0 on older
systems where TARGET_OS_IPHONE is not defined, but is not
specific
if TARGET_OS_MAC && !(defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE)
is both specific and accurate on all systems.