How to detect compilation by Android NDK in a C/C++ file?

It is #ifdef __ANDROID__ as seen by running the preprocessor:

~$ /usr/local/android-ndk-r6/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc -E -dM - < /dev/null | grep -i android

The output is:

#define __ANDROID__ 1

No need to depend on defining stuff in your project especially if you’re skipping the NDK build system.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)