With the 2.2 NDK, If you use ndk-build with V=1 you can see the actual
gcc command line that defines -DANDROID.
Hopefully it does not change between the NDK versions :p
--
Damien
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.
It doesn't seemed to be defined in the official NDK either...
I ran into this when I was playing with OGRE and same result. I had to
define __ANDROID__ myself.
> On Sep 6, 1:18 pm, Peter <peterholtw...@gmail.com> wrote:
>> Well, I tested it and now I'm confused, because without any flags
>> defined this _doesn't_ fail:
>>
>> #if defined(__ANDROID__)
>> bla i = 5;
>> #endif
>>
>> And if I print the build-in definitions using:
>> echo | arm-eabi-g++ -E -dM -
>>
>> there is nothing defining __ANDROID__ (using NDK r4b).
>>
>> So it's necessary to define it in the CMakeLists.txt?
>>
>> On 6 Sep., 10:08, David Turner <di...@android.com> wrote:
>>
>> > Yes, __ANDROID__ is defined by GCC
>>
>>
>
To be fair, I'm using the Crystax build of the NDK, which may
potentially be missing __ANDROID__ ?
Tim
Wow, that's stunning news that Android support has reached the gcc
mainline. That should mean Android support in the CodeSourcery
toolchain can't be far behind.
Mind you, it's too bad that we're scrambling around trying to find
alternative toolchains that support the features we really need.
--
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/9438f29c-8196-4961-aeb2-fc6aedc8200e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
All Android targets get __ANDROID__ (the compiler defines this). ANDROID should not be used. That's defined by some build systems, and does not mean anything useful in any of the build systems I know. In AOSP, ANDROID it confusingly means "this is AOSP". It's even defined for Windows targets!If you more specifically want to know that the code is being built with the NDK (as opposed to system code in the AOSP build system), r16 adds __NDK__ (and a handful of other things like __NDK_MAJOR__ and whatnot). Prior to r16 there wasn't a reliable way to detect this.
#if __ANDROID_API__ >= 21...#ednfif
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+unsubscribe@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/617e731f-282c-4f10-bcdd-6225f538a2c3%40googlegroups.com.