atom feed17 messages in com.googlegroups.android-ndkRe: Platform define: ANDROID or __AND...
FromSent OnAttachments
PeterSep 2, 2010 5:36 am 
Damien LespiauSep 2, 2010 9:47 am 
Angus LeesSep 2, 2010 8:41 pm 
PeterSep 3, 2010 12:21 am 
David TurnerSep 3, 2010 9:35 am 
PeterSep 6, 2010 12:05 am 
David TurnerSep 6, 2010 1:07 am 
PeterSep 6, 2010 5:17 am 
alanSep 6, 2010 8:34 am 
Doug SchaeferSep 6, 2010 8:51 am 
Tim MenschSep 6, 2010 12:34 pm 
Angus LeesSep 6, 2010 1:51 pm 
Doug SchaeferSep 6, 2010 2:45 pm 
Tim in BoulderSep 6, 2010 3:13 pm 
David TurnerSep 7, 2010 5:29 am 
mani krishnanFeb 23, 2013 1:09 am 
Jeffrey WaltonFeb 23, 2013 3:58 am 
Subject:Re: Platform define: ANDROID or __ANDROID__?
From:David Turner ("di.@android.com)
Date:Sep 7, 2010 5:29:32 am
List:com.googlegroups.android-ndk

Sorry guys, seems to be a bug in the toolchain. I'll look for it.

I would recommend defining __ANDROID__ explicitely for now, it should be the only thing that NDK users should be testing again.

Thanks a lot for your time, sorry for the misinformation.

- David

On Tue, Sep 7, 2010 at 12:14 AM, Tim in Boulder <tim.@gmail.com>wrote:

On Sep 6, 2:08 am, David Turner <di.@android.com> wrote:

Yes, __ANDROID__ is defined by GCC

Not in android-ndk-r4b. I added this to hello-jni.c:

#ifndef __ANDROID__ #error #endif

And then built:

$ /f/Devel/android-ndk-r4b/ndk-build Gdbserver : [arm-eabi-4.4.0] /cygdrive/c/Users/tim/projects/ android/jni_std/libs/armeabi/gdbserver Gdbsetup : /cygdrive/c/Users/tim/projects/android/jni_std/libs/ armeabi/gdb.setup Gdbsetup : + source directory /cygdrive/c/Users/tim/projects/ android/jni_std/jni Compile thumb : hello-jni <= /cygdrive/c/Users/tim/projects/android/ jni_std/jni/hello-jni.c /cygdrive/c/Users/tim/projects/android/jni_std/jni/hello-jni.c:21:2: error: #error make: *** [/cygdrive/c/Users/tim/projects/android/jni_std/obj/local/ armeabi/objs/hello-jni/hello-jni.o] Error 1

So it does not seem to be defined by the current tool chain, unless by "defined by GCC" you mean it's defined by some internal build of GCC that doesn't come with the NDK. Angus just pointed out that it's defined in GCC 4.5.0, for example.