Skip to content

Instantly share code, notes, and snippets.

@ytlvy
Created October 7, 2015 12:48
Show Gist options
  • Save ytlvy/a20f5bc7a49017dc7ef4 to your computer and use it in GitHub Desktop.
Save ytlvy/a20f5bc7a49017dc7ef4 to your computer and use it in GitHub Desktop.
__arm64__ 、__arm__宏判断平台架构
// 参考官方判断方法:http://www.opensource.apple.com/source/cctools/cctools-870/include/mach/arm/thread_status.h
void checkArch(){
#if defined (__arm64__)/* || defined (__aarch64__) */
printf("[PiaoYun]running 64-bit [__arm64__ arch]\n");
#elif defined(__arm64__)
printf("[PiaoYun]runing 32-bit [__arm__ arch]\n");
#else
#error [PiaoYun]Unknown arch
#endif
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment