[runtime] Use HOST_ defines instead of PLATFORM_ defines. (#5362)
authorZoltan Varga <vargaz@gmail.com>
Tue, 15 Aug 2017 15:16:48 +0000 (11:16 -0400)
committerGitHub <noreply@github.com>
Tue, 15 Aug 2017 15:16:48 +0000 (11:16 -0400)
65 files changed:
configure.ac
libgc/include/private/gcconfig.h
libgc/include/private/pthread_support.h
libgc/pthread_stop_world.c
libgc/pthread_support.c
mono/dis/Makefile.am
mono/eglib/Makefile.am
mono/eglib/goutput.c
mono/metadata/Makefile.am
mono/metadata/assembly.c
mono/metadata/boehm-gc.c
mono/metadata/icall-def.h
mono/metadata/loader.c
mono/metadata/metadata-cross-helpers.c
mono/metadata/mono-route.c
mono/metadata/mono-route.h
mono/metadata/threadpool-worker-default.c
mono/metadata/threads.c
mono/metadata/w32file-unix.c
mono/metadata/w32process-unix-default.c
mono/metadata/w32process-unix-internals.h
mono/metadata/w32process-unix.c
mono/metadata/w32socket-unix.c
mono/mini/Makefile.am.in
mono/mini/aot-runtime.c
mono/mini/debugger-agent.c
mono/mini/debugger-agent.h
mono/mini/exceptions-arm.c
mono/mini/mini-arm.c
mono/mini/mini-exceptions.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-posix.c
mono/mini/mini-runtime.c
mono/mini/mini.c
mono/mini/mini.h
mono/mini/trace.c
mono/profiler/Makefile.am
mono/sgen/sgen-marksweep.c
mono/tests/Makefile.am
mono/unit-tests/Makefile.am
mono/utils/mono-compiler.h
mono/utils/mono-dl-posix.c
mono/utils/mono-hwcap-arm.c
mono/utils/mono-log-android.c
mono/utils/mono-logger-internals.h
mono/utils/mono-logger.c
mono/utils/mono-os-mutex.h
mono/utils/mono-path.c
mono/utils/mono-proclib.c
mono/utils/mono-sigcontext.h
mono/utils/mono-threads-android.c
mono/utils/mono-threads-linux.c
mono/utils/mono-threads-posix-signals.c
mono/utils/mono-threads-posix.c
mono/utils/mono-threads.c
mono/utils/mono-time.c
support/errno.c
support/mph.h
support/sys-mman.c
support/sys-sendfile.c
support/unistd.c
tools/monograph/Makefile.am
tools/offsets-tool/MonoAotOffsetsDumper.cs
tools/pedump/Makefile.am
winconfig.h

index 0abf9ebb4695b9b1866e7d92408c193b547d1518..aa0111de8aec8119c31963c6433ac3f56a643e3e 100644 (file)
@@ -110,7 +110,7 @@ host_darwin=no
 case "$host" in
        *-mingw*|*-*-cygwin*)
                AC_DEFINE(DISABLE_PORTABILITY,1,[Disable the io-portability layer])
-               AC_DEFINE(PLATFORM_NO_SYMLINKS,1,[This platform does not support symlinks])
+               AC_DEFINE(HOST_NO_SYMLINKS,1,[This platform does not support symlinks])
                host_win32=yes
                mono_cv_clang=no
                if test "x$cross_compiling" = "xno"; then
@@ -141,7 +141,7 @@ case "$host" in
                CPPFLAGS="$CPPFLAGS -D_REENTRANT -DGC_NETBSD_THREADS -D_GNU_SOURCE"
                libmono_cflags="-D_REENTRANT"
                LDFLAGS="$LDFLAGS -pthread"
-               CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
+               CPPFLAGS="$CPPFLAGS -DHOST_BSD"
                libmono_ldflags="-pthread"
                need_link_unlink=yes
                libdl="-ldl"
@@ -176,7 +176,7 @@ case "$host" in
                        LDFLAGS="$LDFLAGS $PTHREAD_LIBS -L/usr/local/lib"
                        libmono_ldflags="$PTHREAD_LIBS"
                fi
-               CPPFLAGS="$CPPFLAGS -DPLATFORM_BSD"
+               CPPFLAGS="$CPPFLAGS -DHOST_BSD"
                need_link_unlink=yes
                AC_DEFINE(PTHREAD_POINTER_ID, 1, [pthread is a pointer])
                libdl=
@@ -186,7 +186,7 @@ case "$host" in
                with_sgen_default_concurrent=yes
                ;;
        *-*-*openbsd*)
-               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DPLATFORM_BSD -D_REENTRANT -DUSE_MMAP"
+               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_OPENBSD_THREADS -DHOST_BSD -D_REENTRANT -DUSE_MMAP"
                if test "x$disable_munmap" != "xyes"; then
                CPPFLAGS="$CPPFLAGS -DUSE_MUNMAP"
                fi
@@ -202,7 +202,7 @@ case "$host" in
                ;;
        *-*-linux-android*)
                platform_android=yes
-               AC_DEFINE(PLATFORM_ANDROID,1,[Targeting the Android platform])
+               AC_DEFINE(HOST_ANDROID,1,[Targeting the Android platform])
                AC_DEFINE(TARGET_ANDROID,1,[Targeting the Android platform])
 
                CPPFLAGS="$CPPFLAGS -DGC_LINUX_THREADS -D_GNU_SOURCE -D_REENTRANT -DUSE_MMAP"
@@ -284,7 +284,7 @@ case "$host" in
                use_sigposix=yes
                ;;
        *-*-solaris*)
-               CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DPLATFORM_SOLARIS"
+               CPPFLAGS="$CPPFLAGS -DGC_SOLARIS_THREADS -DGC_SOLARIS_PTHREADS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_MMAP -DUSE_MUNMAP -DHOST_SOLARIS"
                need_link_unlink=yes
                libmono_cflags="-D_REENTRANT"
                libgc_threads=pthreads
@@ -296,7 +296,7 @@ case "$host" in
                parallel_mark="Disabled_Currently_Hangs_On_MacOSX"
                host_darwin=yes
                target_mach=yes
-               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DPLATFORM_MACOSX -DUSE_MMAP -DUSE_MUNMAP"
+               CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE -DGC_MACOSX_THREADS -DUSE_MMAP -DUSE_MUNMAP"
                libmono_cflags="-D_THREAD_SAFE"
                need_link_unlink=yes
                AC_DEFINE(PTHREAD_POINTER_ID)
@@ -364,6 +364,10 @@ if test x$target_win32 = xyes; then
    AC_DEFINE(TARGET_WIN32, 1, [Target Platform is Win32])
 fi
 
+if test x$host_darwin = xyes; then
+   AC_DEFINE(HOST_DARWIN, 1, [Host Platform is Darwin])
+fi
+
 # Defined for all targets/platforms using classic Windows API support.
 AC_DEFINE(HAVE_CLASSIC_WINAPI_SUPPORT, 1, [Use classic Windows API support])
 AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
@@ -371,16 +375,16 @@ AC_DEFINE(HAVE_UWP_WINAPI_SUPPORT, 0, [Don't use UWP Windows API support])
 AC_SUBST(extra_runtime_ldflags)
 AM_CONDITIONAL(HOST_WIN32, test x$host_win32 = xyes)
 AM_CONDITIONAL(TARGET_WIN32, test x$target_win32 = xyes)
-AM_CONDITIONAL(PLATFORM_LINUX, echo x$target_os | grep -q linux)
-AM_CONDITIONAL(PLATFORM_DARWIN, test x$host_darwin = xyes)
-AM_CONDITIONAL(PLATFORM_SIGPOSIX, test x$use_sigposix = xyes)
-AM_CONDITIONAL(PLATFORM_ANDROID, test x$platform_android = xyes)
+AM_CONDITIONAL(HOST_LINUX, echo x$target_os | grep -q linux)
+AM_CONDITIONAL(HOST_DARWIN, test x$host_darwin = xyes)
+AM_CONDITIONAL(HOST_SIGPOSIX, test x$use_sigposix = xyes)
+AM_CONDITIONAL(HOST_ANDROID, test x$platform_android = xyes)
 
-if test -z "$PLATFORM_DARWIN_TRUE"; then :
+if test -z "$HOST_DARWIN_TRUE"; then :
 PLATFORM_AOT_SUFFIX=.dylib
 fi
 
-if test -z "$PLATFORM_LINUX_TRUE"; then :
+if test -z "$HOST_LINUX_TRUE"; then :
 PLATFORM_AOT_SUFFIX=.so
 fi
 
index 3cbab919b940b448ad20511d686465ea2f261fe7..03305b61de01731151772653f01ed98a332076b9 100644 (file)
 #           if defined(__GLIBC__)&& __GLIBC__>=2
 #              define SEARCH_FOR_DATA_START
 #           else /* !GLIBC2 */
-#              if defined(PLATFORM_ANDROID)
+#              if defined(HOST_ANDROID)
 #                      define __environ environ
 #              endif
                extern char **__environ;
 #           include <features.h>
 #           if defined(__GLIBC__) && __GLIBC__ >= 2
 #               define SEARCH_FOR_DATA_START
-#           elif defined(PLATFORM_ANDROID)
+#           elif defined(HOST_ANDROID)
 #               define SEARCH_FOR_DATA_START
 #           else
                 extern char **__environ;
index bcb89b6a1982ab53a0ee338491c61a35997d0ba2..0abbd242a85632e6879d15210142c7b45dadc50e 100644 (file)
@@ -45,7 +45,7 @@ typedef struct GC_Thread_Rep {
                                  /* guaranteed to be dead, but we may  */
                                  /* not yet have registered the join.) */
     pthread_t id;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
     pid_t kernel_id;
 #endif
     /* Extra bookkeeping information the stopping code uses */
index 3bfdfbf35eddc525cb5667d1e6a258babf555ea5..afa77dadfab52b020debb373f370f7b42c32fe21 100644 (file)
@@ -337,7 +337,7 @@ void GC_push_all_stacks()
 pthread_t GC_stopping_thread;
 int GC_stopping_pid;
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 static
 int android_thread_kill(pid_t tid, int sig)
 {
@@ -379,7 +379,7 @@ int GC_suspend_all()
              GC_printf1("Sending suspend signal to 0x%lx\n", p -> id);
            #endif
 
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
         result = pthread_kill(p -> id, SIG_SUSPEND);
 #else
         result = android_thread_kill(p -> kernel_id, SIG_SUSPEND);
@@ -658,7 +658,7 @@ static void pthread_start_world()
              GC_printf1("Sending restart signal to 0x%lx\n", p -> id);
            #endif
 
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
         result = pthread_kill(p -> id, SIG_THR_RESTART);
 #else
         result = android_thread_kill(p -> kernel_id, SIG_THR_RESTART);
index cdca33252758a32a390a64e6fd275cc423071154..097d588a7b55fd77569d2def2b9e80348068085c 100644 (file)
@@ -764,7 +764,7 @@ GC_thread GC_new_thread(pthread_t id)
     }
     if (result == 0) return(0);
     result -> id = id;
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
     result -> kernel_id = gettid();
 #endif
     result -> next = GC_threads[hv];
index 06085362c54484072e624443e2c11b6a9dc573c3..f1e79e317873425230b3eb0ff011313988852317 100644 (file)
@@ -54,7 +54,7 @@ monodis_LDADD =                       \
        $(GLIB_LIBS)                    \
        $(LIBICONV)
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 monodis_LDFLAGS=-framework CoreFoundation -framework Foundation
 endif
 
index 08cf40a763d7e399764231fb3f1bb7e6bd85a25f..87051a6be13320bd7e07a3a71baf14c5427d6c1c 100644 (file)
@@ -55,7 +55,7 @@ AM_CPPFLAGS = -I$(srcdir)
 if HOST_WIN32
 libeglib_la_LIBADD = -lm $(LIBICONV) -lpsapi
 else
-if PLATFORM_ANDROID
+if HOST_ANDROID
 libeglib_la_LIBADD = -llog
 endif
 endif
index 7b1627c0cd27b61955f820f5b20bbdc38e60144d..e785170621ca6ebfc2669c4d9bf2b866ed5c94ff 100644 (file)
@@ -137,7 +137,7 @@ g_assertion_message (const gchar *format, ...)
        exit (0);
 }
 
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
 #include <android/log.h>
 
 static android_LogPriority
index 95867a3e4ca4fe233f645b950b6b8e59fbd8fac8..2fbf826ceece5a6338eadd77b1deb9d5267801e0 100644 (file)
@@ -59,7 +59,7 @@ unix_sources = \
 platform_sources = $(unix_sources)
 endif
 
-if PLATFORM_ANDROID
+if HOST_ANDROID
 platform_sources += ../../support/libm/complex.c
 endif
 
index 35896715ac6ead8cd6b48aa2b7cbff950f2f7832..adfab7def01de117ed63223b45e6b43fd32debd7 100644 (file)
@@ -50,7 +50,7 @@
 #include <sys/stat.h>
 #endif
 
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
 #include <mach-o/dyld.h>
 #endif
 
@@ -840,7 +840,7 @@ set_dirs (char *exe)
 void
 mono_set_rootdir (void)
 {
-#if defined(HOST_WIN32) || (defined(PLATFORM_MACOSX) && !defined(TARGET_ARM))
+#if defined(HOST_WIN32) || (defined(HOST_DARWIN) && !defined(TARGET_ARM))
        gchar *bindir, *installdir, *root, *name, *resolvedname, *config;
 
 #ifdef HOST_WIN32
index e642be65561d391bdbf0bccef417f6394b531c56..03d5147c782ecc2809913aca973126c229b59cac 100644 (file)
@@ -44,7 +44,7 @@
 #define THREAD_LOCAL_ALLOC 1
 #include "private/pthread_support.h"
 
-#if defined(PLATFORM_MACOSX) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
+#if defined(HOST_DARWIN) && defined(HAVE_PTHREAD_GET_STACKADDR_NP)
 void *pthread_get_stackaddr_np(pthread_t);
 #endif
 
@@ -179,7 +179,7 @@ mono_gc_base_init (void)
        default_push_other_roots = GC_push_other_roots;
        GC_push_other_roots = mono_push_other_roots;
 
-#if !defined(PLATFORM_ANDROID)
+#if !defined(HOST_ANDROID)
        /* If GC_no_dls is set to true, GC_find_limit is not called. This causes a seg fault on Android. */
        GC_no_dls = TRUE;
 #endif
index 2cc591e8c8c7d361548c07e02d52aa0763e43e36..ecd050a26e0469e29f4d71f42dce3c75fe5bdc7f 100644 (file)
@@ -447,7 +447,7 @@ HANDLES(ICALL(NDNS_1, "GetHostByAddr_internal(string,string&,string[]&,string[]&
 HANDLES(ICALL(NDNS_2, "GetHostByName_internal(string,string&,string[]&,string[]&,int)", ves_icall_System_Net_Dns_GetHostByName_internal))
 HANDLES(ICALL(NDNS_3, "GetHostName_internal(string&)", ves_icall_System_Net_Dns_GetHostName_internal))
 
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
 ICALL_TYPE(MAC_IFACE_PROPS, "System.Net.NetworkInformation.MacOsIPInterfaceProperties", MAC_IFACE_PROPS_1)
 ICALL(MAC_IFACE_PROPS_1, "ParseRouteInfo_internal", ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal)
 #endif
index 61a6f94146588d2f175fdc83e83e760e0ea9c805..bf35693b83b1990042ce89f93337fcc2f79b4325 100644 (file)
@@ -1143,7 +1143,7 @@ static MonoDl *internal_module;
 static gboolean
 is_absolute_path (const char *path)
 {
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
        if (!strncmp (path, "@executable_path/", 17) || !strncmp (path, "@loader_path/", 13) ||
            !strncmp (path, "@rpath/", 7))
            return TRUE;
index 119da77be3d79ea710a4b18889cf41eabe3d1dec..c4c81eaf32c8995a477773a8b60397189d5cf4d1 100644 (file)
@@ -36,11 +36,11 @@ dump_arch (void)
 static int
 dump_os (void)
 {
-#if defined (PLATFORM_WIN32)
+#if defined (HOST_WIN32)
        g_print ("#ifdef TARGET_WIN32\n");
-#elif defined (PLATFORM_ANDROID)
+#elif defined (HOST_ANDROID)
        g_print ("#ifdef TARGET_ANDROID\n");
-#elif defined (PLATFORM_MACOSX)
+#elif defined (HOST_DARWIN)
        g_print ("#ifdef TARGET_OSX\n");
 #elif defined (PLATFORM_IOS)
        g_print ("#ifdef TARGET_IOS\n");
index a35bd562743f5c334749fb692aaba4a99d149e64..c90af3cdfe33b8b89d1ce23f65a14e42046ff636 100644 (file)
@@ -7,9 +7,9 @@
  *   Ben Woods (woodsb02@gmail.com)
  */
 
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
-
 #include <config.h>
+
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
 #include <sys/socket.h>
 #include <net/if.h>
 #include <net/if_dl.h>
@@ -134,4 +134,4 @@ in_addr_t gateway_from_rtm(struct rt_msghdr *rtm)
        return 0;
 }
 
-#endif /* #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD) */
+#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */
index 5086fbd3ef05f2d31dbd450cf44a2014ca016e77..03d179d71c6874255c6ee9a1f64976f4089af9d2 100644 (file)
@@ -5,7 +5,7 @@
 #ifndef __MONO_ROUTE_H__
 #define __MONO_ROUTE_H__
 
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
 
 #include <sys/socket.h>
 
@@ -23,5 +23,5 @@ in_addr_t gateway_from_rtm (struct rt_msghdr *rtm);
 /* Category icalls */
 extern MonoBoolean ves_icall_System_Net_NetworkInformation_MacOsIPInterfaceProperties_ParseRouteInfo_internal (MonoString *iface, MonoArray **gw_addr_list);
 
-#endif /* #if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD) */
+#endif /* #if defined(HOST_DARWIN) || defined(HOST_BSD) */
 #endif /* __MONO_ROUTE_H__ */
index 87256b511873d728e0124cb92180551a3b3dc15b..724bfe81ff8d02caf3d171647a063baf7d2f3821 100644 (file)
@@ -286,7 +286,7 @@ mono_threadpool_worker_init (MonoThreadPoolWorkerCallback callback)
 
        worker.limit_worker_min = threads_count;
 
-#if defined (PLATFORM_ANDROID) || defined (HOST_IOS)
+#if defined (HOST_ANDROID) || defined (HOST_IOS)
        worker.limit_worker_max = CLAMP (threads_count * 100, MIN (threads_count, 200), MAX (threads_count, 200));
 #else
        worker.limit_worker_max = threads_count * 100;
index 97efd32c1cdac04e48296a738ee74cf9a8098346..120bd1a9458f7e94c26dedf9f03e4dd2b24a9ddf 100644 (file)
 #include <objbase.h>
 #endif
 
-#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
+#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
 #define USE_TKILL_ON_ANDROID 1
 #endif
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 #include <errno.h>
 
 #ifdef USE_TKILL_ON_ANDROID
index a3ac2264f6da7addaebd76807e466a43745ce499..65547135b3b11adacd09a7ed750c426e93d78f43 100644 (file)
@@ -1195,7 +1195,7 @@ static guint32 file_seek(FileHandle *filehandle, gint32 movedistance,
 
        mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_IO_LAYER, "%s: moving fd %d by %" G_GINT64_FORMAT " bytes from %d", __func__, ((MonoFDHandle*) filehandle)->fd, offset, whence);
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        /* bionic doesn't support -D_FILE_OFFSET_BITS=64 */
        MONO_ENTER_GC_SAFE;
        newpos=lseek64(((MonoFDHandle*) filehandle)->fd, offset, whence);
@@ -4245,7 +4245,7 @@ typedef struct {
 } _wapi_drive_type;
 
 static _wapi_drive_type _wapi_drive_types[] = {
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
        { DRIVE_REMOTE, "afp" },
        { DRIVE_REMOTE, "autofs" },
        { DRIVE_CDROM, "cddafs" },
@@ -4402,7 +4402,7 @@ static guint32 _wapi_get_drive_type(const gchar* fstype)
 }
 #endif
 
-#if defined (PLATFORM_MACOSX) || defined (__linux__)
+#if defined (HOST_DARWIN) || defined (__linux__)
 static guint32
 GetDriveTypeFromPath (const gchar *utf8_root_path_name)
 {
@@ -4414,7 +4414,7 @@ GetDriveTypeFromPath (const gchar *utf8_root_path_name)
        MONO_EXIT_GC_SAFE;
        if (res == -1)
                return DRIVE_UNKNOWN;
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
        return _wapi_get_drive_type (buf.f_fstypename);
 #else
        return _wapi_get_drive_type (buf.f_type);
@@ -4507,11 +4507,11 @@ mono_w32file_get_drive_type(const gunichar2 *root_path_name)
        return (drive_type);
 }
 
-#if defined (PLATFORM_MACOSX) || defined (__linux__) || defined(PLATFORM_BSD) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
+#if defined (HOST_DARWIN) || defined (__linux__) || defined(HOST_BSD) || defined(__FreeBSD_kernel__) || defined(__HAIKU__)
 static gchar*
 get_fstypename (gchar *utfpath)
 {
-#if defined (PLATFORM_MACOSX) || defined (__linux__)
+#if defined (HOST_DARWIN) || defined (__linux__)
        struct statfs stat;
 #if __linux__
        _wapi_drive_type *current;
@@ -4522,7 +4522,7 @@ get_fstypename (gchar *utfpath)
        MONO_EXIT_GC_SAFE;
        if (statfs_res == -1)
                return NULL;
-#if PLATFORM_MACOSX
+#if HOST_DARWIN
        return g_strdup (stat.f_fstypename);
 #else
        current = &_wapi_drive_types[0];
index 3bc10906b8cf008b7dfeac476ec147708730d5e7..91e1d218ad5dc60905cc1442759788ed2713e30d 100644 (file)
@@ -9,7 +9,7 @@
 
 #include <unistd.h>
 
-#ifdef PLATFORM_SOLARIS
+#ifdef HOST_SOLARIS
 /* procfs.h cannot be included if this define is set, but it seems to work fine if it is undefined */
 #if _FILE_OFFSET_BITS == 64
 #undef _FILE_OFFSET_BITS
@@ -41,7 +41,7 @@ mono_w32process_get_name (pid_t pid)
        gchar buf[256];
        gchar *ret = NULL;
 
-#if defined(PLATFORM_SOLARIS)
+#if defined(HOST_SOLARIS)
        filename = g_strdup_printf ("/proc/%d/psinfo", pid);
        if ((fp = fopen (filename, "r")) != NULL) {
                struct psinfo info;
index 5db6bd49446d42a422be8c427b0ee3068c07eb0f..ecab6c5ae125393c9c41171672fe3ffe64df1cce 100644 (file)
@@ -12,7 +12,7 @@
  * FOR EXCLUSIVE USE BY w32process-unix.c
  */
 
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
 #define USE_OSX_BACKEND
 #elif (defined(__OpenBSD__) || defined(__FreeBSD__)) && defined(HAVE_LINK_H)
 #define USE_BSD_BACKEND
index 280c3a9213d0a90fd528961ca4c14d878eba7d76..8a55844b6e08884068d95bb62ce3a0037eed9578 100644 (file)
@@ -544,7 +544,7 @@ process_is_alive (pid_t pid)
 {
 #if defined(HOST_WATCHOS)
        return TRUE; // TODO: Rewrite using sysctl
-#elif defined(PLATFORM_MACOSX) || defined(__OpenBSD__) || defined(__FreeBSD__)
+#elif defined(HOST_DARWIN) || defined(__OpenBSD__) || defined(__FreeBSD__)
        if (pid == 0)
                return FALSE;
        if (kill (pid, 0) == 0)
@@ -2105,7 +2105,7 @@ ves_icall_System_Diagnostics_Process_ShellExecuteEx_internal (MonoW32ProcessStar
                        goto done;
                }
 
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
                handler = g_strdup ("/usr/bin/open");
 #else
                /*
index bc1b5ccd818d44f09bfa459f94156f2aaaae2b22..74e1fcceab52e3ea2d17a1eb0bdee60f2d4c98fc 100644 (file)
@@ -1373,7 +1373,7 @@ mono_w32socket_get_available (SOCKET sock, guint64 *amount)
                return SOCKET_ERROR;
        }
 
-#if defined (PLATFORM_MACOSX)
+#if defined (HOST_DARWIN)
        // ioctl (socket, FIONREAD, XXX) returns the size of
        // the UDP header as well on Darwin.
        //
index 848f75d3fe1544ed2dedbd459355d7c30a563280..e33441b6d35a4218910e493ff5375292217e37b7 100755 (executable)
@@ -87,7 +87,7 @@ monobinldflags=$(export_ldflags) $(extra_runtime_ldflags)
 if HOST_WIN32
 libmonoldflags=-no-undefined -avoid-version -Wl,--kill-at $(monoldflags)
 else
-if PLATFORM_ANDROID
+if HOST_ANDROID
 libmonoldflags= -avoid-version $(monoldflags)
 else
 libmonoldflags=$(monoldflags) -version-info 1:0:0
@@ -168,7 +168,7 @@ if LOADED_LLVM
 lib_LTLIBRARIES += libmono-llvm.la
 libmono_llvm_la_SOURCES = mini-llvm.c mini-llvm-cpp.cpp llvm-jit.cpp
 libmono_llvm_la_LIBADD = $(GLIB_LIBS) $(LLVM_LIBS) $(LLVM_LDFLAGS)
-if PLATFORM_DARWIN
+if HOST_DARWIN
 libmono_llvm_la_LDFLAGS=-Wl,-undefined -Wl,suppress -Wl,-flat_namespace
 else
 libmono_llvm_la_LIBADD += $(top_builddir)/mono/mini/libmonoboehm-$(API_VER).la $(boehm_libs)
@@ -609,12 +609,12 @@ os_sources = $(windows_sources)
 monobin_platform_ldflags=
 endif
 
-if PLATFORM_SIGPOSIX
+if HOST_SIGPOSIX
 os_sources = $(posix_sources)
 monobin_platform_ldflags=
 endif
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 os_sources = $(darwin_sources) $(posix_sources)
 #monobin_platform_ldflags=-sectcreate __TEXT __info_plist $(top_srcdir)/mono/mini/Info.plist -framework CoreFoundation -framework Foundation
 monobin_platform_ldflags=-framework CoreFoundation -framework Foundation
index 01c2fe883933e8922c563f7ba899d0e22c4de338..d6c2486414f3278b960ec7480d50137ea27e7cee 100644 (file)
@@ -5800,7 +5800,7 @@ mono_aot_is_pagefault (void *ptr)
 void
 mono_aot_handle_pagefault (void *ptr)
 {
-#ifndef PLATFORM_WIN32
+#ifndef HOST_WIN32
        guint8* start = (guint8*)ROUND_DOWN (((gssize)ptr), mono_pagesize ());
        int res;
 
index b625580c1fe4c347fedcc46b41f7473db085cc88..016423072bd74048996f6c85363e28b6c52d90d7 100644 (file)
@@ -47,7 +47,7 @@
 #include <ws2tcpip.h>
 #endif
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 #include <linux/in.h>
 #include <linux/tcp.h>
 #include <sys/endian.h>
@@ -607,7 +607,7 @@ typedef struct ReplyPacket {
 
 #define DEBUG(level,s) do { if (G_UNLIKELY ((level) <= log_level)) { s; fflush (log_file); } } while (0)
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 #define DEBUG_PRINTF(level, ...) do { if (G_UNLIKELY ((level) <= log_level)) { g_print (__VA_ARGS__); } } while (0)
 #else
 #define DEBUG_PRINTF(level, ...) do { if (G_UNLIKELY ((level) <= log_level)) { fprintf (log_file, __VA_ARGS__); fflush (log_file); } } while (0)
@@ -5941,7 +5941,7 @@ mono_debugger_agent_debug_log_is_enabled (void)
        return agent_config.enabled;
 }
 
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
 void
 mono_debugger_agent_unhandled_exception (MonoException *exc)
 {
index 41fe82ea98ede8d2e3cca7dae2d7163358c875b4..3267f82740e77dc4428855ec8a8d75b64e978e78 100644 (file)
@@ -28,7 +28,7 @@ debugger_agent_breakpoint_from_context (MonoContext *ctx);
 void
 mono_debugger_agent_free_domain_info (MonoDomain *domain);
 
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
 void
 mono_debugger_agent_unhandled_exception (MonoException *exc);
 #endif
index dac83f0bb43552682bc79bb91749fc6bc39f3940..de769c87fff8d41d8af7e149f6173e65d1568f8a 100644 (file)
@@ -15,9 +15,9 @@
 #include <string.h>
 
 #ifndef MONO_CROSS_COMPILE
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 #include <asm/sigcontext.h>
-#endif  /* def PLATFORM_ANDROID */
+#endif  /* def HOST_ANDROID */
 #endif
 
 #ifdef HAVE_UCONTEXT_H
index 98bc4bf7ee5483d0c8cb6b25075ec150b3031e92..1f6b67f26fef0ad181435383e4e2127b56bb3161 100644 (file)
@@ -335,7 +335,7 @@ mono_arm_patchable_bl (guint8 *code, int cond)
        return code;
 }
 
-#if defined(__ARM_EABI__) && defined(__linux__) && !defined(PLATFORM_ANDROID) && !defined(MONO_CROSS_COMPILE)
+#if defined(__ARM_EABI__) && defined(__linux__) && !defined(HOST_ANDROID) && !defined(MONO_CROSS_COMPILE)
 #define HAVE_AEABI_READ_TP 1
 #endif
 
index 4f81d7c4c37c42793c25b489ae438325e5c68dd7..ad70319d7440f0646d323d62b9282caa26b4379d 100644 (file)
@@ -2709,12 +2709,12 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
                 * glibc fork acquires some locks, so if the crash happened inside malloc/free,
                 * it will deadlock. Call the syscall directly instead.
                 */
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
                /* SYS_fork is defined to be __NR_fork which is not defined in some ndk versions */
                g_assert_not_reached ();
-#elif !defined(PLATFORM_MACOSX) && defined(SYS_fork)
+#elif !defined(HOST_DARWIN) && defined(SYS_fork)
                pid = (pid_t) syscall (SYS_fork);
-#elif defined(PLATFORM_MACOSX) && HAVE_FORK
+#elif defined(HOST_DARWIN) && HAVE_FORK
                pid = (pid_t) fork ();
 #else
                g_assert_not_reached ();
@@ -2742,7 +2742,7 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
 #endif
  }
 #else
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        /* set DUMPABLE for this process so debuggerd can attach with ptrace(2), see:
         * https://android.googlesource.com/platform/bionic/+/151da681000c07da3c24cd30a3279b1ca017f452/linker/debugger.cpp#206
         * this has changed on later versions of Android.  Also, we don't want to
@@ -2782,7 +2782,7 @@ mono_handle_native_crash (const char *signal, void *ctx, MONO_SIG_HANDLER_INFO_T
 
        if (!mono_do_crash_chaining) {
                /*Android abort is a fluke, it doesn't abort, it triggers another segv. */
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
                exit (-1);
 #else
                abort ();
@@ -2845,7 +2845,7 @@ mono_print_thread_dump_internal (void *sigctx, MonoContext *start_ctx)
 
        mono_runtime_printf ("%s", text->str);
 
-#if PLATFORM_WIN32 && TARGET_WIN32 && _DEBUG
+#if HOST_WIN32 && TARGET_WIN32 && _DEBUG
        OutputDebugStringA(text->str);
 #endif
 
index 9943d883966e1b74b6be10e1b515c3fbe945e0ba..243c83cbe5d9cbbbe8e902d1d27ab72a043269e4 100644 (file)
@@ -390,7 +390,7 @@ info_has_identity (MonoRgctxInfoType info_type)
 /*
  * LOCKING: loader lock
  */
-#if defined(PLATFORM_ANDROID) && defined(TARGET_ARM)
+#if defined(HOST_ANDROID) && defined(TARGET_ARM)
 /* work around for HW bug on Nexus9 when running on armv7 */
 #ifdef __clang__
 static __attribute__ ((optnone)) void
index 8b17287a21a5aa0bd48fc9828176dda9ec1b255b..331b7ca3c02bff600ca6b3d5ae8e517824bf28c1 100644 (file)
@@ -68,7 +68,7 @@
 
 #include "jit-icalls.h"
 
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
 #include <mach/mach.h>
 #include <mach/mach_time.h>
 #include <mach/clock.h>
@@ -95,7 +95,7 @@ MONO_SIG_HANDLER_SIGNATURE (mono_chain_signal)
        return FALSE;
 }
 
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
 void
 mono_runtime_install_handlers (void)
 {
@@ -302,7 +302,7 @@ add_signal_handler (int signo, gpointer handler, int flags)
 #ifdef MONO_ARCH_SIGSEGV_ON_ALTSTACK
 
 /*Apple likes to deliver SIGBUS for *0 */
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
        if (signo == SIGSEGV || signo == SIGBUS) {
 #else
        if (signo == SIGSEGV) {
@@ -396,7 +396,7 @@ mono_runtime_posix_install_handlers (void)
        add_signal_handler (SIGSEGV, mono_sigsegv_signal_handler, 0);
 }
 
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
 void
 mono_runtime_install_handlers (void)
 {
@@ -428,7 +428,7 @@ mono_runtime_cleanup_handlers (void)
 
 static volatile gint32 sampling_thread_running;
 
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
 
 static clock_serv_t sampling_clock_service;
 
@@ -699,7 +699,7 @@ mono_runtime_shutdown_stat_profiler (void)
 
        mono_profiler_sampling_thread_post ();
 
-#ifndef PLATFORM_MACOSX
+#ifndef HOST_DARWIN
        /*
         * There is a slight problem when we're using CLOCK_PROCESS_CPUTIME_ID: If
         * we're shutting down and there's largely no activity in the process other
@@ -755,7 +755,7 @@ mono_runtime_setup_stat_profiler (void)
         * get us a 100% sampling rate. However, this may interfere with the GC's
         * STW logic. Could perhaps be solved by taking the suspend lock.
         */
-#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (PLATFORM_ANDROID)
+#if defined (USE_POSIX_BACKEND) && defined (SIGRTMIN) && !defined (HOST_ANDROID)
        /* Just take the first real-time signal we can get. */
        profiler_signal = mono_threads_suspend_search_alternative_signal ();
 #else
@@ -855,7 +855,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid)
 
        memset (argv, 0, sizeof (char*) * 10);
 
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
        if (native_stack_with_lldb (crashed_pid, argv, commands, commands_filename))
                goto exec;
 #endif
@@ -863,7 +863,7 @@ mono_gdb_render_native_backtraces (pid_t crashed_pid)
        if (native_stack_with_gdb (crashed_pid, argv, commands, commands_filename))
                goto exec;
 
-#if !defined(PLATFORM_MACOSX)
+#if !defined(HOST_DARWIN)
        if (native_stack_with_lldb (crashed_pid, argv, commands, commands_filename))
                goto exec;
 #endif
index b839e49f09637e9d1314e10c13815ced0435d885..8f0f7dd5395b6471f9fec9ef9df7fdc9d688a124 100644 (file)
@@ -4045,7 +4045,7 @@ register_icalls (void)
        mono_add_internal_call ("Mono.Runtime::mono_runtime_cleanup_handlers",
                                mono_runtime_cleanup_handlers);
 
-#if defined(PLATFORM_ANDROID) || defined(TARGET_ANDROID)
+#if defined(HOST_ANDROID) || defined(TARGET_ANDROID)
        mono_add_internal_call ("System.Diagnostics.Debugger::Mono_UnhandledException_internal",
                                mono_debugger_agent_unhandled_exception);
 #endif
index 5e6e718486f8b7c29b519017b2acf237b41b8e58..ee3c3754ae28921d193ee88b106e5aac99f1447d 100644 (file)
@@ -3163,7 +3163,7 @@ mini_method_compile (MonoMethod *method, guint32 opts, MonoDomain *domain, JitFl
        cfg->llvm_only = (flags & JIT_FLAG_LLVM_ONLY) != 0;
        cfg->backend = current_backend;
 
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        if (cfg->method->wrapper_type != MONO_WRAPPER_NONE) {
                /* FIXME: Why is this needed */
                cfg->gen_seq_points = FALSE;
index 7ce873a38ce7b6bdb0f42d9830c4329fa4d4f844..d15e9ec7164d463be1523a2952495f9caf1d8c7c 100644 (file)
 #define mono_simd_shuffle_mask(a,b,c,d) ((a) | ((b) << 2) | ((c) << 4) | ((d) << 6))
 
 /* Remap printf to g_print (we use a mix of these in the mini code) */
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
 #define printf g_print
 #endif
 
index e5e36100f09575d94edbd0d24c29028a82ba949d..0e50ae550707597de0aee029b8dc9cdda3829405 100644 (file)
@@ -26,7 +26,7 @@
 #include <mono/utils/mono-memory-model.h>
 #include "trace.h"
 
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
 #  undef printf
 #  define printf(...) g_log("mono", G_LOG_LEVEL_MESSAGE, __VA_ARGS__)
 #  undef fprintf
index f96c8a3fcccfba10337d1c2c3597139df56c46c5..88cd9d37a1a2851aa5944c04a5feb265f5651767 100644 (file)
@@ -30,7 +30,7 @@ lib_LTLIBRARIES = \
 suppressiondir = $(datadir)/mono-$(API_VER)/mono/profiler
 suppression_DATA = mono-profiler-log.suppression
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 if BITCODE
 prof_ldflags = -no-undefined
 else
@@ -44,7 +44,7 @@ else
 libmono_dep = $(monodir)/mono/mini/$(LIBMONO_LA)
 endif
 
-if PLATFORM_ANDROID
+if HOST_ANDROID
 prof_ldflags = -avoid-version
 endif
 
index 35e1195dbfbbfc27c96546a05684c22ad1b6fa3e..5f4185d4df70ec4f48a692aae3edfc46cfd3396b 100644 (file)
@@ -1220,7 +1220,7 @@ major_get_and_reset_num_major_objects_marked (void)
 #endif
 
 /* gcc 4.2.1 from xcode4 crashes on sgen_card_table_get_card_address () when this is enabled */
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
 #if MONO_GNUC_VERSION <= 40300
 #undef PREFETCH_CARDS
 #endif
index e93fb7de81fe72e9473bece369a46c8fbe661770..aeec29b075f9b9c90070489bf9acf68033f4ed2f 100755 (executable)
@@ -1139,10 +1139,10 @@ tests: compile-tests
 #
 # Test that no symbols are missed in eglib-remap.h
 #
-if PLATFORM_LINUX
+if HOST_LINUX
 test-platform: test-eglib-remap
 else
-if PLATFORM_DARWIN
+if HOST_DARWIN
 test-platform: test-eglib-remap
 endif
 endif
index ec04c4d1c5f17f5df5dab43b834893dc048783f1..82eb31b21571823d17a3214ab19f413f590f2d49 100644 (file)
@@ -3,7 +3,7 @@ AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CPPFLAGS) $(GLIB_CFLA
 test_cflags = $(AM_CFLAGS) $(SGEN_DEFINES)
 test_ldadd = libtestlib.la \
        $(LIBGC_LIBS) $(GLIB_LIBS) -lm $(LIBICONV)
-if PLATFORM_DARWIN
+if HOST_DARWIN
 test_ldflags = -framework CoreFoundation -framework Foundation
 endif
 
index 746c84fb5131455564551cf4186402cbf41820f0..3e1b4108b4e2a3c9e27df66843593c7fdea0aff4 100644 (file)
@@ -74,7 +74,7 @@ typedef SSIZE_T ssize_t;
 #define MONO_EMPTY_SOURCE_FILE(x)
 #endif
 
-#if !defined(_MSC_VER) && !defined(PLATFORM_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
+#if !defined(_MSC_VER) && !defined(HOST_SOLARIS) && !defined(_WIN32) && !defined(__CYGWIN__) && !defined(MONOTOUCH) && HAVE_VISIBILITY_HIDDEN
 #if MONO_LLVM_LOADED
 #define MONO_LLVM_INTERNAL MONO_API
 #else
index 0ade0d5414931c3bab348ef107cff8d3416fd3e2..c2b2b96d9d7419c0eea9d9400a84da27323b6d7a 100644 (file)
@@ -61,7 +61,7 @@ mono_dl_get_system_dir (void)
 void *
 mono_dl_open_file (const char *file, int flags)
 {
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        /* Bionic doesn't support NULL filenames */
        if (!file)
                return NULL;
index 4ab9cd7b05ecb8898fe3738ac3e21cf940e13049..a44f43ac9e74392c9b207f3a9def06d6ab40ee87 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "mono/utils/mono-hwcap.h"
 
-#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#if defined(HAVE_SYS_AUXV_H) && !defined(HOST_ANDROID)
 #include <sys/auxv.h>
 #elif defined(__APPLE__)
 #include <mach/machine.h>
@@ -38,7 +38,7 @@
 void
 mono_hwcap_arch_init (void)
 {
-#if defined(HAVE_SYS_AUXV_H) && !defined(PLATFORM_ANDROID)
+#if defined(HAVE_SYS_AUXV_H) && !defined(HOST_ANDROID)
        unsigned long hwcap;
        unsigned long platform;
 
index 1072788a6f5165885bbb8d15ec265449325cbbde..fba61f760776ab8c4b173410cbe9459aaff2cb10 100644 (file)
@@ -10,7 +10,7 @@
  */
 #include <config.h>
 
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
 
 #include <android/log.h>
 #include "mono-logger-internals.h"
index e28b3f361035b0c13167140acc67cad724d3da60..4a83afd5228feebe46deafcc847a97dd234a5de6 100644 (file)
@@ -134,7 +134,7 @@ mono_trace_message(MonoTraceMask mask, const char *format, ...)
 
 #endif /* !__GNUC__ */
 
-#if defined (PLATFORM_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
+#if defined (HOST_ANDROID) || (defined (TARGET_IOS) && defined (TARGET_IOS))
 
 #define mono_gc_printf(gc_log_file, format, ...) g_log ("mono-gc", G_LOG_LEVEL_MESSAGE, format, ##__VA_ARGS__)
 #define mono_runtime_printf(format, ...) g_log ("mono-rt", G_LOG_LEVEL_MESSAGE, format "\n", ##__VA_ARGS__)
@@ -184,7 +184,7 @@ void mono_log_open_logfile (const char *, void *);
 void mono_log_write_logfile (const char *, GLogLevelFlags, mono_bool, const char *);
 void mono_log_close_logfile (void);
 
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
 void mono_log_open_logcat (const char *path, void *userData);
 void mono_log_write_logcat (const char *log_domain, GLogLevelFlags level, mono_bool hdr, const char *message);
 void mono_log_close_logcat (void);
index aeaa3f97ceefab0bc79fe685d042ade9a91d5368..d8d9e82ee44a2cb30bd060af3a51372a50001814 100644 (file)
@@ -154,7 +154,7 @@ mono_trace_set_logdest_string (const char *dest)
        if(level_stack == NULL)
                mono_trace_init();
 
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
        logger.opener = mono_log_open_logcat;
        logger.writer = mono_log_write_logcat;
        logger.closer = mono_log_close_logcat;
index be1f64858863ba930c0340e6bfe44201e24b659f..eb7c4bb5b15377205e5b6e35705959d1b636ee66 100644 (file)
@@ -41,7 +41,7 @@ G_BEGIN_DECLS
 
 #if !defined(HOST_WIN32)
 
-#if !defined(CLOCK_MONOTONIC) || defined(PLATFORM_MACOSX) || defined(PLATFORM_ANDROID)
+#if !defined(CLOCK_MONOTONIC) || defined(HOST_DARWIN) || defined(HOST_ANDROID)
 #define BROKEN_CLOCK_SOURCE
 #endif
 
index e93eb7e53f0192a0249eae1d06a0ce1cf39a03fa..d0dd89b4c0da0525f0c71633119322b7bee8c7c6 100644 (file)
@@ -108,7 +108,7 @@ mono_path_canonicalize (const char *path)
  * This ensures that the path that we store points to the final file
  * not a path to a symlink.
  */
-#if !defined(PLATFORM_NO_SYMLINKS)
+#if !defined(HOST_NO_SYMLINKS)
 static gchar *
 resolve_symlink (const char *path)
 {
@@ -147,7 +147,7 @@ resolve_symlink (const char *path)
 gchar *
 mono_path_resolve_symlinks (const char *path)
 {
-#if defined(PLATFORM_NO_SYMLINKS)
+#if defined(HOST_NO_SYMLINKS)
        return mono_path_canonicalize (path);
 #else
        gchar **split = g_strsplit (path, G_DIR_SEPARATOR_S, -1);
index 5c5b891d607ab952d55bc3699d857566c6ce9c64..714d9eb7a245af19256c06d7629aa8be6609c950 100644 (file)
@@ -682,7 +682,7 @@ mono_process_current_pid ()
 int
 mono_cpu_count (void)
 {
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        /* Android tries really hard to save power by powering off CPUs on SMP phones which
         * means the normal way to query cpu count returns a wrong value with userspace API.
         * Instead we use /sys entries to query the actual hardware CPU count.
@@ -750,7 +750,7 @@ mono_cpu_count (void)
  * * use sched_getaffinity (+ fallback to _SC_NPROCESSORS_ONLN in case of error) on x86. This
  * ensures we're inline with what OpenJDK [4] and CoreCLR [5] do
  * * use _SC_NPROCESSORS_CONF exclusively on ARM (I think we could eventually even get rid of
- * the PLATFORM_ANDROID special case)
+ * the HOST_ANDROID special case)
  *
  * Helpful links:
  *
@@ -891,7 +891,7 @@ mono_cpu_get_data (int cpu_id, MonoCpuData data, MonoProcessError *error)
 int
 mono_atexit (void (*func)(void))
 {
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        /* Some versions of android libc doesn't define atexit () */
        return 0;
 #else
index c067ce22512786dd24cfea7715080b2355f48063..479b8d4bf012b35782f41bfaa79fe8e74f0cc682 100644 (file)
@@ -6,7 +6,7 @@
 #define __MONO_MONO_SIGCONTEXT_H__
 
 #include <config.h>
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
 #include <asm/sigcontext.h>
 #endif
 
@@ -89,7 +89,7 @@
        #define UCONTEXT_REG_ESI(ctx) (((ucontext_t*)(ctx))->sc_esi)
        #define UCONTEXT_REG_EDI(ctx) (((ucontext_t*)(ctx))->sc_edi)
        #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->sc_eip)
-#elif defined(PLATFORM_SOLARIS)
+#elif defined(HOST_SOLARIS)
        #define UCONTEXT_REG_EAX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EAX])
        #define UCONTEXT_REG_EBX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EBX])
        #define UCONTEXT_REG_ECX(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [ECX])
        #define UCONTEXT_REG_EIP(ctx) (((ucontext_t*)(ctx))->uc_mcontext.gregs [EIP])
 #else
 
-#if defined(PLATFORM_ANDROID) && !defined(HAVE_UCONTEXT_H)
+#if defined(HOST_ANDROID) && !defined(HAVE_UCONTEXT_H)
 /* No ucontext.h as of NDK v6b */
 typedef int greg_t;
 #define NGREG 19
index c8c17a3d3cfc1cda13b0f7a25ce4d47340d2f14a..dd4307bca372d4e3158be6626852bf47395a802d 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <config.h>
 
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
 
 #include <pthread.h>
 #include <stdio.h>
index d757cd66c318ec6e87a072d2597e2606909d8c3c..e73b86084fc2b9830eb8775db3ee65f5fce376af 100644 (file)
@@ -4,7 +4,7 @@
 
 #include <config.h>
 
-#if (defined(__linux__) && !defined(PLATFORM_ANDROID)) || defined(__FreeBSD_kernel__)
+#if (defined(__linux__) && !defined(HOST_ANDROID)) || defined(__FreeBSD_kernel__)
 
 #include <mono/utils/mono-threads.h>
 #include <pthread.h>
index 289bd98cd66e2faa8c61063213ce5aba2de7d38e..5f762c83abe784c9b66e1457287e3e34ea1a2ac1 100644 (file)
@@ -62,7 +62,7 @@ signal_add_handler (int signo, void (*handler)(int, siginfo_t *, void *), int fl
 static int
 abort_signal_get (void)
 {
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
        return SIGTTIN;
 #elif defined (SIGRTMIN)
        static int abort_signum = -1;
@@ -79,7 +79,7 @@ abort_signal_get (void)
 static int
 suspend_signal_get (void)
 {
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
        return SIGPWR;
 #elif defined (SIGRTMIN)
        static int suspend_signum = -1;
@@ -98,7 +98,7 @@ suspend_signal_get (void)
 static int
 restart_signal_get (void)
 {
-#if defined(PLATFORM_ANDROID)
+#if defined(HOST_ANDROID)
        return SIGXCPU;
 #elif defined (SIGRTMIN)
        static int restart_signum = -1;
@@ -244,7 +244,7 @@ mono_threads_suspend_init_signals (void)
        On 32bits arm Android, signals with values >=32 are not usable as their headers ship a broken sigset_t.
        See 5005c6f3fbc1da584c6a550281689cc23f59fe6d for more details.
        */
-#ifdef PLATFORM_ANDROID
+#ifdef HOST_ANDROID
        g_assert (suspend_signal_num < 32);
        g_assert (restart_signal_num < 32);
        g_assert (abort_signal_num < 32);
index 138cc9e4b6aebd411ea1e0f75b88ce42b1cb5176..22fcb674add26a94d235726f21a0a701afb40bc8 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <errno.h>
 
-#if defined(PLATFORM_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
+#if defined(HOST_ANDROID) && !defined(TARGET_ARM64) && !defined(TARGET_AMD64)
 #define USE_TKILL_ON_ANDROID 1
 #endif
 
@@ -295,7 +295,7 @@ mono_threads_suspend_abort_syscall (MonoThreadInfo *info)
 void
 mono_threads_suspend_register (MonoThreadInfo *info)
 {
-#if defined (PLATFORM_ANDROID)
+#if defined (HOST_ANDROID)
        info->native_handle = gettid ();
 #endif
 }
index e26ca1760c6fb49214c735925a064146b8005ec7..9ba005e01b5bd26800a8e5d16c9d7ababe8eeb43 100644 (file)
@@ -1313,7 +1313,7 @@ mono_thread_info_sleep (guint32 ms, gboolean *alerted)
                } while (1);
        } else {
                int ret;
-#if defined (__linux__) && !defined(PLATFORM_ANDROID)
+#if defined (__linux__) && !defined(HOST_ANDROID)
                struct timespec start, target;
 
                /* Use clock_nanosleep () to prevent time drifting problems when nanosleep () is interrupted by signals */
index ddca2c9ebb80d732c5697fdc97f2fa6858ddcdee..4a3b2705563e98068832db9c688e5267af79f0d6 100644 (file)
@@ -84,7 +84,7 @@ mono_100ns_datetime (void)
 #include <sys/sysctl.h>
 #endif
 
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
 #include <mach/mach.h>
 #include <mach/mach_time.h>
 #endif
@@ -143,7 +143,7 @@ gint64
 mono_100ns_ticks (void)
 {
        struct timeval tv;
-#if defined(PLATFORM_MACOSX)
+#if defined(HOST_DARWIN)
        /* http://developer.apple.com/library/mac/#qa/qa1398/_index.html */
        static mach_timebase_info_data_t timebase;
        guint64 now = mach_absolute_time ();
index b066d462b167c0a3121486d462612e3e050fb171..76b4b388e9862170e2647ed127d1bf71017f1fbd 100644 (file)
@@ -86,7 +86,7 @@ Mono_Posix_Syscall_strerror_r (int errnum, char *buf, mph_size_t n)
        mph_return_if_size_t_overflow (n);
 
        /* first, check for valid errnum */
-#if PLATFORM_ANDROID
+#if HOST_ANDROID
        /* Android NDK defines _GNU_SOURCE but strerror_r follows the XSI semantics
         * not the GNU one. XSI version returns an integer, as opposed to the GNU one
         * which returns pointer to the buffer.
index 141b675c01097f4e4e087756810cb5f5108bfa5c..e5992e5e71f03357080123ffb7a460016db8c488 100644 (file)
  * OS X doesn't define MAP_ANONYMOUS, but it does define MAP_ANON.
  * Alias them to fix: https://bugzilla.xamarin.com/show_bug.cgi?id=3419
  */
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
 #ifndef MAP_ANONYMOUS
 #define MAP_ANONYMOUS MAP_ANON
 #endif  /* ndef MAP_ANONYMOUS */
-#endif  /* ndef PLATFORM_MACOSX */
+#endif  /* ndef HOST_DARWIN */
 
 /*
  * XATTR_AUTO is a synonym for 0 within XattrFlags, but most systems don't
index afbe46624447d87a05a10d44e367427e0b45311d..143148f8ca3c0e345657eb62bd406252a157f935 100644 (file)
@@ -13,7 +13,7 @@
 #define _XOPEN_SOURCE 600
 #endif
 
-#ifdef PLATFORM_MACOSX
+#ifdef HOST_DARWIN
 /* For mincore () */
 #define _DARWIN_C_SOURCE
 #endif
index 3edf7be4163bac5febd12a6987d64dfbaa5d2b86..7b6797acb04160a9b17fdc038389dfaece9dae5a 100644 (file)
@@ -31,7 +31,7 @@ Mono_Posix_Syscall_sendfile (int out_fd, int in_fd, mph_off_t *offset, mph_size_
 
        _offset = *offset;
 
-#if defined(PLATFORM_MACOSX) || defined(PLATFORM_BSD)
+#if defined(HOST_DARWIN) || defined(HOST_BSD)
        /* The BSD version has 6 arguments */
        g_assert_not_reached ();
 #else
index 1123f2bc0fac9112b60e8f398e11b685eb59783c..0f560e28d00afcb0eaefd31c415b2ca018bdfc29 100644 (file)
@@ -230,7 +230,7 @@ Mono_Posix_Syscall_setdomainname (const char *name, mph_size_t len)
 /* Android implements truncate, but doesn't declare it.
  * Result is a warning during compilation, so skip it.
  */
-#ifndef PLATFORM_ANDROID
+#ifndef HOST_ANDROID
 gint32
 Mono_Posix_Syscall_truncate (const char *path, mph_off_t length)
 {
index 1a53e3772b7a01686881710930f90104034ccfda..b64d44c231e6de3172bc4c1c9a3ee79d5bec59e5 100644 (file)
@@ -38,7 +38,7 @@ monograph_LDADD = \
        $(LIBICONV)                     \
        -lm
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 monograph_LDFLAGS=-framework CoreFoundation
 endif
 
index 517cdbd0de4b786cb714fbd70a3de33f3d9eb366..81c438f810af4e969dfb95dccf4da9fc120f8f9f 100644 (file)
@@ -126,7 +126,7 @@ namespace CppSharp
                 });*/
 
             foreach (var target in AndroidTargets)
-                target.Defines.AddRange (new string[] { "PLATFORM_ANDROID",
+                target.Defines.AddRange (new string[] { "HOST_ANDROID",
                     "TARGET_ANDROID", "MONO_CROSS_COMPILE", "USE_MONO_CTX"
                 });
         }
@@ -148,7 +148,7 @@ namespace CppSharp
             });
 
             foreach (var target in iOSTargets) {
-                target.Defines.AddRange (new string[] { "PLATFORM_DARWIN",
+                target.Defines.AddRange (new string[] { "HOST_DARWIN",
                     "TARGET_IOS", "TARGET_MACH", "MONO_CROSS_COMPILE", "USE_MONO_CTX",
                     "_XOPEN_SOURCE"
                 });
@@ -162,7 +162,7 @@ namespace CppSharp
             });
 
             foreach (var target in DarwinTargets) {
-                target.Defines.AddRange (new string[] { "PLATFORM_DARWIN",
+                target.Defines.AddRange (new string[] { "HOST_DARWIN",
                     "TARGET_IOS", "TARGET_MACH", "MONO_CROSS_COMPILE", "USE_MONO_CTX",
                     "_XOPEN_SOURCE"
                 });
index 4fb8260abdb5eabf4910592d391487d1e3310721..7a2776c851421bcac377310c5bf2ac9627e7335c 100644 (file)
@@ -25,6 +25,6 @@ pedump_LDADD =                        \
        $(GLIB_LIBS)                    \
        $(LIBICONV)
 
-if PLATFORM_DARWIN
+if HOST_DARWIN
 pedump_LDFLAGS=-framework CoreFoundation -framework Foundation
 endif
index 97d9f4c433a1a6462c6e92f3b25e7bd83098f713..00edfeec2f7bd4b97fcf92d01db189f9e93b607e 100644 (file)
@@ -55,7 +55,7 @@
 #define DISABLE_PORTABILITY 1
 
 /* Windows does not have symlinks */
-#define PLATFORM_NO_SYMLINKS 1
+#define HOST_NO_SYMLINKS 1
 
 /* String of disabled features */
 #define DISABLED_FEATURES "none"