* include/freetype/internal/ftcalc.h (FT_MSB): Use `_MSC_VER' value. Older VC versions don't provide `_BitScanReverse'. We test for VC 2013. Reported by John Emmas <john@creativepost.co.uk>.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/ChangeLog b/ChangeLog
index ca99135..bbf073f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-05-18 Werner Lemberg <wl@gnu.org>
+
+ * include/freetype/internal/ftcalc.h (FT_MSB): Use `_MSC_VER' value.
+
+ Older VC versions don't provide `_BitScanReverse'. We test for VC
+ 2013.
+
+ Reported by John Emmas <john@creativepost.co.uk>.
+
2018-05-17 Werner Lemberg <wl@gnu.org>
s/inline/__inline/ for MSVC.
diff --git a/include/freetype/internal/ftcalc.h b/include/freetype/internal/ftcalc.h
index d3c074b..2fd2a20 100644
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -353,10 +353,10 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
-#endif
+#endif /* __GNUC__ */
-#elif defined( _MSC_VER )
+#elif defined( _MSC_VER ) && ( _MSC_VER >= 1800 )
#if FT_SIZEOF_INT == 4
@@ -368,6 +368,7 @@ FT_BEGIN_HEADER
unsigned long where;
+ /* not available in older VC versions */
_BitScanReverse( &where, x );
return (FT_Int32)where;
@@ -377,7 +378,8 @@ FT_BEGIN_HEADER
#endif
-#endif
+#endif /* _MSC_VER */
+
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */