Skip to content

Commit 53122bc

Browse files
miss-islingtonBo98
andauthored
[3.12] gh-109191: Fix build with newer editline (gh-110239) (gh-110562)
gh-109191: Fix build with newer editline (gh-110239) (cherry picked from commit f4cb0d2) Co-authored-by: Bo Anderson <[email protected]>
1 parent 5afac0c commit 53122bc

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
@@ -442,7 +442,7 @@ readline_set_completion_display_matches_hook_impl(PyObject *module,
442442
default completion display. */
443443
rl_completion_display_matches_hook =
444444
readlinestate_global->completion_display_matches_hook ?
445-
#if defined(_RL_FUNCTION_TYPEDEF)
445+
#if defined(HAVE_RL_COMPDISP_FUNC_T)
446446
(rl_compdisp_func_t *)on_completion_display_matches_hook : 0;
447447
#else
448448
(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
@@ -6213,6 +6213,13 @@ AS_VAR_IF([with_readline], [no], [
62136213
AC_DEFINE([HAVE_RL_APPEND_HISTORY], [1], [Define if readline supports append_history])
62146214
])
62156215
6216+
# in readline as well as newer editline (April 2023)
6217+
AC_CHECK_TYPE([rl_compdisp_func_t],
6218+
[AC_DEFINE([HAVE_RL_COMPDISP_FUNC_T], [1],
6219+
[Define if readline supports rl_compdisp_func_t])],
6220+
[],
6221+
[readline_includes])
6222+
62166223
m4_undefine([readline_includes])
62176224
])dnl WITH_SAVE_ENV()
62186225
])

pyconfig.h.in

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

992+
/* Define if readline supports rl_compdisp_func_t */
993+
#undef HAVE_RL_COMPDISP_FUNC_T
994+
992995
/* Define if you have readline 2.2 */
993996
#undef HAVE_RL_COMPLETION_APPEND_CHARACTER
994997

0 commit comments

Comments
 (0)