Skip to content

Instantly share code, notes, and snippets.

@atsjj
Created June 5, 2014 22:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save atsjj/99ccdd921c0c4bff4aa5 to your computer and use it in GitHub Desktop.
Save atsjj/99ccdd921c0c4bff4aa5 to your computer and use it in GitHub Desktop.
ruby 2.0.0-p247 readline patch
From 6191e5efbf3a5c7cfa6b29b679270d5a0e2ad9d4 Mon Sep 17 00:00:00 2001
From: Steve Jabour <steve@jabour.me>
Date: Thu, 5 Jun 2014 16:02:49 -0600
Subject: [PATCH 1/1] ruby 2.0.0-p247 readline patch
---
ext/readline/extconf.rb | 9 +++++++++
ext/readline/readline.c | 2 +-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/ext/readline/extconf.rb b/ext/readline/extconf.rb
index 4920137..8e81253 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,9 @@ 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 502e73e..d6601d0 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;
--
1.9.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment