Prepare Mono for Android NDK with unified headers (#5680)
[mono.git] / mono / utils / mono-threads-posix-signals.c
index a4de7746d9f0de61b0f7870c79608aa330f3be56..b39277393f5d87a979793202fcae936459086a32 100644 (file)
@@ -1,5 +1,6 @@
-/*
- * mono-threads-posix-signals.c: Shared facility for Posix signals support
+/**
+ * \file
+ * Shared facility for Posix signals support
  *
  * Author:
  *     Ludovic Henry (ludovic@gmail.com)
 #include <errno.h>
 #include <signal.h>
 
+#ifdef HAVE_ANDROID_LEGACY_SIGNAL_INLINES_H
+#include <android/legacy_signal_inlines.h>
+#endif
+
 #include "mono-threads-debug.h"
 
 gint
@@ -38,8 +43,6 @@ mono_threads_suspend_search_alternative_signal (void)
 #endif
 }
 
-#ifndef __native_client__
-
 static int suspend_signal_num = -1;
 static int restart_signal_num = -1;
 static int abort_signal_num = -1;
@@ -63,7 +66,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;
@@ -80,7 +83,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;
@@ -99,7 +102,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;
@@ -245,7 +248,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);
@@ -273,33 +276,4 @@ mono_threads_suspend_get_abort_signal (void)
        return abort_signal_num;
 }
 
-#else
-
-void
-mono_threads_suspend_init_signals (void)
-{
-       g_assert_not_reached ();
-}
-
-gint
-mono_threads_suspend_get_suspend_signal (void)
-{
-       return -1;
-}
-
-gint
-mono_threads_suspend_get_restart_signal (void)
-{
-       return -1;
-}
-
-gint
-mono_threads_suspend_get_abort_signal (void)
-{
-       return -1;
-}
-
-#endif /* __native_client__ */
-
-
 #endif /* defined(USE_POSIX_BACKEND) */