]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/readline] Fix link error on MinGW due to missing 'alarm'
authorEli Zaretskii <eliz@gnu.org>
Sat, 4 Jan 2025 10:19:55 +0000 (12:19 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sat, 4 Jan 2025 10:19:55 +0000 (12:19 +0200)
  The previous solution used symbols that exist only in MinGW64.
  Add a stub implementation of 'alarm' for mingw.org's MinGW.

readline/readline/input.c

index 39bbff1398a69c266e04aa7e7ef22dc3f5359e18..df682a5f2985cc49e4e2c96770d226e02f396104 100644 (file)
@@ -151,6 +151,14 @@ win32_isatty (int fd)
 #  define RL_TIMEOUT_USE_SELECT
 #else
 #  define RL_TIMEOUT_USE_SIGALRM
+#  ifdef __MINGW32_MAJOR_VERSION
+/* mingw.org's MinGW doesn't have 'alarm'.  */
+unsigned int
+alarm (unsigned int seconds)
+{
+  return 0;
+}
+#  endif
 #endif
 
 int rl_set_timeout (unsigned int, unsigned int);