]> granicus.if.org Git - gc/commitdiff
Recognize __ANDROID__ as synonym for PLATFORM_ANDROID
authorIvan Maidanski <ivmai@mail.ru>
Fri, 16 Dec 2011 11:07:14 +0000 (15:07 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 16 Dec 2011 11:10:57 +0000 (15:10 +0400)
* 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__.

doc/README.macros
include/gc_config_macros.h
include/private/gcconfig.h

index a6291bafe9b28c4b8b1107dd38a7ccfd67598b08..42bc50594031d69488c4cfe23fdf791668a66355 100644 (file)
@@ -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.
 
index d407a6b9fc7d958005b004879fd10d52b3df6707..d3b5f6a692eaeedcbafb43a39ade47e7c8cae514 100644 (file)
 /* 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      */
 #   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 */
index 2293583d48659e8744e565e7cdde3b8ebcb3f211..ebc1fc36510d2ce4215924a40d6653ba9bb32104 100644 (file)
 
 /* 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__)