void test()
{
int len=sizeof(int)*8;
printf("sizeof(int)=%d\n",len);
len=sizeof(int *)*8;
printf("sizeof(int*)=%d\n",len);
#ifdef _MSC_VER
printf("_MSC_VER is defined\n");
#endif
#ifdef __GNUC__
printf("__GNUC__ is defined\n");
#endif
#ifdef __INTEL__
printf("__INTEL__ is defined\n");
#endif
#ifdef __i386__
printf("__i386__ is defined\n");
#endif
#ifdef __x86_64__
printf("__x86_64__ is defined\n");
#endif
#ifdef _WIN32
printf("_WIN32 is defined\n");
#endif
#ifdef _WIN64
printf("_WIN64 is defined\n");
#endif
#ifdef __linux__
printf("__linux__ is defined\n");
#endif
#ifdef __LP64__
printf("__LP64__ is defined\n");
#endif
#ifdef __amd64
printf("__amd64 is defined\n");
#endif
}
int main(int argc, char* argv[])
{
test();
return 0;
}
————————————————
版权声明:本文为CSDN博主「liangbch」的原创文章,遵循CC 4.0 by-sa版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/liangbch/article/details/36020391