nac*_*o4d 5 macos xcode objective-c
我正在处理一个在不同架构中需要不同参数的相机,是否有一个标志我可以检查我的mac是32位还是64位?我试过这个但似乎不起作用,我总是得到32位!:
#if defined(PER_ARCH_CFLAGS_x86_64)
NSLog(@"64bit!!");
#else
NSLog(@"32Bits!!");
#endif
Run Code Online (Sandbox Code Playgroud)
小智 8
#ifdef __x86_64__
//64-bit intel
#endif
#ifdef __i386__
//32-bit intel
#endif
//carry on for ppc, ppc64, ARM
Run Code Online (Sandbox Code Playgroud)
要么...
#ifdef __LP64__
//64-bit Intel or PPC
#else
//32-bit Intel, PPC or ARM
#endif
Run Code Online (Sandbox Code Playgroud)
#ifdef __LP64__
// 64-bit code
#else
// 32-bit code
#endif
Run Code Online (Sandbox Code Playgroud)
来源:http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/64bitPorting/MakingCode64-BitClean/MakingCode64-BitClean.html#//apple_ref/doc/uid/TP40001064-CH226-SW2