UNICODE (Win32 only) Use the Unicode variant ('W') of the Win32 API instead
of ANSI/ASCII one ('A'). Useful for WinCE.
-PLATFORM_ANDROID (or __ANDROID__) Compile for Android NDK platform.
+HOST_ANDROID (or __ANDROID__) Compile for Android NDK platform.
SN_TARGET_PS3 Compile for Sony PS/3.
|| defined(NACL) || defined(NETBSD) \
|| defined(OPENBSD)))
# include <stddef.h>
-# if !defined(OPENBSD) && !defined(PLATFORM_ANDROID)
+# if !defined(OPENBSD) && !defined(HOST_ANDROID)
/* OpenBSD does not have elf.h file; link.h below is sufficient. */
/* Exclude Android because linker.h below includes its own version. */
# include <elf.h>
# endif
-# ifdef PLATFORM_ANDROID
+# ifdef HOST_ANDROID
/* If you don't need the "dynamic loading" feature, you may build */
/* the collector with -D IGNORE_DYNAMIC_LOADING. */
# ifdef BIONIC_ELFDATA_REDEF_BUG
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)) \
- || defined(PLATFORM_ANDROID) /* Are others OK here, too? */
+ || defined(HOST_ANDROID) /* Are others OK here, too? */
# ifndef HAVE_DL_ITERATE_PHDR
# define HAVE_DL_ITERATE_PHDR
# endif
-# ifdef PLATFORM_ANDROID
+# ifdef HOST_ANDROID
/* Android headers might have no such definition for some targets. */
int dl_iterate_phdr(int (*cb)(struct dl_phdr_info *, size_t, void *),
void *data);
# endif
-#endif /* __GLIBC__ >= 2 || PLATFORM_ANDROID */
+#endif /* __GLIBC__ >= 2 || HOST_ANDROID */
#if (defined(FREEBSD) && __FreeBSD__ >= 7) || defined(__DragonFly__)
/* On the FreeBSD system, any target system at major version 7 shall */
# ifndef PF_W
# define PF_W 2
# endif
-# elif !defined(PLATFORM_ANDROID)
+# elif !defined(HOST_ANDROID)
# include <elf.h>
# endif
-# ifndef PLATFORM_ANDROID
+# ifndef HOST_ANDROID
# include <link.h>
# endif
int i;
e = (ElfW(Ehdr) *) lm->l_addr;
-# ifdef PLATFORM_ANDROID
+# ifdef HOST_ANDROID
if (e == NULL)
continue;
# endif
# define GC_DATASTART ((void *)((ulong)_data))
# define GC_DATAEND ((void *)((ulong)_end))
# define GC_INIT_CONF_ROOTS GC_add_roots(GC_DATASTART, GC_DATAEND)
-#elif (defined(PLATFORM_ANDROID) || defined(__ANDROID__)) \
+#elif (defined(HOST_ANDROID) || defined(__ANDROID__)) \
&& !defined(GC_NOT_DLL)
# pragma weak _etext
# pragma weak __data_start
/* retrieve the call chain. */
#if (defined(__linux__) || defined(__NetBSD__) || defined(__OpenBSD__) \
|| defined(__FreeBSD__) || defined(__DragonFly__) \
- || defined(PLATFORM_ANDROID) || defined(__ANDROID__)) \
+ || defined(HOST_ANDROID) || defined(__ANDROID__)) \
&& !defined(GC_CAN_SAVE_CALL_STACKS)
# define GC_ADD_CALLER
# if GC_GNUC_PREREQ(2, 95)
# endif
# if !defined(GC_HAVE_PTHREAD_EXIT) \
- && !defined(PLATFORM_ANDROID) && !defined(__ANDROID__) \
+ && !defined(HOST_ANDROID) && !defined(__ANDROID__) \
&& (defined(GC_LINUX_THREADS) || defined(GC_SOLARIS_THREADS))
# define GC_HAVE_PTHREAD_EXIT
/* Intercept pthread_exit on Linux and Solaris. */
/* Machine specific parts contributed by various people. See README file. */
-#if defined(__ANDROID__) && !defined(PLATFORM_ANDROID)
+#if defined(__ANDROID__) && !defined(HOST_ANDROID)
/* __ANDROID__ macro is defined by Android NDK gcc. */
-# define PLATFORM_ANDROID 1
+# define HOST_ANDROID 1
#endif
#if defined(TIZEN) && !defined(HOST_TIZEN)
#endif
/* First a unified test for Linux: */
-# if (defined(linux) || defined(__linux__) || defined(PLATFORM_ANDROID)) \
+# if (defined(linux) || defined(__linux__) || defined(HOST_ANDROID)) \
&& !defined(LINUX) && !defined(__native_client__)
# define LINUX
# endif
# define DYNAMIC_LOADING
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2 \
- || defined(PLATFORM_ANDROID) || defined(HOST_TIZEN)
+ || defined(HOST_ANDROID) || defined(HOST_TIZEN)
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
extern int _end[];
# define DATAEND ((ptr_t)(_end))
# if !defined(GC_NO_SIGSETJMP) && (defined(HOST_TIZEN) \
- || (defined(PLATFORM_ANDROID) \
+ || (defined(HOST_ANDROID) \
&& !(GC_GNUC_PREREQ(4, 8) || GC_CLANG_PREREQ(3, 2) \
|| __ANDROID_API__ >= 18)))
/* Older Android NDK releases lack sigsetjmp in x86 libc */
# define DYNAMIC_LOADING
# include <features.h>
# if defined(__GLIBC__) && __GLIBC__ >= 2 \
- || defined(PLATFORM_ANDROID) || defined(HOST_TIZEN)
+ || defined(HOST_ANDROID) || defined(HOST_TIZEN)
# define SEARCH_FOR_DATA_START
# else
extern char **__environ;
/* Workaround for Android NDK clang 3.5+ (as of NDK r10e) which does */
/* not provide correct _end symbol. Unfortunately, alternate __end__ */
/* symbol is provided only by NDK "bfd" linker. */
-#if defined(PLATFORM_ANDROID) && defined(__clang__)
+#if defined(HOST_ANDROID) && defined(__clang__)
# undef DATAEND
# pragma weak __end__
extern int __end__[];
# define DATAEND (__end__ != 0 ? (ptr_t)__end__ : (ptr_t)_end)
#endif
-#if (defined(SVR4) || defined(PLATFORM_ANDROID) || defined(HOST_TIZEN)) \
+#if (defined(SVR4) || defined(HOST_ANDROID) || defined(HOST_TIZEN)) \
&& !defined(GETPAGESIZE)
# include <unistd.h>
# define GETPAGESIZE() (unsigned)sysconf(_SC_PAGESIZE)
# define GETPAGESIZE() (unsigned)getpagesize()
#endif
-#if defined(PLATFORM_ANDROID) && !(__ANDROID_API__ >= 23) \
+#if defined(HOST_ANDROID) && !(__ANDROID_API__ >= 23) \
&& ((defined(MIPS) && (CPP_WORDSZ == 32)) \
|| defined(ARM32) || defined(I386) /* but not x32 */)
/* tkill() exists only on arm32/mips(32)/x86. */
|| defined(MIPS) || defined(AVR32) \
|| defined(OR1K) || defined(NIOS2))) \
|| (defined(LINUX) && !defined(__gnu_linux__)) \
- || (defined(RTEMS) && defined(I386)) || defined(PLATFORM_ANDROID)) \
+ || (defined(RTEMS) && defined(I386)) || defined(HOST_ANDROID)) \
&& !defined(NO_GETCONTEXT)
# define NO_GETCONTEXT
#endif
# define MIN_STACK_SIZE (8 * HBLKSIZE * sizeof(word))
#endif
-#if defined(PLATFORM_ANDROID) && !defined(THREADS) \
+#if defined(HOST_ANDROID) && !defined(THREADS) \
&& !defined(USE_GET_STACKBASE_FOR_MAIN)
/* Always use pthread_attr_getstack on Android ("-lpthread" option is */
/* not needed to be specified manually) since GC_linux_main_stack_base */
/* Outline pthread primitives to use in GC_get_[main_]stack_base. */
#if ((defined(FREEBSD) && defined(__GLIBC__)) /* kFreeBSD */ \
- || defined(LINUX) || defined(NETBSD) || defined(PLATFORM_ANDROID)) \
+ || defined(LINUX) || defined(NETBSD) || defined(HOST_ANDROID)) \
&& !defined(NO_PTHREAD_GETATTR_NP)
# define HAVE_PTHREAD_GETATTR_NP 1
#elif defined(FREEBSD) && !defined(__GLIBC__) \
#endif
#if defined(UNIX_LIKE) && defined(THREADS) && !defined(NO_CANCEL_SAFE) \
- && !defined(PLATFORM_ANDROID)
+ && !defined(HOST_ANDROID)
/* Make the code cancellation-safe. This basically means that we */
/* ensure that cancellation requests are ignored while we are in */
/* the collector. This applies only to Posix deferred cancellation; */
#if defined(CAN_HANDLE_FORK) && !defined(CAN_CALL_ATFORK) \
&& !defined(HURD) && !defined(HOST_TIZEN) \
- && (!defined(PLATFORM_ANDROID) || __ANDROID_API__ >= 21)
+ && (!defined(HOST_ANDROID) || __ANDROID_API__ >= 21)
/* Have working pthread_atfork(). */
# define CAN_CALL_ATFORK
#endif
# endif /* !GNU */
# elif (defined(LINUX) && !defined(ARM32) && !defined(AVR32) \
&& GC_GNUC_PREREQ(3, 3) \
- && !(defined(__clang__) && defined(PLATFORM_ANDROID))) \
- || (defined(PLATFORM_ANDROID) && defined(ARM32) \
+ && !(defined(__clang__) && defined(HOST_ANDROID))) \
+ || (defined(HOST_ANDROID) && defined(ARM32) \
&& (GC_GNUC_PREREQ(4, 6) || GC_CLANG_PREREQ_FULL(3, 8, 256229)))
# define USE_COMPILER_TLS
# elif defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) \
# pragma weak __data_start
# pragma weak data_start
extern int __data_start[], data_start[];
-# ifdef PLATFORM_ANDROID
+# ifdef HOST_ANDROID
# pragma weak _etext
# pragma weak __dso_handle
extern int _etext[], __dso_handle[];
# if (defined(LINUX) || defined(HURD)) && !defined(IGNORE_PROG_DATA_START)
/* Try the easy approaches first: */
-# ifdef PLATFORM_ANDROID
+# ifdef HOST_ANDROID
/* Workaround for "gold" (default) linker (as of Android NDK r10e). */
if ((word)__data_start < (word)_etext
&& (word)_etext < (word)__dso_handle) {
#elif defined(GC_OSF1_THREADS) || defined(GC_AIX_THREADS) \
|| defined(GC_SOLARIS_THREADS) || defined(HURD) \
- || defined(PLATFORM_ANDROID) || defined(NACL)
+ || defined(HOST_ANDROID) || defined(NACL)
GC_INLINE int GC_get_nprocs(void)
{
int nprocs = (int)sysconf(_SC_NPROCESSORS_ONLN);
return nprocs > 0 ? nprocs : 1; /* ignore error silently */
}
-#elif defined(GC_LINUX_THREADS) /* && !PLATFORM_ANDROID && !NACL */
+#elif defined(GC_LINUX_THREADS) /* && !HOST_ANDROID && !NACL */
/* Return the number of processors. */
STATIC int GC_get_nprocs(void)
{
|| defined(CYGWIN32) || defined(GC_OPENBSD_UTHREADS) \
|| (defined(DARWIN) && !defined(NO_PTHREAD_GET_STACKADDR_NP)) \
|| ((defined(FREEBSD) || defined(LINUX) || defined(NETBSD) \
- || defined(PLATFORM_ANDROID)) && !defined(NO_PTHREAD_GETATTR_NP) \
+ || defined(HOST_ANDROID)) && !defined(NO_PTHREAD_GETATTR_NP) \
&& !defined(NO_PTHREAD_ATTR_GET_NP)) \
|| (defined(GC_SOLARIS_THREADS) && !defined(_STRICT_STDC)) \
|| (!defined(STACKBOTTOM) && (defined(HEURISTIC1) \
/* Call GC_INIT only on platforms on which we think we really need it, */
/* so that we can test automatic initialization on the rest. */
#if defined(TEST_EXPLICIT_GC_INIT) || defined(AIX) || defined(CYGWIN32) \
- || defined(DARWIN) || defined(PLATFORM_ANDROID) \
+ || defined(DARWIN) || defined(HOST_ANDROID) \
|| (defined(MSWINCE) && !defined(GC_WINMAIN_REDIRECT))
# define GC_OPT_INIT GC_INIT()
#else
"-Wl,--wrap -Wl,pthread_detach -Wl,--wrap -Wl,pthread_sigmask "
"-Wl,--wrap -Wl,pthread_exit -Wl,--wrap -Wl,pthread_cancel\n");
# endif
-# if (defined(GC_LINUX_THREADS) && !defined(PLATFORM_ANDROID)) \
+# if (defined(GC_LINUX_THREADS) && !defined(HOST_ANDROID)) \
|| defined(GC_IRIX_THREADS) || defined(GC_DARWIN_THREADS) \
|| defined(GC_AIX_THREADS) || (defined(HURD) && defined(GC_THREADS))
# ifdef GC_USE_DLOPEN_WRAP