我正在试图弄清楚我对Windows宏可以期待什么值_INTEGRAL_MAX_BITS.
MSDN的__int64文档说每次使用时都应该使用此代码__int64
#if defined (_INTEGRAL_MAX_BITS) && \
_INTEGRAL_MAX_BITS >= 64
typedef signed __int64 int64;
typedef unsigned __int64 uint64;
#else
#error __int64 type not supported
#endif
Run Code Online (Sandbox Code Playgroud)
为什么我会看到低于32的值INTEGRAL_MAX_BITS?这个问题的答案 表明,在32位Windows上,a long long是64位. VS2013文档说明了这一点
_INTEGRAL_MAX_BITS - 将整数类型的最大大小(以位为单位)报告为整数文字.
由于long long是一个整数类型,即使在32位Windows上,应该返回的最低值是64位,对吧?
为什么必要的_INTEGRAL_MAX_BITS >= 64部分#if?