From 1dbe59300165b023924c798ca4ee46708463deb3 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 26 Feb 2015 11:32:54 +0100 Subject: [PATCH] Restrict IOKit usage to desktop OSX. IOKit is a private framework in iOS, so it can't be used (and no headers are provided, so it doesn't even compile). --- support/serial.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/support/serial.c b/support/serial.c index 681c914f807..94d7e0b19f5 100644 --- a/support/serial.c +++ b/support/serial.c @@ -33,7 +33,8 @@ #endif /* sys/time.h (for timeval) is required when using osx 10.3 (but not 10.4) */ -#ifdef __APPLE__ +/* IOKit is a private framework in iOS, so exclude there */ +#if defined(__APPLE__) && !defined(HOST_IOS) #include #include #include @@ -383,7 +384,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__ || __APPLE__ +#if __linux__ || (defined(__APPLE__) && !defined(HOST_IOS)) /* On Linux to set a custom baud rate, we must set the * "standard" baud_rate to 38400. On Apple we set it purely @@ -416,7 +417,7 @@ set_attributes (int fd, int baud_rate, MonoParity parity, int dataBits, MonoStop { return FALSE; } -#elif __APPLE__ +#elif defined(__APPLE__) && !defined(HOST_IOS) speed_t speed = baud_rate; if (ioctl(fd, IOSSIOSPEED, &speed) == -1) return FALSE; -- 2.25.1