gh-105323: Remove `WITH_APPLE_EDITLINE` to use the same declaration for all editline (gh-112513)

This commit is contained in:
Tian Gao 2023-12-05 05:52:28 -09:00 committed by GitHub
parent 8cdfee1bb9
commit e7e1116a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 2 additions and 36 deletions

View File

@ -1043,10 +1043,8 @@ on_hook(PyObject *func)
static int static int
#if defined(_RL_FUNCTION_TYPEDEF) #if defined(_RL_FUNCTION_TYPEDEF)
on_startup_hook(void) on_startup_hook(void)
#elif defined(WITH_APPLE_EDITLINE)
on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#else #else
on_startup_hook(void) on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#endif #endif
{ {
int r; int r;
@ -1065,10 +1063,8 @@ on_startup_hook(void)
static int static int
#if defined(_RL_FUNCTION_TYPEDEF) #if defined(_RL_FUNCTION_TYPEDEF)
on_pre_input_hook(void) on_pre_input_hook(void)
#elif defined(WITH_APPLE_EDITLINE)
on_pre_input_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#else #else
on_pre_input_hook(void) on_pre_input_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#endif #endif
{ {
int r; int r;

17
configure generated vendored
View File

@ -23971,7 +23971,6 @@ fi
# Check whether --with-readline was given. # Check whether --with-readline was given.
if test ${with_readline+y} if test ${with_readline+y}
then : then :
@ -23994,22 +23993,6 @@ else $as_nop
fi fi
# gh-105323: Need to handle the macOS editline as an alias of readline.
case $ac_sys_system/$ac_sys_release in #(
Darwin/*) :
ac_fn_c_check_type "$LINENO" "Function" "ac_cv_type_Function" "#include <readline/readline.h>
"
if test "x$ac_cv_type_Function" = xyes
then :
printf "%s\n" "#define WITH_APPLE_EDITLINE 1" >>confdefs.h
fi
;; #(
*) :
;;
esac
if test "x$with_readline" = xreadline if test "x$with_readline" = xreadline
then : then :

View File

@ -5914,7 +5914,6 @@ dnl library (tinfo ncursesw ncurses termcap). We now assume that libreadline
dnl or readline.pc provide correct linker information. dnl or readline.pc provide correct linker information.
AH_TEMPLATE([WITH_EDITLINE], [Define to build the readline module against libedit.]) AH_TEMPLATE([WITH_EDITLINE], [Define to build the readline module against libedit.])
AH_TEMPLATE([WITH_APPLE_EDITLINE], [Define to build the readline module against Apple BSD editline.])
AC_ARG_WITH( AC_ARG_WITH(
[readline], [readline],
@ -5931,15 +5930,6 @@ AC_ARG_WITH(
[with_readline=readline] [with_readline=readline]
) )
# gh-105323: Need to handle the macOS editline as an alias of readline.
AS_CASE([$ac_sys_system/$ac_sys_release],
[Darwin/*], [AC_CHECK_TYPE([Function],
[AC_DEFINE([WITH_APPLE_EDITLINE])],
[],
[@%:@include <readline/readline.h>])],
[]
)
AS_VAR_IF([with_readline], [readline], [ AS_VAR_IF([with_readline], [readline], [
PKG_CHECK_MODULES([LIBREADLINE], [readline], [ PKG_CHECK_MODULES([LIBREADLINE], [readline], [
LIBREADLINE=readline LIBREADLINE=readline

View File

@ -1800,9 +1800,6 @@
/* Define if WINDOW in curses.h offers a field _flags. */ /* Define if WINDOW in curses.h offers a field _flags. */
#undef WINDOW_HAS_FLAGS #undef WINDOW_HAS_FLAGS
/* Define to build the readline module against Apple BSD editline. */
#undef WITH_APPLE_EDITLINE
/* Define if you want build the _decimal module using a coroutine-local rather /* Define if you want build the _decimal module using a coroutine-local rather
than a thread-local context */ than a thread-local context */
#undef WITH_DECIMAL_CONTEXTVAR #undef WITH_DECIMAL_CONTEXTVAR