We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ccf9f05 commit 401e43aCopy full SHA for 401e43a
src/zopfli/symbols.h
@@ -32,6 +32,15 @@ Utilities for using the lz77 symbols of the deflate spec.
32
/* __builtin_clz available beginning with GCC 3.4 */
33
#elif __GNUC__ * 100 + __GNUC_MINOR__ >= 304
34
# define ZOPFLI_HAS_BUILTIN_CLZ
35
+/* _BitScanReverse available beginning with Visual Studio 2005 */
36
+#elif _MSC_VER >= 1400
37
+# include <intrin.h>
38
+# define ZOPFLI_HAS_BUILTIN_CLZ
39
+static int __inline __builtin_clz(unsigned int x) {
40
+ unsigned long r;
41
+ _BitScanReverse(&r, x);
42
+ return 31 ^ r;
43
+}
44
#endif
45
46
/* Gets the amount of extra bits for the given dist, cfr. the DEFLATE spec. */
0 commit comments