shithub: freetype+ttf2subf

Download patch

ref: 840b844301d9f5561627314b18fb81135abf0407
parent: 3331b84fc2a2020dcf84511003172c4395a78f24
author: Werner Lemberg <[email protected]>
date: Fri May 18 06:57:51 EDT 2018

* 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 <[email protected]>.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2018-05-18  Werner Lemberg  <[email protected]>
+
+	* 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 <[email protected]>.
+
 2018-05-17  Werner Lemberg  <[email protected]>
 
 	s/inline/__inline/ for MSVC.
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -353,10 +353,10 @@
 
 #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 @@
     unsigned long  where;
 
 
+    /* not available in older VC versions */
     _BitScanReverse( &where, x );
 
     return (FT_Int32)where;
@@ -377,7 +378,8 @@
 
 #endif
 
-#endif
+#endif /* _MSC_VER */
+
 
 #endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */