Skip to content

Commit

Permalink
pythongh-105323: Remove WITH_APPLE_EDITLINE to use the same declara…
Browse files Browse the repository at this point in the history
…tion for all editline (pythongh-112513)
  • Loading branch information
gaogaotiantian authored Dec 5, 2023
1 parent 8cdfee1 commit e7e1116
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 36 deletions.
8 changes: 2 additions & 6 deletions Modules/readline.c
Original file line number Diff line number Diff line change
Expand Up @@ -1043,10 +1043,8 @@ on_hook(PyObject *func)
static int
#if defined(_RL_FUNCTION_TYPEDEF)
on_startup_hook(void)
#elif defined(WITH_APPLE_EDITLINE)
on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#else
on_startup_hook(void)
on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#endif
{
int r;
Expand All @@ -1065,10 +1063,8 @@ on_startup_hook(void)
static int
#if defined(_RL_FUNCTION_TYPEDEF)
on_pre_input_hook(void)
#elif defined(WITH_APPLE_EDITLINE)
on_pre_input_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#else
on_pre_input_hook(void)
on_pre_input_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
#endif
{
int r;
Expand Down
17 changes: 0 additions & 17 deletions configure

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

10 changes: 0 additions & 10 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5914,7 +5914,6 @@ dnl library (tinfo ncursesw ncurses termcap). We now assume that libreadline
dnl or readline.pc provide correct linker information.

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(
[readline],
Expand All @@ -5931,15 +5930,6 @@ AC_ARG_WITH(
[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], [
PKG_CHECK_MODULES([LIBREADLINE], [readline], [
LIBREADLINE=readline
Expand Down
3 changes: 0 additions & 3 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1800,9 +1800,6 @@
/* Define if WINDOW in curses.h offers a field _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
than a thread-local context */
#undef WITH_DECIMAL_CONTEXTVAR
Expand Down

0 comments on commit e7e1116

Please sign in to comment.