mirror of
https://github.com/python/cpython.git
synced 2025-10-21 14:12:27 +00:00
gh-117845: Detect libedit hook function signature in configure (#117870)
Older libedit versions (like Apple's) use a different type signature for rl_startup_hook and rl_pre_input_hook. Add a configure check to determine which signature is accepted by introducing the Py_RL_STARTUP_HOOK_TAKES_ARGS macro in pyconfig.h.
This commit is contained in:
parent
f74e51229c
commit
8515fd79fe
5 changed files with 71 additions and 2 deletions
|
@ -1041,7 +1041,7 @@ on_hook(PyObject *func)
|
|||
}
|
||||
|
||||
static int
|
||||
#if defined(_RL_FUNCTION_TYPEDEF)
|
||||
#if defined(_RL_FUNCTION_TYPEDEF) || !defined(Py_RL_STARTUP_HOOK_TAKES_ARGS)
|
||||
on_startup_hook(void)
|
||||
#else
|
||||
on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
|
||||
|
@ -1061,7 +1061,7 @@ on_startup_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
|
|||
|
||||
#ifdef HAVE_RL_PRE_INPUT_HOOK
|
||||
static int
|
||||
#if defined(_RL_FUNCTION_TYPEDEF)
|
||||
#if defined(_RL_FUNCTION_TYPEDEF) || !defined(Py_RL_STARTUP_HOOK_TAKES_ARGS)
|
||||
on_pre_input_hook(void)
|
||||
#else
|
||||
on_pre_input_hook(const char *Py_UNUSED(text), int Py_UNUSED(state))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue