[英]Is there a #define for 64 bit in Visual Studio 2010?
Is there a #define that indicates whether Visual Studio is compiling in 64bit mode?是否有 #define 指示 Visual Studio 是否在 64 位模式下编译? I'd like to be able to include some code conditionally like so
我希望能够像这样有条件地包含一些代码
#ifdef _IS_64BIT
...
#else //32 bit
...
#endif
I know I can create a flag myself, but I'm wondering if the compiler provides one.我知道我可以自己创建一个标志,但我想知道编译器是否提供了一个。
#ifdef _WIN64
...
#else
...
#endif
Documented on Microsoft docs记录在Microsoft 文档中
Use _WIN64
.使用
_WIN64
。 It won't matter the type of 64 bit processor. 64位处理器的类型无关紧要。
#ifdef WIN32
或#ifdef _WIN32
将在 x64 中工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.