aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2024-11-16 13:43:22 -0700
committerTom Tromey <tom@tromey.com>2024-12-16 13:04:35 -0700
commit975cb893f45de2a927e226883e7a76ee5e333baa (patch)
treeb8584e2d71da71b5dcdbd09c5bdd84e7045e320a
parent425f843d58c5748f23776759f4f1b55869ba2b89 (diff)
downloadbinutils-975cb893f45de2a927e226883e7a76ee5e333baa.zip
binutils-975cb893f45de2a927e226883e7a76ee5e333baa.tar.gz
binutils-975cb893f45de2a927e226883e7a76ee5e333baa.tar.bz2
Fix readline build on mingw
Upstream readline 8.2 does not build on mingw. This patch fixes the build, but I do not know how well it works. I've submitted this to readline here: https://lists.gnu.org/archive/html/bug-readline/2024-11/msg00007.html Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32265
-rw-r--r--readline/readline/input.c9
-rw-r--r--readline/readline/rlprivate.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/readline/readline/input.c b/readline/readline/input.c
index f68fcac..39bbff1 100644
--- a/readline/readline/input.c
+++ b/readline/readline/input.c
@@ -21,6 +21,13 @@
#define READLINE_LIBRARY
+#if defined (__MINGW32__)
+/* These are needed to get the declaration of 'alarm' when including
+ <unistd.h>. */
+#define __USE_MINGW_ALARM
+#define _POSIX
+#endif
+
#if defined (__TANDEM)
# define _XOPEN_SOURCE_EXTENDED 1
# define _TANDEM_SOURCE 1
@@ -834,7 +841,7 @@ rl_getc (FILE *stream)
/* We know at this point that _rl_caught_signal == 0 */
#if defined (__MINGW32__)
- if (isatty (fd)
+ if (isatty (fd))
return (_getch ()); /* "There is no error return." */
#endif
result = 0;
diff --git a/readline/readline/rlprivate.h b/readline/readline/rlprivate.h
index d87d07a..cb9cf17 100644
--- a/readline/readline/rlprivate.h
+++ b/readline/readline/rlprivate.h
@@ -303,7 +303,7 @@ extern int _rl_pushed_input_available (void);
extern int _rl_timeout_init (void);
extern int _rl_timeout_handle_sigalrm (void);
-#if defined (_POSIXSELECT_H_)
+#if defined (RL_TIMEOUT_USE_SELECT)
/* use as a sentinel for fd_set, struct timeval, and sigset_t definitions */
extern int _rl_timeout_select (int, fd_set *, fd_set *, fd_set *, const struct timeval *, const sigset_t *);
#endif