From: Hans Kristian Rosbach Date: Tue, 3 Nov 2015 14:22:16 +0000 (+0100) Subject: Clean up X-Git-Tag: 1.9.9-b1~793^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=90f7d278663a4353817b011dcced552a78c981d7;p=thirdparty%2Fzlib-ng.git Clean up --- diff --git a/match.c b/match.c index f6e2cba6e..0d934e205 100644 --- a/match.c +++ b/match.c @@ -28,6 +28,21 @@ #endif +#ifdef _MSC_VER +#include +/* This is not a general purpose replacement for __builtin_ctzl. The function expects that value is != 0 + * Because of that assumption trailing_zero is not initialized and the return value of _BitScanForward is not checked + */ +static __forceinline unsigned long __builtin_ctzl(unsigned long value) +{ + unsigned long trailing_zero; + _BitScanForward(&trailing_zero, value); + return trailing_zero; +} +#endif + + + #ifdef std1_longest_match /* @@ -268,20 +283,6 @@ ZLIB_INTERNAL unsigned longest_match(deflate_state *const s, IPos cur_match) { #endif #ifdef std3_longest_match - -#ifdef _MSC_VER -#include -/* This is not a general purpose replacement for __builtin_ctzl. The function expects that value is != 0 - * Because of that assumption trailing_zero is not initialized and the return value of _BitScanForward is not checked - */ -static __forceinline unsigned long __builtin_ctzl(unsigned long value) -{ - unsigned long trailing_zero; - _BitScanForward(&trailing_zero, value); - return trailing_zero; -} -#endif - /* longest_match() with minor change to improve performance (in terms of * execution time). *