BitScanForward64 issue in Visual Studio 11 Developer Preview

I am not at all new to writing anything in C. I am writing a helper DLL (for calling from C #) that performs binary manipulation. I get the "identifier" BitScanForward64 "this is an undefined error." A 32-bit version is available. I believe this is because I created the Win32 DLL.

Then it became clear to me that the 64-bit version can be available only for a specific 64-bit DLL (I assume "General" in the new project wizard), and I may need a separate 32-bit and 64-bit dll. In this case, or can I have one DLL that runs both the BitScanForward and BitScanForward64 properties, and if so, how do I create it?

Here is my current code:

// C Functions.cpp : Defines the exported functions for the DLL application.

#include "stdafx.h"
//#include <intrin.h>
//#include <winnt.h>

int _stdcall LSB_i32(unsigned __int32 x)
{
    DWORD result;
    BitScanForward(&result, x);
    return (int)result;
}

int _stdcall MSB_i32(unsigned __int32 x)
{
    DWORD result;
    BitScanReverse(&result, x);
    return (int)result; 
}

int _stdcall LSB_i64(unsigned __int64 x)
{
    DWORD result;
    BitScanForward64(&result, x);
    return (int)result;
}

int _stdcall MSB_i64(unsigned __int64 x)
{
    DWORD result;
    BitScanReverse64(&result, x);
    return (int)result;
}
0
1

DLL , DLL x64 (, , 64- 64- ), ( , intrisics _ , BitScan*64 , ).

x64 Visual Studio, DLL.

+2

All Articles