Skip to content

Commit f4cb0d2

Browse files
authored
gh-109191: Fix build with newer editline (gh-110239)
1 parent 12cc679 commit f4cb0d2

File tree

5 files changed

+31
-1
lines changed

5 files changed

+31
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix compile error when building with recent versions of libedit.

Modules/readline.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ readline_set_completion_display_matches_hook_impl(PyObject *module,
446446
default completion display. */
447447
rl_completion_display_matches_hook =
448448
readlinestate_global->completion_display_matches_hook ?
449-
#if defined(_RL_FUNCTION_TYPEDEF)
449+
#if defined(HAVE_RL_COMPDISP_FUNC_T)
450450
(rl_compdisp_func_t *)on_completion_display_matches_hook : 0;
451451
#else
452452
(VFunction *)on_completion_display_matches_hook : 0;

configure

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5999,6 +5999,13 @@ AS_VAR_IF([with_readline], [no], [
59995999
AC_DEFINE([HAVE_RL_APPEND_HISTORY], [1], [Define if readline supports append_history])
60006000
])
60016001
6002+
# in readline as well as newer editline (April 2023)
6003+
AC_CHECK_TYPE([rl_compdisp_func_t],
6004+
[AC_DEFINE([HAVE_RL_COMPDISP_FUNC_T], [1],
6005+
[Define if readline supports rl_compdisp_func_t])],
6006+
[],
6007+
[readline_includes])
6008+
60026009
m4_undefine([readline_includes])
60036010
])dnl WITH_SAVE_ENV()
60046011
])

pyconfig.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -983,6 +983,9 @@
983983
/* Define if you can turn off readline's signal handling. */
984984
#undef HAVE_RL_CATCH_SIGNAL
985985

986+
/* Define if readline supports rl_compdisp_func_t */
987+
#undef HAVE_RL_COMPDISP_FUNC_T
988+
986989
/* Define if you have readline 2.2 */
987990
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
988991

0 commit comments

Comments
 (0)