VC2010 中使用条件编译判断是32位仍是64位编译模式

在VC2010中经过platform选择32位仍是64位编译时,能够经过下面的条件编译指令来判断:app

[cpp] view plain copyspa

 

  1. // 32位编译  
  2. #ifdef _M_IX86  
  3. #pragma comment(lib,"QDPay_mt.lib")  
  4. #endif // _M_IX86  
  5. // 64位编译  
  6. #ifdef _M_X64  
  7. #pragma comment(lib,"QDPay_mt64.lib")  
  8. #endif // _M_X64  

 

参见MSDN:https://msdn.microsoft.com/en-us/library/b0084kay.aspx.net

 

相关的预约义宏:orm

 

_M_IX86 : 32bit处理器blog

_M_AMD64 : 64bit AMD处理器 (VC2008之前)ip

_M_X64 : 64bit AMD and Intel处理器(VC2008及之后),get

_M_IX64 : 64bit Itanium处理器flash

 

_WIN32 : Defined for both 32bit and 64bit processorit

_WIN64 : Defined for 64bit processorio

相关文章
相关标签/搜索