From: Ivan Maidanski Date: Fri, 16 Dec 2011 11:07:14 +0000 (+0400) Subject: Recognize __ANDROID__ as synonym for PLATFORM_ANDROID X-Git-Tag: gc7_3alpha2~286 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4a5e142abed21e4ba7f919dca5067b6e7c7f3739;p=gc Recognize __ANDROID__ as synonym for PLATFORM_ANDROID * README.macros (PLATFORM_ANDROID): Update. * include/gc_config_macros.h (__ANDROID__): Recognize as a synonym for PLATFORM_ANDROID. * include/private/gcconfig.h (PLATFORM_ANDROID): Define if __ANDROID__. --- diff --git a/doc/README.macros b/doc/README.macros index a6291baf..42bc5059 100644 --- a/doc/README.macros +++ b/doc/README.macros @@ -552,7 +552,7 @@ NO_CANCEL_SAFE (Posix platforms with threads only) Don't bother trying UNICODE (Win32 only) Use the Unicode variant ('W') of the Win32 API instead of ANSI/ASCII one ('A'). Useful for WinCE. -PLATFORM_ANDROID Compile for Android NDK platform. +PLATFORM_ANDROID (or __ANDROID__) Compile for Android NDK platform. SN_TARGET_PS3 Compile for Sony PS/3. diff --git a/include/gc_config_macros.h b/include/gc_config_macros.h index d407a6b9..d3b5f6a6 100644 --- a/include/gc_config_macros.h +++ b/include/gc_config_macros.h @@ -282,7 +282,8 @@ /* retrieve the call chain. */ #if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \ || defined(__FreeBSD__) || defined(__DragonFly__) \ - || defined(PLATFORM_ANDROID)) && !defined(GC_CAN_SAVE_CALL_STACKS) + || defined(PLATFORM_ANDROID) || defined(__ANDROID__)) \ + && !defined(GC_CAN_SAVE_CALL_STACKS) # define GC_ADD_CALLER # if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95) /* gcc knows how to retrieve return address, but we don't know */ @@ -322,7 +323,8 @@ # endif # endif -# if !defined(GC_PTHREAD_EXIT_ATTRIBUTE) && !defined(PLATFORM_ANDROID) \ +# if !defined(GC_PTHREAD_EXIT_ATTRIBUTE) \ + && !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) \ && (defined(GC_LINUX_THREADS) || defined(GC_SOLARIS_THREADS)) /* Intercept pthread_exit on Linux and Solaris. */ # if defined(__GNUC__) /* since GCC v2.7 */ diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h index 2293583d..ebc1fc36 100644 --- a/include/private/gcconfig.h +++ b/include/private/gcconfig.h @@ -37,6 +37,11 @@ /* Machine specific parts contributed by various people. See README file. */ +#if defined(__ANDROID__) && !defined(PLATFORM_ANDROID) + /* __ANDROID__ macro is defined by Android NDK gcc. */ +# define PLATFORM_ANDROID 1 +#endif + /* First a unified test for Linux: */ # if (defined(linux) || defined(__linux__) || defined(PLATFORM_ANDROID)) \ && !defined(LINUX) && !defined(__native_client__)