diff options
author | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2015-02-26 13:32:54 +0300 |
---|---|---|
committer | Rolf Bjarne Kvinge <rolf@xamarin.com> | 2015-02-26 15:49:59 +0300 |
commit | 1dbe59300165b023924c798ca4ee46708463deb3 (patch) | |
tree | ec64078da329e2d51a80d3cb9c2fb005c9975fbe /support | |
parent | 4b6173d11fe15cf022ca9aecaf0e92ad27f73bde (diff) |
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).
Diffstat (limited to 'support')
-rw-r--r-- | support/serial.c | 7 |
1 files 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 <sys/time.h> #include <IOKit/IOKitLib.h> #include <IOKit/serial/IOSerialKeys.h> @@ -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; |