From 6f464948f0a561b915ace9b04be660de1909390c Mon Sep 17 00:00:00 2001 From: David Hodo Date: Tue, 9 Dec 2014 14:50:37 -0600 Subject: [PATCH] Make MARK/SPACE partiy support optional --- src/impl/unix.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/impl/unix.cc b/src/impl/unix.cc index e1465a4..1fc3e84 100755 --- a/src/impl/unix.cc +++ b/src/impl/unix.cc @@ -369,12 +369,17 @@ Serial::SerialImpl::reconfigurePort () options.c_cflag |= (PARENB); } else if (parity_ == parity_odd) { options.c_cflag |= (PARENB | PARODD); - } else if (parity_ == parity_mark) { + } +// CMSPAR is not defined on OSX. don't support mark or space parity +#ifdef CMSPAR + else if (parity_ == parity_mark) { options.c_cflag |= (PARENB | CMSPAR | PARODD); } else if (parity_ == parity_space) { options.c_cflag |= (PARENB | CMSPAR); options.c_cflag &= (tcflag_t) ~(PARODD); - } else { + } +#endif //CMSPAR + else { throw invalid_argument ("invalid parity"); } // setup flow control