[serial,signal] Add support for Linux arbitrary baud rates + drop Apple legacy poll...
[mono.git] / support / signal.c
index c92bf3c69d3f3679e44cf6286b78b9b905935aa4..28146c02611a82acbc253cd4b87f8aaa4ca8db4a 100644 (file)
 #ifndef HOST_WIN32
 #include <sys/time.h>
 #include <sys/types.h>
+#if defined(HAVE_POLL_H)
 #include <poll.h>
+#elif defined(HAVE_SYS_POLL_H)
+#include <sys/poll.h>
+#endif
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <pthread.h>
-#include <mono/io-layer/atomic.h>
+#include <mono/utils/atomic.h>
 #include <mono/metadata/appdomain.h>
 #endif
 
@@ -32,7 +36,9 @@ G_BEGIN_DECLS
 typedef void (*mph_sighandler_t)(int);
 typedef struct Mono_Unix_UnixSignal_SignalInfo signal_info;
 
+#ifndef HOST_WIN32
 static int count_handlers (int signum);
+#endif
 
 void*
 Mono_Posix_Stdlib_SIG_DFL (void)
@@ -101,7 +107,7 @@ int Mono_Posix_FromRealTimeSignum (int offset, int *r)
 
 #ifndef HOST_WIN32
 
-#ifdef WAPI_ATOMIC_ASM
+#ifndef WAPI_NO_ATOMIC_ASM
        #define mph_int_get(p)     InterlockedExchangeAdd ((p), 0)
        #define mph_int_inc(p)     InterlockedIncrement ((p))
        #define mph_int_dec_test(p)     (InterlockedDecrement ((p)) == 0)