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:52:16 +0300 |
commit | 2c78813a69308377a29303d997c5ce3b8c7fe472 (patch) | |
tree | fef8fa0be338de14e717fd5d598e8e9f76948002 /support | |
parent | a9a759626a2a725f658097a8c25287209c1d4929 (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; |