library) by defining GC_INIT_CONF_ROOTS
* include/gc.h (GC_INIT_CONF_ROOTS): Define to register static data
root in range from "__data_start" to "_end" on Android (unless
explicitly prohibited by client via GC_NOT_DLL macro) since the client
data root is not registered automatically if GC is build as a shared
library.
* tests/test.c (GC_COND_INIT): Invoke GC_INIT also on Android.
# 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__)) \
+ && !defined(GC_NOT_DLL)
+ /* Required if GC is built as shared library. */
+ extern int __data_start[], _end[];
+# define GC_INIT_CONF_ROOTS GC_add_roots(__data_start, _end)
#else
# define GC_INIT_CONF_ROOTS /* empty */
#endif
/* 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(CYGWIN32) || defined (AIX) || defined(DARWIN) \
- || defined(THREAD_LOCAL_ALLOC) \
+ || defined(PLATFORM_ANDROID) || defined(THREAD_LOCAL_ALLOC) \
|| (defined(MSWINCE) && !defined(GC_WINMAIN_REDIRECT))
# define GC_COND_INIT() GC_INIT(); CHECH_GCLIB_VERSION
#else