Is there a preprocessor macro that will let me know NDK is compiling my code? I could manually define my own, but I\'d rather not if possible.
Short answer: #ifdef ANDROID .
#ifdef ANDROID
The ANDROID macro is defined for you in build-module.mk (part of the standard build system):
ANDROID
# always define ANDROID when building binaries # LOCAL_CFLAGS := -DANDROID $(LOCAL_CFLAGS)