Skip to content

Commit

Permalink
Fix build with newer editline
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo98 committed Oct 2, 2023
1 parent fc2cb86 commit eb801d8
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 1 deletion.
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
20 changes: 20 additions & 0 deletions configure

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

5 changes: 5 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5992,6 +5992,11 @@ 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_DECL([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 eb801d8

Please sign in to comment.