以下内容摘自:http://stackoverflow.com/questions/1505582/determining-32-vs-64-bit-in-c
class="C++" name="code">// Check windows
#if _WIN32 || _WIN64
#if _WIN64
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
// Check GCC
#if __GNUC__
#if __x86_64__ || __ppc64__
#define ENVIRONMENT64
#else
#define ENVIRONMENT32
#endif
#endif
MSDN有关
预定义变量的页面:http://msdn.microsoft.com/en-us/library/b0084kay.aspx
_WIN32Defined for applications for Win32 and Win64. Al
ways defined._WIN64Defined for applications for Win64.
还有什么_M_AMD64之类关于CPU
架构的
宏定义请参考MSDN。