diff --git a/ModemPort.h b/ModemPort.h index c537f9e..4589111 100644 --- a/ModemPort.h +++ b/ModemPort.h @@ -30,6 +30,9 @@ public: virtual int write(const unsigned char* buffer, unsigned int length) = 0; virtual void close() = 0; +#if defined(__APPLE__) + virtual int setNonblock(bool nonblock) = 0; +#endif private: }; diff --git a/NullController.h b/NullController.h index 2dad99b..1d8da63 100644 --- a/NullController.h +++ b/NullController.h @@ -35,6 +35,10 @@ public: virtual int write(const unsigned char* buffer, unsigned int length); virtual void close(); + +#if defined(__APPLE__) + int setNonblock(bool nonblock) { return 0; } +#endif private: CRingBuffer m_buffer; diff --git a/PseudoTTYController.cpp b/PseudoTTYController.cpp index 8c3cd7a..1205064 100644 --- a/PseudoTTYController.cpp +++ b/PseudoTTYController.cpp @@ -32,7 +32,11 @@ #include #include #include -#include +#if defined(__APPLE__) + #include +#else + #include +#endif CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) : diff --git a/UARTController.cpp b/UARTController.cpp index cc748b1..0a2d5f6 100644 --- a/UARTController.cpp +++ b/UARTController.cpp @@ -328,8 +328,13 @@ bool CUARTController::setRaw() ::cfsetispeed(&termios, B230400); break; case 460800U: - ::cfsetospeed(&termios, B460800); - ::cfsetispeed(&termios, B460800); +#if defined(__APPLE__) + ::cfsetospeed(&termios, 460800); + ::cfsetispeed(&termios, 460800); +#else + ::cfsetospeed(&termios, B460800); + ::cfsetispeed(&termios, B460800); +#endif break; default: LogError("Unsupported serial port speed - %u", m_speed); diff --git a/UDPController.h b/UDPController.h index 85ee612..cbb547f 100644 --- a/UDPController.h +++ b/UDPController.h @@ -37,6 +37,10 @@ public: virtual int write(const unsigned char* buffer, unsigned int length); virtual void close(); + +#if defined(__APPLE__) + int setNonblock(bool nonblock) { return 0; } +#endif protected: CUDPSocket m_socket;