Skip to content

Commit

Permalink
pythongh-109191: Fix build with newer editline (pythongh-110239)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 authored Oct 9, 2023
1 parent 12cc679 commit f4cb0d2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix compile error when building with recent versions of libedit.
2 changes: 1 addition & 1 deletion Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ readline_set_completion_display_matches_hook_impl(PyObject *module,
default completion display. */
rl_completion_display_matches_hook =
readlinestate_global->completion_display_matches_hook ?
#if defined(_RL_FUNCTION_TYPEDEF)
#if defined(HAVE_RL_COMPDISP_FUNC_T)
(rl_compdisp_func_t *)on_completion_display_matches_hook : 0;
#else
(VFunction *)on_completion_display_matches_hook : 0;
Expand Down
19 changes: 19 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5999,6 +5999,13 @@ AS_VAR_IF([with_readline], [no], [
AC_DEFINE([HAVE_RL_APPEND_HISTORY], [1], [Define if readline supports append_history])
])
# in readline as well as newer editline (April 2023)
AC_CHECK_TYPE([rl_compdisp_func_t],
[AC_DEFINE([HAVE_RL_COMPDISP_FUNC_T], [1],
[Define if readline supports rl_compdisp_func_t])],
[],
[readline_includes])
m4_undefine([readline_includes])
])dnl WITH_SAVE_ENV()
])
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -983,6 +983,9 @@
/* Define if you can turn off readline's signal handling. */
#undef HAVE_RL_CATCH_SIGNAL

/* Define if readline supports rl_compdisp_func_t */
#undef HAVE_RL_COMPDISP_FUNC_T

/* Define if you have readline 2.2 */
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER

Expand Down

0 comments on commit f4cb0d2

Please sign in to comment.