From 619f5f1eb9e5e2a4f326f89c9e3e05b01f9c042f Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 31 May 2019 22:31:35 -0700 Subject: [PATCH] Fourth try at building VS bots Based on https://github.com/harfbuzz/harfbuzz/issues/1730#issuecomment-497151210 --- src/hb-algs.hh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/hb-algs.hh b/src/hb-algs.hh index d195c772..38104fdb 100644 --- a/src/hb-algs.hh +++ b/src/hb-algs.hh @@ -167,15 +167,21 @@ template auto hb_partial (Appl&& a, V&& v) HB_AUTO_RETURN (( hb_partial_t (a, v) )) +/* The following hacky replacement version is to make Visual Stuiod build:. */ \ +/* https://github.com/harfbuzz/harfbuzz/issues/1730 */ \ +#ifdef _MSC_VER +#define HB_PARTIALIZE(Pos) \ + template \ + decltype(auto) operator () (_T&& _v) const \ + { return hb_partial (this, hb_forward<_T> (_v)); } \ + static_assert (true, "") +#else #define HB_PARTIALIZE(Pos) \ template \ auto operator () (_T&& _v) const HB_AUTO_RETURN \ - (hb_partial ( \ - /* The following ugly line is a hacky replacement for "this". */ \ - /* https://github.com/harfbuzz/harfbuzz/issues/1730 */ \ - (true?this:nullptr), \ - hb_forward<_T> (_v))) \ + (hb_partial (this, hb_forward<_T> (_v))) \ static_assert (true, "") +#endif struct -- GitLab