下面拷贝过来。
编译时,可能提示:
error C2733: second C linkage of overloaded function '_interlockedbittestandset' not allowed L:/DDK/Vista/inc/ddk/intrin.h 912
error C2733: second C linkage of overloaded function '_interlockedbittestandreset' not allowed L:/DDK/Vista/inc/ddk/intrin.h 913
error C2733: second C linkage of overloaded function '_interlockedbittestandset64' not allowed L:/DDK/Vista/inc/ddk/intrin.h 918
error C2733: second C linkage of overloaded function '_interlockedbittestandreset64' not allowed L:/DDK/Vista/inc/ddk/intrin.h 919
到intrin.h里边去,注释掉相关四行代码即可:
//__MACHINEI(unsigned char _interlockedbittestandset(long *a, long b))
//__MACHINEI(unsigned char _interlockedbittestandreset(long *a, long b))
//__MACHINEX64(unsigned char _interlockedbittestandset64(__int64 *a, __int64 b))
//__MACHINEX64(unsigned char _interlockedbittestandreset64(__int64 *a, __int64 b))
上面只是让编译通过,想连接通过,还必须设置编译选项C/C++/Optimiztation: Enable Intrinsic Funcions,勾上。