Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] Fwd: [Wireshark-commits] rev 51173: /trunk/epan/ /trunk/epan

From: Graham Bloice <graham.bloice@xxxxxxxxxxxxx>
Date: Wed, 7 Aug 2013 09:32:44 +0100
On 6 August 2013 23:42, Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx> wrote:
On Tue, Aug 06, 2013 at 11:39:11PM +0200, Anders Broman wrote:
> Should we use *_BitScanForward*  on Windows?
> http://msdn.microsoft.com/en-us/library/wfd9z0bb%28VS.80%29.aspx

Sure, if you know how to do it, why not.

Slight caution required, it's a Microsoft specific compiler intrinsic, but as I'm not aware of; a) an intent to support compilation of Wireshark on Windows with anything other than the MSVC toolchain and b) I don't think MS will be dropping that intrinsic anytime soon, I think it should be safe.  Obviously it would need to be wrapped with the appropriate #ifdef to hide it from non- MS compilers.

Despite the info from MSDN the functions are available from VS 2005 through to VS2013 although it appears that the 64 bit version is only available if targetting an x64 build.