gh-109191: Fix build with newer editline (gh-110239)

This commit is contained in:
Bo Anderson 2023-10-09 14:21:20 +01:00 committed by GitHub
parent 12cc6792d0
commit f4cb0d27cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 31 additions and 1 deletions

View file

@ -0,0 +1 @@
Fix compile error when building with recent versions of libedit.

View file

@ -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;

19
configure generated vendored
View file

@ -24668,6 +24668,25 @@ printf "%s\n" "#define HAVE_RL_APPEND_HISTORY 1" >>confdefs.h
fi
# in readline as well as newer editline (April 2023)
ac_fn_c_check_type "$LINENO" "rl_compdisp_func_t" "ac_cv_type_rl_compdisp_func_t" "
#include <stdio.h> /* Must be first for Gnu Readline */
#ifdef WITH_EDITLINE
# include <editline/readline.h>
#else
# include <readline/readline.h>
# include <readline/history.h>
#endif
"
if test "x$ac_cv_type_rl_compdisp_func_t" = xyes
then :
printf "%s\n" "#define HAVE_RL_COMPDISP_FUNC_T 1" >>confdefs.h
fi
CFLAGS=$save_CFLAGS

View file

@ -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()
])

View file

@ -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