如何确定C code语言是编译为Android / NDK或iOS的 [英] How to determine C code is compiled for Android/NDK or iOS
本文介绍了如何确定C code语言是编译为Android / NDK或iOS的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我重新使用传统的C库在iOS应用和Android应用程序。我想自定义一些宏定义(如日志记录)。有没有标准的定义检查(使用的#ifdef)的code是否被编译为iOS或Android / NDK?
I am reusing a legacy C library in an iOS app and in an Android app. I want to customize some macro definitions (e.g. for logging). Are there standard defines to check for (using #ifdef) whether the code is being compiled for iOS or Android/NDK?
推荐答案
__ ANDROID __
或机器人
为Android(编译与NDK)
和 __ __苹果
苹果平台(iOS和OSX)
__ANDROID__
or ANDROID
for Android (compilation with the NDK)
and __APPLE__
on Apple platforms (iOS or OSX)
这篇关于如何确定C code语言是编译为Android / NDK或iOS的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文