mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-21 15:09:23 +08:00
OSX build error fixes
This commit is contained in:
@@ -30,6 +30,9 @@ public:
|
|||||||
virtual int write(const unsigned char* buffer, unsigned int length) = 0;
|
virtual int write(const unsigned char* buffer, unsigned int length) = 0;
|
||||||
|
|
||||||
virtual void close() = 0;
|
virtual void close() = 0;
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
virtual int setNonblock(bool nonblock) = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -36,6 +36,10 @@ public:
|
|||||||
|
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
int setNonblock(bool nonblock) { return 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CRingBuffer<unsigned char> m_buffer;
|
CRingBuffer<unsigned char> m_buffer;
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,11 @@
|
|||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <termios.h>
|
#include <termios.h>
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
#include <util.h>
|
||||||
|
#else
|
||||||
#include <pty.h>
|
#include <pty.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) :
|
CPseudoTTYController::CPseudoTTYController(const std::string& symlink, unsigned int speed, bool assertRTS) :
|
||||||
|
|||||||
@@ -328,8 +328,13 @@ bool CUARTController::setRaw()
|
|||||||
::cfsetispeed(&termios, B230400);
|
::cfsetispeed(&termios, B230400);
|
||||||
break;
|
break;
|
||||||
case 460800U:
|
case 460800U:
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
::cfsetospeed(&termios, 460800);
|
||||||
|
::cfsetispeed(&termios, 460800);
|
||||||
|
#else
|
||||||
::cfsetospeed(&termios, B460800);
|
::cfsetospeed(&termios, B460800);
|
||||||
::cfsetispeed(&termios, B460800);
|
::cfsetispeed(&termios, B460800);
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
LogError("Unsupported serial port speed - %u", m_speed);
|
LogError("Unsupported serial port speed - %u", m_speed);
|
||||||
|
|||||||
@@ -38,6 +38,10 @@ public:
|
|||||||
|
|
||||||
virtual void close();
|
virtual void close();
|
||||||
|
|
||||||
|
#if defined(__APPLE__)
|
||||||
|
int setNonblock(bool nonblock) { return 0; }
|
||||||
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CUDPSocket m_socket;
|
CUDPSocket m_socket;
|
||||||
sockaddr_storage m_addr;
|
sockaddr_storage m_addr;
|
||||||
|
|||||||
Reference in New Issue
Block a user