summaryrefslogtreecommitdiff
path: root/ports/unix/modtermios.c
diff options
context:
space:
mode:
authorYAMAMOTO Takashi <yamamoto@midokura.com>2024-02-13 16:31:40 +0900
committerDamien George <damien@micropython.org>2024-02-15 16:54:17 +1100
commit809d113dbc37a032e87accc95c140f189733e0c4 (patch)
treead0dedb323af80e3753197acf72930dbca9fcf93 /ports/unix/modtermios.c
parentf9704ce36e2396001b34d86a01b75af607901f94 (diff)
unix: Don't include system headers when features are disabled.
Because the target system may not have these headers at all. Signed-off-by: YAMAMOTO Takashi <yamamoto@midokura.com>
Diffstat (limited to 'ports/unix/modtermios.c')
-rw-r--r--ports/unix/modtermios.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ports/unix/modtermios.c b/ports/unix/modtermios.c
index 4f9751e27..8a79bc3a5 100644
--- a/ports/unix/modtermios.c
+++ b/ports/unix/modtermios.c
@@ -24,6 +24,8 @@
* THE SOFTWARE.
*/
+#if MICROPY_PY_TERMIOS
+
#include <sys/types.h>
#include <termios.h>
#include <unistd.h>
@@ -33,8 +35,6 @@
#include "py/runtime.h"
#include "py/mphal.h"
-#if MICROPY_PY_TERMIOS
-
STATIC mp_obj_t mod_termios_tcgetattr(mp_obj_t fd_in) {
struct termios term;
int fd = mp_obj_get_int(fd_in);