在Visual Studio 2010中是否有64位的#define?

nat*_*han 33 c c++ visual-studio-2010

是否有#define指示Visual Studio是否在64位模式下进行编译?我希望能够有条件地包含一些代码

#ifdef _IS_64BIT
  ...
#else //32 bit
  ...
#endif
Run Code Online (Sandbox Code Playgroud)

我知道我可以自己创建一个标志,但我想知道编译器是否提供了一个标志.

Nik*_* B. 51

#ifdef _WIN64
  ...
#else
  ...
#endif
Run Code Online (Sandbox Code Playgroud)

MSDN上记录

  • 刚刚找到我的问题http://stackoverflow.com/a/662543/13441的精彩答案 (3认同)

Dan*_*ite 9

使用_WIN64.64位处理器的类型无关紧要.