Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE.

This commit is contained in:
Christopher Kohlhoff 2017-12-02 23:32:35 +11:00
parent 52498bbc64
commit ff9d69e2fc
2 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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;