Fourth try at building VS bots
authorBehdad Esfahbod <behdad@behdad.org>
Sat, 1 Jun 2019 05:31:35 +0000 (22:31 -0700)
committerBehdad Esfahbod <behdad@behdad.org>
Sat, 1 Jun 2019 05:49:34 +0000 (22:49 -0700)
Based on https://github.com/harfbuzz/harfbuzz/issues/1730#issuecomment-497151210

src/hb-algs.hh

index d195c77..38104fd 100644 (file)
@@ -167,15 +167,21 @@ template <unsigned Pos=1, typename Appl, typename V>
 auto hb_partial (Appl&& a, V&& v) HB_AUTO_RETURN
 (( hb_partial_t<Pos, Appl, V> (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 <typename _T> \
+  decltype(auto) operator () (_T&& _v) const \
+  { return hb_partial<Pos> (this, hb_forward<_T> (_v)); } \
+  static_assert (true, "")
+#else
 #define HB_PARTIALIZE(Pos) \
   template <typename _T> \
   auto operator () (_T&& _v) const HB_AUTO_RETURN \
-  (hb_partial<Pos> ( \
-                   /* 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<Pos> (this, hb_forward<_T> (_v))) \
   static_assert (true, "")
+#endif
 
 
 struct