summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 16:33:36 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-03-02 16:33:36 +0000
commit6df2fbf0f6c4efa68865bec69598894f89d61d0b (patch)
tree1d8d06f26dfefed1de174f9d00d804a2376380a9 /ext
parente4211600a94143266970e4edb925aed17e5abc56 (diff)
merge revision(s) r45225,r45240: [Backport #9578]
* ext/readline/readline.c (Init_readline): Use rl_hook_func_t instead of Function to support readline-6.3. (rl_hook_func_t is available since readline-4.2.) Reported by Dmitry Medvinsky. [ruby-core:61141] [Bug #9578] * ext/readline/extconf.rb (rl_hook_func_t): define as Function for very old readline versions. [ruby-core:61209] [Bug #9578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@45252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/readline/extconf.rb8
-rw-r--r--ext/readline/readline.c2
2 files changed, 9 insertions, 1 deletions
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 4920137bf1..74e34d4d7c 100644
--- a/ext/readline/extconf.rb
+++ b/ext/readline/extconf.rb
@@ -19,6 +19,10 @@ def readline.have_func(func)
return super(func, headers)
end
+def readline.have_type(type)
+ return super(type, headers)
+end
+
dir_config('curses')
dir_config('ncurses')
dir_config('termcap')
@@ -93,4 +97,8 @@ readline.have_func("remove_history")
readline.have_func("clear_history")
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
+unless readline.have_type("rl_hook_func_t")
+ $DEFS << "-Drl_hook_func_t=Function"
+end
+
create_makefile("readline")
diff --git a/ext/readline/readline.c b/ext/readline/readline.c
index 502e73e5c8..fe2ad7810d 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1883,7 +1883,7 @@ Init_readline()
rl_attempted_completion_function = readline_attempted_completion_function;
#if defined(HAVE_RL_PRE_INPUT_HOOK)
- rl_pre_input_hook = (Function *)readline_pre_input_hook;
+ rl_pre_input_hook = (rl_hook_func_t *)readline_pre_input_hook;
#endif
#ifdef HAVE_RL_CATCH_SIGNALS
rl_catch_signals = 0;