From 4aee95e0928ebf672a6c367b71bff22db9d53ff3 Mon Sep 17 00:00:00 2001 From: "Darryl L. Miles" Date: Thu, 17 Jul 2025 20:57:25 +0100 Subject: [PATCH] autoconf: utilize HAVE_SYS_IOCTL_COMPAT_H HAVE_TERMIO_H --- textio/textioInt.h | 7 +++++++ utils/magsgtty.h | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/textio/textioInt.h b/textio/textioInt.h index 067606ad..f33f55d3 100644 --- a/textio/textioInt.h +++ b/textio/textioInt.h @@ -44,10 +44,17 @@ typedef struct { /* all of the state associated with a tty terminal */ #if !defined(SYSV) && !defined(CYGWIN) && !defined(__OpenBSD__) && !defined(EMSCRIPTEN) +#if defined(HAVE_SYS_IOCTL_COMPAT_H) || defined(HAVE_SGTTY_H) +#if defined(HAVE_SYS_IOCTL_COMPAT_H) +#include /* replaced sgtty.h */ +#elif defined(HAVE_SGTTY_H) +#include /* legacy - struct sgttyb{} defn */ +#endif typedef struct { struct sgttyb tx_i_sgtty; struct tchars tx_i_tchars; } txTermState; +#endif /* HAVE_SYS_IOCTL_COMPAT_H || HAVE_SGTTY_H */ #endif /* SYSV */ extern bool TxGetInputEvent(bool block, bool returnOnSigWinch); diff --git a/utils/magsgtty.h b/utils/magsgtty.h index 298aaf8e..59e0678a 100644 --- a/utils/magsgtty.h +++ b/utils/magsgtty.h @@ -38,9 +38,9 @@ #include #endif -#ifdef HAVE_TERMIOS_H +#if defined(HAVE_TERMIOS_H) #include -#else +#elif defined(HAVE_SYS_IOCTL_COMPAT_H) /* unclear which platform(s) require and the structure * of this file is such that it will try to include it by default, better * to invert the #if and only select this on the known platforms that need @@ -48,11 +48,17 @@ * many possible solutions to make this work by default: * HAVE_SYS_IOCTL_COMPAT_H ? HAVE_TERMIOS_H ? !defined(linux) at top (MaxOSX is BSD type) */ -#include +#include /* replaced sgtty.h */ +#elif defined(HAVE_SGTTY_H) +#include /* legacy - struct sgttyb{} defn */ #endif #else + +#if defined(HAVE_TERMIO_H) #include #endif +#endif /* !SYSV && !CYGWIN */ + #endif /* _MAGIC__UTILS__MAGSGTTY_H */