]> git.datadissipation.net Git - ust.git/commitdiff
DTR/DSR, DCD macro switches are now platform-agnostic. master
authorgit <git@git.datadissipation.net>
Sat, 14 Feb 2026 19:25:22 +0000 (14:25 -0500)
committergit <git@git.datadissipation.net>
Sat, 14 Feb 2026 19:29:04 +0000 (14:29 -0500)
Fixed "declaration after label" warning/error

ust.c

diff --git a/ust.c b/ust.c
index 350fcf75b0ff81b289affab0648cb2571a032fa9..b9cee49cd21bbca4fef83432c87ffa8ea96f6853 100644 (file)
--- a/ust.c
+++ b/ust.c
@@ -23,7 +23,7 @@
 #define LF '\n'
 #define BS '\b'
 #define DEL '\x7f'
-#ifndef __linux__
+#if defined(CCDTR_IFLOW) && defined(CDSR_OFLOW)
  #define CDTRDSR (CDTR_IFLOW | CDSR_OFLOW)
 #endif
 #define IXONXOFF (IXON | IXOFF)
@@ -333,14 +333,14 @@ openport()
        if (hard == 1) {
                cntrl.c_cflag |= CRTSCTS;
        } else if (hard == 2) {
-               #ifdef __linux__
-                fprintf(stderr, "DTR/DSR flow control is not supported on Linux\nenabling this option does nothing!\n");
+               #ifndef CDTRDSR
+                fprintf(stderr, "DTR/DSR flow control is not supported on this platform\nenabling this option does nothing!\n");
                #else
                 cntrl.c_lflag |= CDTRDSR;
                #endif
        } else if (hard == 3) {
                cntrl.c_cflag &= ~CLOCAL;
-               #ifndef __linux__
+               #ifdef CCAR_OFLOW
                 cntrl.c_lflag |= CCAR_OFLOW;
                #endif
        }
@@ -823,7 +823,7 @@ getcmd(int escape)
                                newterm.c_lflag &= ~ICANON;
                        settermattr(STDIN_FILENO, &newterm);
                        break;
-               case 'p':
+               case 'p':;
                        int st;
                        struct timespec ts;
                        ts.tv_sec = spulsedelay;