11
22/*
3- * Copyright (C) 1991, 1992, 1993, 2021, 2022, 2023, 2024 by Chris Thewalt (thewalt@ce.berkeley.edu)
3+ * Copyright (C) 1991, 1992, 1993, 2021, 2022, 2023, 2024, 2025 by Chris Thewalt
4+ * (thewalt@ce.berkeley.edu)
45 *
56 * Permission to use, copy, modify, and distribute this software
67 * for any purpose and without fee is hereby granted, provided
@@ -119,14 +120,14 @@ namespace {
119120#endif
120121
121122namespace {
122- #ifdef __unix__
123+ #if defined( __unix__) && !defined(NO_TERMIOS)
123124#include < termios.h>
124125 struct termios io_new_termios, io_old_termios;
125126#endif
126127
127128 void gl_char_init () /* turn off input echo */
128129 {
129- #ifdef __unix__
130+ #if defined( __unix__) && !defined(NO_TERMIOS)
130131 tcgetattr (0 , &io_old_termios);
131132 io_new_termios = io_old_termios;
132133 io_new_termios.c_iflag &= ~(BRKINT | ISTRIP | IXON | IXOFF);
@@ -140,7 +141,7 @@ namespace {
140141
141142 void gl_char_cleanup () /* undo effects of gl_char_init */
142143 {
143- #ifdef __unix__
144+ #if defined( __unix__) && !defined(NO_TERMIOS)
144145 tcsetattr (0 , TCSANOW, &io_old_termios);
145146#endif /* __unix__ */
146147 }
@@ -197,7 +198,7 @@ namespace {
197198 int gl_getc ()
198199 /* get a character without echoing it to screen */
199200 {
200- #ifdef __unix__
201+ #if defined( __unix__)
201202 char ch;
202203 while (read (0 , &ch, 1 ) == -1 ) {
203204 if (errno != EINTR) {
0 commit comments