Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE.
This commit is contained in:
parent
52498bbc64
commit
ff9d69e2fc
@ -73,7 +73,7 @@ asio::error_code reactive_serial_port_service::open(
|
||||
s = descriptor_ops::error_wrapper(::tcgetattr(fd, &ios), ec);
|
||||
if (s >= 0)
|
||||
{
|
||||
#if defined(_BSD_SOURCE)
|
||||
#if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
::cfmakeraw(&ios);
|
||||
#else
|
||||
ios.c_iflag &= ~(IGNBRK | BRKINT | PARMRK
|
||||
|
@ -113,7 +113,7 @@ ASIO_SYNC_OP_VOID serial_port_base::baud_rate::store(
|
||||
ec = asio::error::invalid_argument;
|
||||
ASIO_SYNC_OP_VOID_RETURN(ec);
|
||||
}
|
||||
# if defined(_BSD_SOURCE)
|
||||
# if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
::cfsetspeed(&storage, baud);
|
||||
# else
|
||||
::cfsetispeed(&storage, baud);
|
||||
@ -249,7 +249,7 @@ ASIO_SYNC_OP_VOID serial_port_base::flow_control::store(
|
||||
{
|
||||
case none:
|
||||
storage.c_iflag &= ~(IXOFF | IXON);
|
||||
# if defined(_BSD_SOURCE)
|
||||
# if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
storage.c_cflag &= ~CRTSCTS;
|
||||
# elif defined(__QNXNTO__)
|
||||
storage.c_cflag &= ~(IHFLOW | OHFLOW);
|
||||
@ -257,14 +257,14 @@ ASIO_SYNC_OP_VOID serial_port_base::flow_control::store(
|
||||
break;
|
||||
case software:
|
||||
storage.c_iflag |= IXOFF | IXON;
|
||||
# if defined(_BSD_SOURCE)
|
||||
# if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
storage.c_cflag &= ~CRTSCTS;
|
||||
# elif defined(__QNXNTO__)
|
||||
storage.c_cflag &= ~(IHFLOW | OHFLOW);
|
||||
# endif
|
||||
break;
|
||||
case hardware:
|
||||
# if defined(_BSD_SOURCE)
|
||||
# if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
storage.c_iflag &= ~(IXOFF | IXON);
|
||||
storage.c_cflag |= CRTSCTS;
|
||||
break;
|
||||
@ -305,7 +305,7 @@ ASIO_SYNC_OP_VOID serial_port_base::flow_control::load(
|
||||
{
|
||||
value_ = software;
|
||||
}
|
||||
# if defined(_BSD_SOURCE)
|
||||
# if defined(_BSD_SOURCE) || defined(_DEFAULT_SOURCE)
|
||||
else if (storage.c_cflag & CRTSCTS)
|
||||
{
|
||||
value_ = hardware;
|
||||
|
Loading…
Reference in New Issue
Block a user