]> granicus.if.org Git - curl/commitdiff
curl.h: add __ANDROID__ macro check
authorCédric Deltheil <cedric@moodstocks.com>
Tue, 20 Dec 2011 11:23:11 +0000 (12:23 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 20 Dec 2011 19:18:14 +0000 (20:18 +0100)
When working with the Android Standalone Toolchain the compiler defines
this macro:

  /path/to/arm-linux-androideabi-gcc -E -dM - < /dev/null \
  | grep -i android
  #define __ANDROID__ 1

We really need to check both ANDROID and __ANDROID__ since I've observed
that:

* if you use Android.mk file(s) and the 'ndk-build' script (aka vanilla
way), ANDROID is predefined (see -DANDROID extra C flag),

* if you use the Android Standalone Toolchain, then __ANDROID__ is
predefined as stated by the compiler

include/curl/curl.h

index 8f823486a08b708f8f65e1447ff66a1fcbdecbfe..1e908a3ec41ab52318dcab9ced48f8c8280ae26f 100644 (file)
@@ -69,7 +69,7 @@
    require it! */
 #if defined(_AIX) || defined(__NOVELL_LIBC__) || defined(__NetBSD__) || \
     defined(__minix) || defined(__SYMBIAN32__) || defined(__INTEGRITY) || \
-    defined(ANDROID) || \
+    defined(ANDROID) || defined(__ANDROID__) || \
    (defined(__FreeBSD_version) && (__FreeBSD_version < 800000))
 #include <sys/select.h>
 #endif