summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3/python3-fix-build-error-with-Readline-6.3.patch
blob: 44e2b7e5f1dd895d44616b93950e7fc80eea52a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
python3: fix build error with Readline 6.3

Backport two patches from upstream:

use new readline function types (closes #20374)
Issue #20374: Avoid compiler warnings when compiling readline with libedit.

Upstream-Status: Backport

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
---
 Modules/readline.c |   15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/Modules/readline.c b/Modules/readline.c
index 096c6d1..1646ef8 100644
--- a/Modules/readline.c
+++ b/Modules/readline.c
@@ -773,15 +773,24 @@ on_hook(PyObject *func)
     return result;
 }
 
+
 static int
+#if defined(_RL_FUNCTION_TYPEDEF)
 on_startup_hook(void)
+#else
+on_startup_hook()
+#endif
 {
     return on_hook(startup_hook);
 }
 
 #ifdef HAVE_RL_PRE_INPUT_HOOK
 static int
+#if defined(_RL_FUNCTION_TYPEDEF)
 on_pre_input_hook(void)
+#else
+on_pre_input_hook()
+#endif
 {
     return on_hook(pre_input_hook);
 }
@@ -936,12 +945,12 @@ setup_readline(void)
     rl_bind_key_in_map ('\t', rl_complete, emacs_meta_keymap);
     rl_bind_key_in_map ('\033', rl_complete, emacs_meta_keymap);
     /* Set our hook functions */
-    rl_startup_hook = (Function *)on_startup_hook;
+    rl_startup_hook = (rl_hook_func_t *)on_startup_hook;
 #ifdef HAVE_RL_PRE_INPUT_HOOK
-    rl_pre_input_hook = (Function *)on_pre_input_hook;
+    rl_pre_input_hook = (rl_hook_func_t *)on_pre_input_hook;
 #endif
     /* Set our completion function */
-    rl_attempted_completion_function = (CPPFunction *)flex_complete;
+    rl_attempted_completion_function = (rl_completion_func_t *)flex_complete;
     /* Set Python word break characters */
     completer_word_break_characters =
         rl_completer_word_break_characters =
-- 
1.7.9.5