From 8356eb2af9c77dad4e81627d3a96e7d692519be8 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Fri, 11 Sep 2015 15:12:16 +0200 Subject: [PATCH] There's no IOKit on the Apple TV. --- mono/metadata/mono-route.h | 2 +- support/serial.c | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/mono/metadata/mono-route.h b/mono/metadata/mono-route.h index 333a24367ad..4bafef4653c 100644 --- a/mono/metadata/mono-route.h +++ b/mono/metadata/mono-route.h @@ -5,7 +5,7 @@ #include -#ifdef HOST_IOS +#if defined (HOST_IOS) || defined (HOST_WATCHOS) || defined (HOST_APPLETVOS) // The iOS SDK does not provide the net/route.h header but using the Darwin version works fine. #include "../../support/ios/net/route.h" #else diff --git a/support/serial.c b/support/serial.c index 94d7e0b19f5..ec02e48b5e8 100644 --- a/support/serial.c +++ b/support/serial.c @@ -34,7 +34,11 @@ /* sys/time.h (for timeval) is required when using osx 10.3 (but not 10.4) */ /* IOKit is a private framework in iOS, so exclude there */ -#if defined(__APPLE__) && !defined(HOST_IOS) +#if defined(__APPLE__) && !defined(HOST_IOS) && !defined(HOST_WATCHOS) && !defined(HOST_APPLETVOS) +#define HAVE_IOKIT 1 +#endif + +#if defined(HAVE_IOKIT) #include #include #include @@ -384,7 +388,7 @@ set_attributes (int fd, int baud_rate, MonoParity parity, int dataBits, MonoStop if (cfsetospeed (&newtio, baud_rate) < 0 || cfsetispeed (&newtio, baud_rate) < 0) return FALSE; } else { -#if __linux__ || (defined(__APPLE__) && !defined(HOST_IOS)) +#if __linux__ || defined(HAVE_IOKIT) /* On Linux to set a custom baud rate, we must set the * "standard" baud_rate to 38400. On Apple we set it purely @@ -417,7 +421,7 @@ set_attributes (int fd, int baud_rate, MonoParity parity, int dataBits, MonoStop { return FALSE; } -#elif defined(__APPLE__) && !defined(HOST_IOS) +#elif defined(HAVE_IOKIT) speed_t speed = baud_rate; if (ioctl(fd, IOSSIOSPEED, &speed) == -1) return FALSE; -- 2.25.1