Skip to content

Commit

Permalink
OSX build error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Home authored and Home committed Aug 13, 2021
1 parent 14bf500 commit 03a4837
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 3 deletions.
3 changes: 3 additions & 0 deletions ModemPort.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ class IModemPort {
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:
};
Expand Down
4 changes: 4 additions & 0 deletions NullController.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ class CNullController : public IModemPort {
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<unsigned char> m_buffer;
Expand Down
6 changes: 5 additions & 1 deletion PseudoTTYController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@
#include <fcntl.h>
#include <unistd.h>
#include <termios.h>
#include <pty.h>
#if defined(__APPLE__)
#include <util.h>
#else
#include <pty.h>
#endif


CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) :
Expand Down
9 changes: 7 additions & 2 deletions UARTController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions UDPController.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ class CUDPController : public IModemPort {
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;
Expand Down

0 comments on commit 03a4837

Please sign in to comment.