Commit 840b844301d9f5561627314b18fb81135abf0407

Werner Lemberg 2018-05-18T10:57:51

* 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>.

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 */