summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-01 11:55:03 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-05-01 11:55:03 +0000
commitab58587f6a3bbd3ca03d0707637712a166441142 (patch)
tree1b2bfbc2f1272dd4b3a7fc0f3ec00d0783855171 /ext
parentb8b43fbdbea07bfa8e0f2d3ca65871d80b7c903e (diff)
merge revision(s) r45225,r45240,r45488: [Backport #9578] [Backport #9630]
* 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] * ext/readline/extconf.rb: fix typo, `$defs` not `$DEFS`. [ruby-core:61756] [Bug #9578] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45772 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 0b121c1ebe..0477a513c7 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')
@@ -94,4 +98,8 @@ readline.have_func("clear_history")
readline.have_func("rl_redisplay")
readline.have_func("rl_insert_text")
readline.have_func("rl_delete_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 820c6b74be..da3b10939c 100644
--- a/ext/readline/readline.c
+++ b/ext/readline/readline.c
@@ -1974,7 +1974,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;