From bff479fc0fc3aff897abc5bc75dd1bf5ec25ff3b Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Mon, 12 Jun 2023 20:35:45 +0600 Subject: [PATCH] unix_serial_passthrough: Define cleanups and changes --- src/unix/unix_serial_passthrough.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/unix/unix_serial_passthrough.c b/src/unix/unix_serial_passthrough.c index 033fc1e87..61f23c345 100644 --- a/src/unix/unix_serial_passthrough.c +++ b/src/unix/unix_serial_passthrough.c @@ -21,7 +21,7 @@ # define _DEFAULT_SOURCE 1 # define _BSD_SOURCE 1 #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) # define __BSD_VISIBLE 1 #endif #include @@ -168,7 +168,7 @@ plat_serpt_set_params(void *p) term_attr.c_cflag &= CSTOPB; if (dev->serial->lcr & 0x04) term_attr.c_cflag |= CSTOPB; -#if defined(__APPLE__) || defined(__FreeBSD__) +#if !defined(__linux__) term_attr.c_cflag &= PARENB | PARODD; #else term_attr.c_cflag &= PARENB | PARODD | CMSPAR; @@ -177,7 +177,7 @@ plat_serpt_set_params(void *p) term_attr.c_cflag |= PARENB; if (!(dev->serial->lcr & 0x10)) term_attr.c_cflag |= PARODD; -#if !defined(__APPLE__) && !defined(__FreeBSD__) +#if defined(__linux__) if ((dev->serial->lcr & 0x20)) term_attr.c_cflag |= CMSPAR; #endif