Skip to content

Commit

Permalink
Add check for _DEFAULT_SOURCE in addition to _BSD_SOURCE.
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskohlhoff committed Dec 2, 2017
1 parent 52498bb commit ff9d69e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions asio/include/asio/impl/serial_port_base.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -249,22 +249,22 @@ 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);
# endif
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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ff9d69e

Please sign in to comment.