Initial support of Nintendo platform
(part of commit 9379c66 from Unity-Technologies/bdwgc)
Issue #173 (bdwgc).
* include/gc_config_macros.h [(!GC_WIN32_THREADS || GC_WIN32_PTHREADS
|| __CYGWIN32__ || __CYGWIN__) && GC_THREADS] (GC_PTHREADS): Do not
define if NN_PLATFORM_CTR or NN_BUILD_TARGET_PLATFORM_NX.
* include/private/gc_priv.h [NN_PLATFORM_CTR] (CLOCK_TYPE, GET_TIME,
MS_TIME_DIFF): Define macro.
* include/private/gc_priv.h [!PCR && (NN_PLATFORM_CTR
|| NINTENDO_SWITCH)] (STOP_WORLD, START_WORLD): Likewise.
* include/private/gcconfig.h [NN_PLATFORM_CTR] (ARM32,
mach_type_known): Likewise.
* include/private/gcconfig.h [NN_BUILD_TARGET_PLATFORM_NX]
(NINTENDO_SWITCH, mach_type_known): Likewise.
* include/private/gcconfig.h [NN_PLATFORM_CTR] (DATASTART, DATAEND,
STACKBOTTOM): Likewise.
* include/private/gcconfig.h [NINTENDO_SWITCH] (NO_HANDLE_FORK,
DATASTART, DATAEND, STACKBOTTOM): Likewise.
* include/private/gcconfig.h [NN_PLATFORM_CTR || NINTENDO_SWITCH]
(THREADS): Likewise.
* include/private/gcconfig.h [NINTENDO_SWITCH] (GET_MEM):
Likewise.
* misc.c [NN_PLATFORM_CTR || NINTENDO_SWITCH] (WRITE): Likewise.
* include/private/gc_priv.h [NN_PLATFORM_CTR] (n3ds_get_system_tick
n3ds_convert_tick_to_ms): Declare external function.
* include/private/gc_priv.h [!PCR && (NN_PLATFORM_CTR
|| NINTENDO_SWITCH)] (GC_stop_world, GC_start_world): Declare.
* include/private/gcconfig.h [NN_PLATFORM_CTR] (Image$$ZI$$ZI$$Base,
Image$$ZI$$ZI$$Limit, n3ds_get_stack_bottom): Likewise.
* include/private/gcconfig.h [NINTENDO_SWITCH] (__bss_end,
switch_get_stack_bottom): Likewise.
* include/private/gcconfig.h [NINTENDO_SWITCH] (switch_get_mem):
Likewise.
* misc.c [NN_PLATFORM_CTR] (n3ds_log_write): Likewise.
* misc.c [NINTENDO_SWITCH] (switch_log_write): Likewise.
* include/private/gcconfig.h [__aarch64__ && !LINUX && !DARWIN
&& !FREEBSD] (NOSYS): Do not define if NN_BUILD_TARGET_PLATFORM_NX.
* include/private/gcconfig.h [(__arm || __arm__ || __thumb__)
&& !NACL && !LINUX && !NETBSD && !FREEBSD && !OPENBSD && !DARWIN
&& !_WIN32 && !__CEGCC__ && !SYMBIAN] (NOSYS): Do not define
if NN_PLATFORM_CTR or NN_BUILD_TARGET_PLATFORM_NX.
* misc.c [!OS2 && !MACOS && !GC_ANDROID_LOG && !MSWIN32 && !MSWINCE]
(GC_stdout, GC_stderr, GC_log, GC_set_log_fd): Do not define if
NN_PLATFORM_CTR or NINTENDO_SWITCH.
* misc.c [NN_PLATFORM_CTR] (GC_init): Call GC_get_main_stack_base()
to set GC_stackbottom.
* os_dep.c (SBRK_ARG_T, OPT_MAP_ANON, GC_unix_mmap_get_mem,
GC_unix_sbrk_get_mem, GC_unix_get_mem): Do not define if
NINTENDO_SWITCH.
* os_dep.c [USE_MUNMAP]: Do not include unistd.h, sys/mman.h,
sys/stat.h, sys/types.h if NN_PLATFORM_CTR.
* os_dep.c [NN_PLATFORM_CTR || NINTENDO_SWITCH]
(GC_default_push_other_roots): Redirect to GC_push_all_stacks.